r/GraphicsProgramming • • 7d ago

Source Code Reverse-engineering macOS Liquid Glass into an independent Linux EGL/GLSL offscreen renderer (SDF unions, mip blur, and retargetable springs)

Post image
7 Upvotes

I have been working on an open-source offscreen glass renderer for Linux (written in Rust and Python with OpenGL 4.5 / GLSL shaders) that recreates macOS-style refractive glass effects, and I wanted to rewrite this in plain English to get some thoughts from the community.

At a high level, the host app gives the renderer the background image (like your wallpaper or desktop) and a list of glass shapes. The renderer blurs and bends that background through the shapes and returns the finished image.

Here is roughly how it works under the hood:

  1. Shaping and melting the glass: Instead of building 3D meshes on the CPU, the shader uses simple math functions (distance fields) to describe rounded rectangles and pills. A nice bonus of doing it with math is that two nearby shapes can smoothly melt into one another when they get close, without having to rebuild any geometry.

  2. Blurring the background without killing performance: Running a big blur directly on a full-resolution screen every frame is too slow on integrated GPUs. Instead, we shrink the background down step by step into smaller, blurrier copies and sample from those. The tricky part is that if you shrink too aggressively or sample across levels carelessly, you can get faint blocky or wavy patterns (what I meant earlier by artifacts) when things move behind the glass. Finding the sweet spot between smooth blur and low frame times is still a balancing act.

  3. Bending the light and edge highlights: Near the curved border of a shape, the shader shifts where it looks up pixels from the background, which creates that lens-like bending effect. It also shifts red, green, and blue slightly differently for subtle color fringes, and adds a bright rim highlight.

  4. Only updating what changed: When something small changes behind the glass (like a ticking clock or a moving cursor), the Rust side tries to only re-render that small rectangle. Since the glass bends light from nearby pixels, we have to expand that update box slightly so the refracted edges do not look cut off.

Questions I would love to hear your take on:

  • When you do blurred backgrounds behind UI elements on integrated GPUs, what approach gives you the cleanest look without hurting frame times?

  • If you do partial screen updates behind a refractive or blurred effect, how do you handle the extra margin around the dirty rectangle?

Source code if anyone wants to poke around the shaders: https://github.com/SaMaili/liquid-glass-renderer

AI disclosure: AI assistance was used to help draft and format this post (and rewritten here to cut down on the jargon).


r/GraphicsProgramming • • Jun 03 '26

Question Future of graphics programming and AI

10 Upvotes

Hello all, I’m getting into graphics programming as a hobby. I’m currently learning c++ and I plan on moving into openGL and vulkan eventually.

I’m just wondering, if I wanted to make it a career a few years down the road, is it a promising career to get into? With AI affecting lots of industries, I have my doubts. I came from the Graphic Design industry and don’t feel very hopeful because of AI, I feel like years down the road I’ll probably get laid off. Not trying to be negative just wanna be ready for anything. I know no one can predict the future but will a career in graphics programming be steady and stable? Thank you!


r/GraphicsProgramming • • Oct 20 '21

Video Game Engine Programming: Hello everyone, The name is Shader, Engine Shader! Let's prepare the game engine for using shaders.

Thumbnail
youtu.be
6 Upvotes

r/GraphicsProgramming • • Oct 19 '26

Question Do you use AI-assisted coding at work?

12 Upvotes

For those working full-time as rendering, graphics, or low-level engine programmers, do you use AI-assisted coding tools like Claude, ChatGPT, or Copilot at all?? With all this talk about AI in the game industry recently I'm curious how widely it's actually being adopted professionally in these more specialized, low-level areas of programming.

If you do use it, how much of your workflow involves AI? Is it mostly for debugging, boilerplate, or understanding unfamiliar code, or do you actually use it to write and implement features?

And for those who don't use it, is that because AI isn't reliable enough for this type of work, or simply because you prefer writing the code yourself?

I'm interested in hearing what the actual industry experience is like, especially compared to all the noise surrounding AI coding tools.


r/GraphicsProgramming • • Mar 24 '26

What are companies looking for?

5 Upvotes

Hi! I really want to get a graphics programming job in the upcoming summer in the US. I don't have a degree and don't have work experience, but I'm cooking up a list of personal projects that would hopefully make my resume look better, i.g writing a rasterizer, out of core cpu ray tracer, and then combine them to make a final game. I'm real eager and would do a lot of things to make it happen. However, I don't know anybody in the field, so please consider adding me into your circle of internet friends! That aside, I'm looking to get a reality check and know what companies are really looking for to maximize my chance of getting hired.

Thank you!


r/GraphicsProgramming • • Aug 20 '26

Depressed not because of coding, but because of outside pressure. Anyone else feeling like this at my age?

0 Upvotes

Hey everyone,

I’m 16 years old, and I’ve been solo-developing a 3D code-driven game engine using Rust and wgpu for the past few months. I started this because I really want to achieve my first big milestone and have something real to show.

Honestly, I’m feeling completely burnt out and depressed right now. But it’s not because of the bugs or the coding. It's the suffocating pressure from my family and school. It’s building up day by day, and it's getting too heavy to carry. I feel like if I pause or stop working on this engine right now, I will fall behind, lose momentum, and delay my goals forever. I’m stuck between wanting to push forward to finish my first milestone and breaking down under life's pressure.

I’m posting this here because I really need to find a community, to connect with people who might understand this feeling. I don't want AI-generated advice or generic platitudes—I've heard enough of those. I just want to share what I've built so far and see if anyone else is fighting this same battle.

Here is what I have managed to implement in my engine by myself so far:

  • Core Architecture: Migrated to glam math library, integrated rapier3d for physics (locked at 60 FPS), and built a thread-safe lazy loading system to prevent OS-level screen freezing.

  • Rendering & Culling: Frustum culling (implemented with custom Plane checks), pixel depth testing, and Early-Z / Reverse-Z rendering.

  • Lighting: Successfully removed directional lights and created functional spot/point lights for indoor scenes. I have also set up the compute pipelines, passes, and necessary bind groups for a Forward+ culling framework (though only the structural framework is done, it's not fully finished yet).

  • Transparency: Implemented transparency rendering support.

  • Optimization: Integrated rayon to cut loading times in half, added CPU texture compression to BC7 (reducing RAM usage from 750MB to ~190MB and loading times to under 60ms), and integrated zstd for binary data file compression.

You can check out the source code here: https://github.com/Lbaodz/wgpu-code-driven-engine

Has anyone else gone through this at a young age? How do you deal with family pressure when you're just trying to build something you're proud of?


r/GraphicsProgramming • • Feb 08 '26

Question What graphics does CoD4 MW 2007 use?

5 Upvotes

Hello,

I've been watching singleplayer campaign for nostalgia but noticed how crisp everything is, the lights give off a really nice contrast and colors just fit.

Does anyone know what technology they used?
I couldn't find any presentations and I'm looking to use the same graphics in UE4 by changing BRDF, tonemapper and possibly lighting somehow.

Sorry if this is the wrong sub, I don't know where else to ask, I'd be grateful to anyone that had any clue about this.


r/GraphicsProgramming • • Jul 14 '25

14 y/o building a game engine in C with Vulkan from scratch. Early WIP, would love code review from experienced engine devs.

0 Upvotes

Hey everyone 👋,
I know the engine doesn’t have flashy features or realistic graphics yet, but I’m focusing on building the foundation right first. I’m hoping this post helps me improve faster with input from people who’ve walked this path before.

I'm 14 years old and I've been building a game engine from scratch in C using Vulkan for the past few months. This is by far my biggest project yet — and I’ve learned a ton in the process.

The engine is called MeltedForge, and it's still in early WIP stage. Right now, it supports:

  • Vulkan initialization with custom abstractions (no tutorials, no helper libraries like VMA)

  • Offscreen render targets (framebuffer rendering to sampled image in ImGui viewport)

  • Dynamic graphics pipeline creation from runtime resource bindings

  • Per-frame descriptor sets for UBOs and textures

  • A resizable ImGui interface with docking + viewport output

Everything is written manually in C — no C++, no wrapper engines.

🔗 GitHub Repo:
https://github.com/CloudCodingSpace/MeltedForge

I'm looking for honest, constructive code review, especially from more experienced Vulkan/graphics devs. If you notice anything odd, unsafe, unoptimized, or architecturally wrong — I’d love to hear it.

Thanks a ton for reading, and I appreciate any feedback 🙏


r/GraphicsProgramming • • Dec 27 '23

Question Dear Imgui GUI alternative in retained mode

8 Upvotes

Dear Imgui is great

  • Lightweight (full demo ~ 1 MB - low RAM consumption)

  • No bloat No dependencies - static link

  • Run on big 6 (Win/Linux/Mac/Android/iOS/Wasm) and more

  • Simple code

  • It's fast (using hardware accelerated video)

  • Almost perfect for games and alike

  • Good for GUIs

  • Some optimizations for immediate mode wasting

  • MIT licensing

The problem is rendering the entire screen every frame or when some pixel needs to be updated (I know it has some optimizations), it's power inefficient (just not mobile friendly). I ran some informal simple tests using some optimizations. It uses a little less CPU but a lot more GPU.

Is there any alternative using retained mode with the (near) above characteristics when we are only looking for GUIs?

Qt is out. All techs failing at many bullet points above are out. I'm trying https://slint.dev/ now.


r/GraphicsProgramming • • Aug 20 '26

Web Developer to Game Engine Developer: Advice for Starting in 2026?

4 Upvotes

Hey everyone! I’ve been a web developer for 5+ years (professionally for around ~3), and game development has always been a secret passion of mine, but I never really had the chance to pursue it as a career.

During my current degree, I took courses like Computer Graphics, Mathematics and Physics for Games, and they gradually made me more and more interested in this field.

Now, I’m seriously considering shifting my main focus toward game development, specifically game engine development.

For someone entering this field in 2026, what advice would you give? I’d especially love to hear from people who work on engines or have made a similar transition from web development.


r/GraphicsProgramming • • Jul 13 '25

How do you like my asset pipeline?

0 Upvotes

Texture.c:

unsigned char alignas(4096) blocktex[(TEXCOUNT16 << 9) + (TEXCOUNT8 << 8)] = {
    <Thousands upon thousands of octal escape characters>
};

Swift:

if let data = device.makeBuffer(bytesNoCopy: &blocktex, length: PAGE_ALIGN((texcount16 << 9) + (texcount8 << 8)), options: [], deallocator: nil), let buffer = queue.makeCommandBuffer(), let encoder = buffer.makeBlitCommandEncoder() {
	let size = MTLSizeMake(16, 16, 1), origin = MTLOrigin(), off = (texcount16 << 9)
	for slice in 0..<texcount16 {
		encoder.copy(from: data, sourceOffset: slice << 9, sourceBytesPerRow: 32, sourceBytesPerImage: 512, sourceSize: size, to: tex16, destinationSlice: slice, destinationLevel: 0, destinationOrigin: origin)
	}
	for slice in 0..<texcount8 {
		encoder.copy(from: data, sourceOffset: off + (slice << 8), sourceBytesPerRow: 16, sourceBytesPerImage: 256, sourceSize: size, to: tex8, destinationSlice: slice, destinationLevel: 0, destinationOrigin: origin)
	}
	encoder.endEncoding()
	buffer.commit()
}

r/GraphicsProgramming • • Feb 18 '24

Question Would you recommend getting into Graphics Programming?

4 Upvotes

I know that there already exist a lot of posts like this. However, I wanted to sort of ask it personally and elaborate on the situation that I'm in right now.

I'm 27, got my bachelor's in computer science about 2 years or so ago, and during these two years, I have mostly focused my career on AI (DL, ML, computer vision especially).
I have mastered Python, have an OK understanding of the underlying architecture of computers, and know a good deal about linear algebra but kinda not so knowledgeable when it comes to advanced calculus.

Lately, I wanted to restart doing Cpp projects and I wanted to shake the rust off by doing a small prep-project with OpenGL so I fired a tutorial, and started writing code and after a couple of days, I realized that I liked doing this. Ever since, I've been thinking about switching to Computer Graphics but I'm a tad skeptical tbh. I know that I have to learn OpenGL, Direct3D, Vulkan, and Cuda (probably) and these are not small things to learn over the weekend :| . Adding to all of this, I don't really know about the CG job market at all.

So, my question boils down to this, Considering the circumstances, do you recommend me to start studying CG?

These are some other question that I love to know the answer to:

  1. Should I be learning a 3D modeling software like Blender?

  2. What about a game engine like Unreal Engine?

  3. Do I have to learn both Vulkan and Direct3D?

  4. Is learning CUDA necessary?

  5. Should I study this book (Computer Graphics: Principles and Practice)?

  6. What is the job market situation?

And last but not least, if there is something else that I should know, I'd be glad to hear it guys.

Thanks <3


r/GraphicsProgramming • • Feb 17 '19

Are there any resources on how to make graphics look more polished?

4 Upvotes

My title is awful, so here's an example:

I want to make a program to train music note-reading. The obvious way to draw things is to draw 5 lines for the staff, have an image for each clef and type of note that I want, and then just do some math and draw the images on top of the lines where I need them.

But is this the best way? Is this enough to make it look "professional?" Should I round the ends of the lines? Will it work to just scale up the size of the clef/note images as needed?

I'm confidant that once I know what I want, I'll be able to figure out how to implement it. But I don't know how to figure out what approach will actually look good without a lot of trial and error. Are there any resources that talk about making those decisions or the theory behind it?


r/GraphicsProgramming • • May 10 '20

Firework simulation

Post image
0 Upvotes

r/GraphicsProgramming • • Sep 15 '26

ShadeNet-2 20M — single-pass inverse rendering (albedo/depth/normal/shading) from any RGB image

Thumbnail gallery
15 Upvotes

r/GraphicsProgramming • • Dec 03 '19

Ray Tracing

10 Upvotes

Hey guys
I'l trying to implement a raytracing algorithm, but I can't find any suitable tutorial
Any help?


r/GraphicsProgramming • • Sep 01 '26

Would it be possible to train an ai model to upscale a game from medium to ultra settings

0 Upvotes

With dlss 5 coming out and a lot of discussion online painting it as almost like a filter that’s adding detail to games that isn’t there (e.g. making characters look chiseled), it looks like it’s designed to make realistic looking games look more real without the side effect of making stylised games look uncanny.

It’s got me wondering if it’d be possible for a developer to train a narrow model specifically how to take renders from their game at lower settings and transform them into something akin to high settings.

The idea being that during development they could output millions of rendered images with metadata about the scene, buffers, movement vectors, etc, then have an offline process rerender those scenes at very high quality.

They could use the renders as input to a training model, and generate their own dlss like system specific for their game that would allow lower end hardware to output higher quality graphics.

Is that fundamentally possible? I’m guessing the restricting factor would be cost or just simply not being able to generate enough data? Even so could you compound training for your own game on top of the vendors implementations of dlss/fsr?

I’m not really in the know about ai upscaling techniques so sorry if this is a stupid question


r/GraphicsProgramming • • Nov 20 '23

GPU Engineer needed ($200k+)

0 Upvotes

I'm looking for an experienced 𝐂𝐫𝐲𝐩𝐭𝐨𝐠𝐫𝐚𝐩𝐡𝐢𝐜 𝐆𝐏𝐔 𝐄𝐧𝐠𝐢𝐧𝐞𝐞𝐫 (CUDA/C++/C) to join a the founding team startup developing the infrastructure necessary to meet the increasing demands for Zero Knowledge proof generation.

email resume to [email protected]

🇺🇸 🇨🇦𝘍𝘶𝘭𝘭𝘺 𝘙𝘦𝘮𝘰𝘵𝘦 𝘧𝘳𝘰𝘮 𝘜𝘚 𝘰𝘳 𝘊𝘢𝘯𝘢𝘥𝘢


r/GraphicsProgramming • • Jun 30 '25

Where to start?

3 Upvotes

Hey guys! Hope you are fine. I was just gonna ask, that I am going to make a game engine named WarAxe. I just wanted to know where to start?


r/GraphicsProgramming • • Aug 24 '26

I built a graphics framework for GT 710 – 10,000 cubes at 60fps, dual CPU/GPU backend – Tungstun

Post image
3 Upvotes

I had an old PC—H81 + i5-4570T + GT 710. Everyone told me to upgrade, but I didn’t want to. I wanted to make something actually usable for gaming.

So, I created "Tungstun". It's basically a full-fledged, "battery-included" framework. Written in Rust with the C API, and built entirely from scratch.

[Find Git Repo Here]

The main concept is that it houses two renderers internally. One is a modern OpenGL 4.3 AZDO path (a high-speed path using Pesistent Mapped Buffers and triple buffering), and the other is a multithreaded, tile-based CPU rasterizer written from scratch if the driver crashes, or if you're in a VM, or if your NVIDIA setup breaks due to Arch Linux Drives without and that is why my GT 710 is still going strong.

Another key design point is static linking. While `libGL` can be dynamically linked because it acts as a dispatcher for vendor drivers, Tungstun is built as an all-inclusive `staticlib`. This makes for a binary that runs anywhere, even without a pre-existing GL environment.

features

**Rendering** – Everything uses instantiation. Flush once after sending 10,000 objects (single-pull call). Includes prototyping, custom meshes, OBJ support, animated models via SSBO, custom GLSL 4.30 shaders (with uniforms for time, camera positions, etc.), material ID specification via alpha values ​​(to control skybox, emissive, and reflective effects in one shader), and more [GIF -]. Ocean Exhibition].

**Physics** - Continuous Collision Detection (CCD) to prevent high speed bullet tunneling. Supports sphere, AABB, and triangle mesh. Features a flat SoA layout, comprehensive moves using Radix-sort, layer masks (environment, player, enemies, projectiles, debris, etc.), raycasting, impulses, and gravity

**Textures** - Custom SWAR filtering (4-channel simultaneous processing), bilinear/trilinear filtering, ultra-fast display, automatic mipmap generation, texture embedding, and procedural font generation (built in memory; no external files required).

**View** - Flat structure (avoiding deep OOP hierarchies). Handles node creation, change settings, physics assignment, and physics synchronization. Only "dirty" nodes needing an update are recalculated.

**UI** - Fully batched quads (including rotated quads) and text. renders the entire menu in one draw call; Implemented in about 50 lines of code.

**Audio** - Full 3D spatial audio. Listener with position and orientation (forward/upward vectors). Supports sound playback in world coordinates, teleattenuation(i learnt this word recently), and panning. Implemented loading for WAV/MP3/OGG ​​formats (from file or memory), procedural sine wave generation (for fast SFX creation), volume/pitch control, and looping. Also created a "plinko marimba" in 3D space using 30 balls and 154 pegs (each peg mapped to a different musical note).

**Window Control** - Window creation, size recovery, delta timing calculation, input control (keys, mouse buttons, cursor position), mouse locking, rendering resolution settings, and Blit-based rendering (fast drawing) to optimize FPS on older hardware. Implemented I prepared four displays: a seascape featuring 10,000 Gerstner waves with waves; "Neon Hunter," a shooter where you fire lasers that stretch and shrink cubes; "Plinko Marimba" with 3D audio support; and the "Sponza Atrium," complete with two-story columns, glowing lanterns, floating artwork and volumetric fog (light scattering effects).

Benchmark results on a low-spec PC (the so-called "Potato PC"): 10,041 instances Even with 40 physics-enabled projectors (using Bullet) active, the system maintained a steady 60fps at 1280x720 resolution In contrast, running the same scene on Raylib resulted in only about 24fps It was due to draw-call overhead.

This project started with repurposing the great GT 710 to make great games, and I finally made it a reality.

It is released under the MIT License and has a very lightweight design. I’m also working on further optimizing the speed of the rasterizer.

If you have an older, less-featured PC, please give it a try. Feedback is welcome.

https://github.com/mahoraga94/tungstun


r/GraphicsProgramming • • Oct 05 '26

Video Sky dome for Ship Mooring application

3 Upvotes

We decided to go with a sky dome approach for the Sky we built for Optimoor 3D - Ship Mooring Application, built using WebGL & Three.js.

In case of skybox, A Cube Camera captures 6 instances of the scene that creates a cubemap image, then that image is placed on the inside walls of an invisible infinite cube to give the illusion of a sky that can be used with a scene.

But a skybox is often paired with large explorable scenes with cameras tied very close to the ground, for our Ship Mooring Application, the entire scene is very focused towards the actually viewable land close to Berth for Mooring and its other use cases, we don't need a larger landmass, but without it the entire scene would look finite and lack the illusion of a proper horizon.

Enter a circular Dome/Sphere that is bounded across the entire Scene (given in wireframe visuals for understanding). Along with that a texture of the sky is attached with backside of the mesh enabled. With some tweaks to the fog, we finally got the look where the world doesn't look flat-earthy while also not drawing a bigger landmass.

Built by 3D ENGINERD. for Tension Technology International Ltd.


r/GraphicsProgramming • • Nov 24 '23

Looking for a Mentor/Guide in Graphics Programming

3 Upvotes

Hey everyone!
I am a Rust Software Engineer and want to learn graphics programming preferably with Vulkan or an abstraction like wgpu. Looking for someone to have a call with (20$/hour, no Rust knowledge needed):

I will ask a bunch of dumb questions for one hour, to get my mental models right.

I am looking for someone with a low level understanding of what happens on the CPU and GPU, my questions will not be programming-language specific. I wrote some simple shaders in Unity and Bevy but would consider myself a beginner in graphics.

If this is not the right place to ask such questions, do you maybe know a discord where people come together to learn graphics programming?


r/GraphicsProgramming • • Mar 22 '21

Rendering 2 shapes from 2 different VBOs

0 Upvotes

Hey guys,

i am new in openGL

i am trying to render two shapes int the window, with two different Vertex Buffers.

i use glDrawArrays twice, but only one shape appears in the screen

if any can help me, i would be grateful :)

thanks


r/GraphicsProgramming • • Sep 16 '23

What is the best way to draw graphics is Rust?

0 Upvotes

Foreword: Hi, I'm having problems with making a game in Rust. Recently, I made a post, about the problem, what OpenGL in Rust is slow on MacOS. And got an answer, what I need to turn off the VSync (thank you). But now I have other problems, such as OpenGL doesn't able to build easily for Windows (I don't know why, something with unable to find bash on Windows, to run make).

Main topic: So I want to ask, what's the simplest and fastest way to make GUI in Rust? Because i have tried a lo-o-ot of ways to do that, the two main issues are: Have UI, but slow at drawing a lot of rects. Or fast at drawing rects, etc. but don't have UI. (Example for first group is SFML, for the second - MiniFB). Please can somebody tell me about a library, what can both, draw UI, and be fast at drawing a lot of rects, etc. (Like MiniFB's draw_with_buffer(window_buffer_var))?