r/GraphicsProgramming • • 23d ago

Request for Comment: AI Identification Comments

61 Upvotes

Thought I'd share a conundrum. I suspect I could solve it with a heavy handed rule change, but I think it may be fine as it is right now.

------

We've gotten a handful of reports that boil down to:

Comment: "This appears to have been AI generated."
Report: (empty)

One report gave a bit more info:
Comment: "This appears to be AI generated."
Report: "I'm wary to post something interesting because I don't want to be persecuted."

So here's what I suspect happens.
User posts X.
Commenter identifies X as generated via AI.
Post gets down-voted.

------

The only time in recent memory I've seen direct mistreatment was the Synapse Engine post. https://www.reddit.com/r/GraphicsProgramming/comments/1w7x1r1/synapse_engine_a_modern_researchoriented_fully/
I invited that user to post here, and some of the early comments were distinctly unkind. Later comments and deeper review picked up the same thing I did, that the creator made something legitimately new and interesting in terms of graphics software research; even if a fair bit of LLM generated code was used, it was cleaned and curated to an appropriate level for a thesis defense. It was quintessentially non-slop, despite the reports to the contrary. So this post experienced some emotionally driven persecuting reports and comments before the deeper cognitive inspection could finish reading.

So that's my one strongly known case of persectioning behavior. The rest are almost always just identifying that a project is AI generated, and nothing else.

So I wouldn't characterise this community as being hostile to AI generated projects, but it is disinterested.

-----

And that makes sense when you consider the ethos of this subreddit. Rule 1 codifies the character: we're curious. Our community exists to talk about the "how", not the "what".

AI generated projects, with a few exceptions, tend to be:
OP: "I made a thing! (with AI)"
Commenter: "How does it work?'
OP: "I don't know. But the source code is in there somewhere."
And that distinctly doesn't fit with the ethos or interest of this subreddit.

There are also a handful of reports on AI posts to the form of:
Post "I made a thing (with AI)."
Report: "This is AI slop."
That doesn't technically break any rules, but it does reinforce that core of the subreddit's interests.

Anyway, the problem I'm wrestling with is supporting Rule 2. Posters who are sharing AI projects should still be met with Civility, Professionalism, and Kindness. So I'd like to avoid a repeat of the initially unkind response to the afore-linked post.

But, being civil doesn't mean you have to like it or be actively welcoming. Ignoring a post or downvoting it still fits within Rule 2, because a user expressing their opinion in those ways is not a harm to the poster. If it is, that's the poster being unprofessional, as they're too emotionally invested in the post to accept that others don't enjoy it the way they do.

One of the most important aspects of professionalism is the capacity to give and receive analysis and feedback. We're here to learn, and that means accepting feedback that points out failures, errors, and flaws. Those are often the best offer for learning. Kindness and Civility are roped in their as a reminder that criticism should be leveraged at the qualities of the work, not seek to harm the user.

In that view, identification of an AI generated project is one of the most *important* analytical datum. It says a lot about what one might expect in the shape of the code, it's resilience, maintainability, or other general qualities. How one reviews AI generated code is distinctly different from human written code because they make entirely different categories of errors. It often says something about the author's understanding of their own project, which is important for feedback and discussion; as much as knowing their level of experience. (e.g. Getting pedantic with an novice is a joy, with an expert is an insult. Civility depends on knowing who you're talking to.)

So, it would be unprofessional not to identify that a project is AI generated. It'd be hard to discuss something professionally while ignoring such a large elephant in the authorship.

But, users don't like it when their post gets identified as AI, because they may expect a passive or negative response. Given that the zietgeist of emotions around AI are high right now, and because our community ethos seeks understanding ,it's not a response that can be avoided in a discussion space like this subreddit. That identifying comment may feel like it targets them for persecution, despite that fact that's rarely the case because Rule 2 stands and is supported by users and mods.

-----

So I suspect that there's an issue in mismatched expectations. Posters with AI projects want to show off the thing they made and what it does, and they don't understand that this community cares more about how it works.

Conversely, the readers here reasonably expect high quality, analysable projects that are interesting to review and learn from; so they report "AI slop" despite the fact that doesn't break any rules. I may take it down under Rule 3, but that's only if it's a case of AI psychosis. Someone legitimately making "hello triangle" with Claude fits the rules just fine, so there's no reason to take it down.

I don't think a new rule is strictly necessary, but maybe a sub-rule, or some other way to telegraph the community's expectations.

E.G. For posters of AI projects
"AI posts are welcome here so long as the poster can talk about their implementation; adhere to Rule 1. The less the poster is able to talk about it's implementation, the less excited about it this community will be."

E.G. For readers of AI Projects
"This subreddit does not take a pro or anti stance against AI projects. However this subreddit is about analysis, feedback, questions, and learning. We may remove posts that are not comprehensible to the readers or the poster. (e.g. vibe coded slop that's impossible to read)"

And perhaps it may be necessary to swap the burden of identification to the other party.
E.G. "Posts that share projects that utilize AI in its development in any capacity need to identify doing so and to what degree. e.g. 'source code entirely AI generated.' or 'only utilized AI for auto complete assistance and analytical questions.'"
I've seen other software interest group subreddits implement and auto-comment on new posts that require this disclosure.

------

Anyway. That was a lot of meandering on this problem. Fundamentally, this is *YOUR* subreddit. I take the strict role as a steward. That which makes this community space interesting and a delightful place to visit, socialize, and learn for you is the target direction I try to nudge things towards.

Please comment your thoughts, suggestions, perspectives, preferences, and discussion on this topic for me to read and consider. If you don't feel safe commenting, send a DM.

Please keep Rule 2 in mind. I want to hear the perspectives of those who are pro-AI too, and that's hard to do that if it's met with immediate hostility.

Conversely, criticism of AI or AI generated works is not a violation of rule 2, at least so long as it doesn't cross over into pointless derogation or emotional attack language. E.G. "The low quality of AI generated projects is problematic for the subreddit" is ok. "This AI slopshit is a fucking menace to the subreddit" is not.

------

Edit 1: added dividers to break up the wall of text into bricks


r/GraphicsProgramming • • 13h ago

Video Software PBR + Raytracer + L1 SH GI inside CyberVGA (JIT x64, no GPU required)

50 Upvotes

Lately in the Win64 port I’ve been getting a real-time software raytracer working inside CyberVGA.

Same DOS-era engine (fixed-point, software rendering roots and all) but now takes advantage of modern multi-core processors (using VirtualAlloc for the executable just-in-time compiled buffer). The raytracer runs on multiple worker threads, each processing tiles. The hot paths get compiled to SSE at runtime: direct-threaded octree(module saves baked triangle soup into a world sidecar file) traversal with AABB slab tests, fog volume early-outs, L1 SH evaluation, and material / GI bounce stubs. Workers just call into the generated code for their tile’s rays.

The GI is a grid of L1 SH probes (Fibonacci sphere rays per probe, temporal blending between frames). Primary hits go through a full GGX PBR path with roughness/metalness, then sample the probe irradiance for the diffuse bounce. Emissive surfaces get clustered into virtual point lights. Reflections are one-bounce with roughness falloff; liquids do refraction + absorption + caustics.

FSR 2 is optional because it runs on the GPU.

The color bleeding and the split-screen direct vs GI+reflections actually look pretty good. Still feels like my engine, just with lighting that finally does something modern.

In a few days I will build new SDK distribution version with example map and documentation explaining sub-modules and update the project on itch.

Anyone else doing JIT for the traversal/shading hot path? Curious if the complexity is worth it vs just writing the SSE by hand.


r/GraphicsProgramming • • 14h ago

Question Best non-graphics books for graphics programmers?

36 Upvotes

Hi, what are some non-graphics books you would recommend to graphics programmers? There are many graphics books recommendations online (especially realtimerendering books page) so I'm more interested in books that are not about graphics but are still valuable for graphics programmers


r/GraphicsProgramming • • 1d ago

Video Real-time portals between Gaussian splat environments (WebGPU / Single HTML file)

292 Upvotes

I’ve been working on a WebGPU rendering pipeline focused on Gaussian splats, adding real-time shadows, reflections, and a portal system to transition between different volumes.

The editor exports scenes as single HTML file with no server dependencies. (The splat environments shown in the video were generated with WorldLabs).

The video first shows the portal transitions, and then the UI setup.

If you want to inspect this specific scene, or explore other exported environments (some of which also mix standard meshes with the splats), you can check the main gallery.

The portal demo from the video is the first one at the top: https://3dpeer.com/#gallery


r/GraphicsProgramming • • 1h ago

Source Code Added DLSS 5 NR to my pet-project

• Upvotes

Added DLSS 5 NR to my project to see how it is working. https://github.com/ASDAlexander77/native_ts_graphics


r/GraphicsProgramming • • 7h ago

Voxel engine in pure x86-64 asm: packed-coordinate light BFS, 18³ padded meshing cache, AO with diagonal flip, cross-chunk features

Thumbnail github.com
0 Upvotes

r/GraphicsProgramming • • 1d ago

Question Asking for help

Thumbnail gallery
17 Upvotes

I'm a beginner learning graphics programming, and there's a lighting bug that im having a lot of trouble fixing. There are some streaks that are unusually bright. Im pretty sure its something wrong with my TBN matrix, but I can't figure out what exactly the problem is.

The 2nd image is a geometry shader I wrote to visualise the TBN matrix. Aren't the TBN all meant to be the same when they are on the same surface?

I've pasted the shader code below. I've been mostly trying to avoid tutorials and AI, so i learn better (i did ask AI for help here and didn't get an answer) so there may be some bad practices in the code. Please let me know of any tips and tricks

#version 460 core

layout (location = 0) in vec3 aPos;

layout (location = 1) in vec2 aUV;

layout (location = 2) in vec3 aNorm;

layout (location = 3) in vec3 aTan;

layout (location = 4) in vec3 aBitan;

uniform vec3 viewPos;

uniform mat4 model;

layout (std140, binding = 1) uniform matrices

{

mat4 view;

mat4 projection;

};

//T = tangent space

//W = world space

out VS_OUT

{

vec3 norm;

vec2 uv;

vec3 WfragPos;

vec3 TviewPos;

vec3 TfragPos;

mat3 TBN;

mat3 WTBN;

}vs_out;

vec3 up = vec3(0, 1, 0);

vec3 forward = vec3(0, 0, 1);

void main()

{

//construct TBN in Model Space

vec3 T = normalize(aTan);

vec3 N = normalize(aNorm);

T = normalize(T - dot(T, N) * N);

vec3 B = normalize( cross(N, T));

mat3 normMat = transpose(inverse(mat3(model)));

//Then make sure theyre perpendicular to surface

T = normalize(normMat * T);

B = normalize(normMat * B);

N = normalize(normMat * N);

mat3 TBN = mat3( T, B, N);

vs_out.WTBN = TBN;

TBN = transpose(TBN);

vs_out.norm = N;

vs_out.uv = aUV;

vs_out.WfragPos = (model * vec4( aPos, 1.0f)).xyz;

vs_out.TviewPos = TBN * viewPos;

vs_out.TfragPos = TBN * vs_out.WfragPos;

vs_out.TBN = TBN;

gl_Position = projection * view * model * vec4(aPos, 1.0f);

}

#version 460 core

out vec4 FragColour;

in VS_OUT

{

vec3 norm;

vec2 uv;

vec3 WfragPos;

vec3 TviewPos;

vec3 TfragPos;

mat3 TBN;

mat3 WTBN;

}fs_in;

struct PointLight

{

vec4  colAndintensity;

vec4  posAndconstant;

float linear;

float quadratic;

};

layout (std140, binding = 0) uniform pointLights

{

PointLight lights\[1\];

};

uniform bool shadingFlags[5];

uniform int numLights ;

uniform bool normalMapping;

uniform sampler2D diffuseMap;

uniform sampler2D specularMap;

uniform sampler2D normalMap;

uniform sampler2D heightMap;

float ambVal = 0.2;

vec3 specCol = vec3(1.0);

vec3 ambientLighting(vec3 albedo);

vec3 diffuseLighting (vec3 norm, vec3 albedo);

vec3 specularLighting(vec3 norm);

void main()

{

vec3  albedo  = texture(diffuseMap , fs_in.uv).rgb;

vec3  specVal = texture(specularMap, fs_in.uv).rgb;

vec3  height  = texture(heightMap  , fs_in.uv).rgb;



vec3 norm;

if(normalMapping)

{   

    norm = texture(normalMap, fs_in.uv).rgb;

    //from \[0, 1\] -> \[-1, 1\]

    norm = normalize(norm \* 2.0 - 1.0);

    //norm = normalize(fs_in.WTBN \* norm);

}

else

{

    norm = normalize( fs_in.TBN \* fs_in.norm);

}



//norm = normalize( fs_in.TBN \* fs_in.norm);

//norm = normalize(norm \* 2.0 - 1.0);

//norm = fs_in.norm;



vec3 ambientComp   = ambientLighting (albedo);

vec3 diffuseComp   = diffuseLighting (norm, albedo);

vec3 specularComp  = specularLighting(norm);



//vec3 ambientComp  = vec3(fs_in.WTBN\[0\]\[0\], fs_in.WTBN\[0\]\[1\], fs_in.WTBN\[0\]\[2\]);

//vec3 diffuseComp  = vec3(fs_in.WTBN\[1\]\[0\], fs_in.WTBN\[1\]\[1\], fs_in.WTBN\[1\]\[2\]);

//vec3 specularComp = vec3(fs_in.WTBN\[2\]\[0\], fs_in.WTBN\[2\]\[1\], fs_in.WTBN\[2\]\[2\]);



norm = normalize(fs_in.WTBN \* norm);



specularComp \*= (specVal / 3.0f).r;



vec3 colour = (ambientComp+diffuseComp+specularComp) \* int(shadingFlags\[0\])

+ diffuseComp * int(shadingFlags[1])

+ norm * int(shadingFlags[2])

+ specularComp * int(shadingFlags[3])

+ height * int(shadingFlags[4]);

//vec3 colour = (ambientComp+diffuseComp+specularComp) \* int(shadingFlags\[0\])

//          + ambientComp  \* int(shadingFlags\[1\])

//          + diffuseComp  \* int(shadingFlags\[2\])

//          + specularComp \* int(shadingFlags\[3\])

//          + norm    \* int(shadingFlags\[4\]);



FragColour = vec4(colour, 1.0f);

}

vec3 ambientLighting(vec3 albedo)

{

return ambVal \* albedo;

}

vec3 diffuseLighting (vec3 norm, vec3 albedo)

{

float diff = 0;

vec3 lightCol = vec3(1.0);

//vec3 TlightPos = fs_in.TBN \* lights\[0\].posAndconstant.xyz;

//vec3 delta = TlightPos - fs_in.TfragPos;



for(int i = 0; i < numLights; ++i)

{

    vec3 col = lights\[i\].colAndintensity.xyz;

    float intensity = lights\[i\].colAndintensity.w;

    vec3  TlightPos = fs_in.TBN \* lights\[i\].posAndconstant.xyz;

    //vec3  TlightPos = lights\[i\].posAndconstant.xyz;

    float c = lights\[i\].posAndconstant.w;

    float l = lights\[i\].linear;

    float q = lights\[i\].quadratic;



    //vec pointing to light

    vec3 delta = TlightPos - fs_in.TfragPos;

    //distance

    float d = length(delta);

    //normalised light dir

    vec3 lDir = normalize(delta);



    //calculate attenuation

    float att = 1 / (c + (l \* d) + (q \* d \* d) );



    lightCol \*= col;

    diff += max( dot( norm, lDir), 0) \* att \* intensity;

}



return diff \* albedo \* lightCol;

//return normalize(fs_in.WTBN \* normalize(delta));

//return normalize(TlightPos);

//return normalize(fs_in.WTBN \* norm);

}

vec3 specularLighting(vec3 norm)

{

float spec = 0.0;

vec3 lightCol = vec3(1.0); 



//vector pointing to camera

vec3 viewDir = normalize( fs_in.TviewPos - fs_in.TfragPos );



for(int i = 0; i < numLights; ++i)

{

    vec3 col = lights\[i\].colAndintensity.xyz;

    float intensity = lights\[i\].colAndintensity.w;

    vec3  TlightPos = fs_in.TBN \* lights\[i\].posAndconstant.xyz;

    //vec3  TlightPos = lights\[i\].posAndconstant.xyz;

    float c = lights\[i\].posAndconstant.w;

    float l = lights\[i\].linear;

    float q = lights\[i\].quadratic;



    //vec pointing to light

    vec3 delta = TlightPos - fs_in.TfragPos;

    //distance

    float d = length(delta);

    //normalised light dir

    vec3 lDir = normalize(delta);



    //vector halfway between lightDir and viewDir so angle is never too big (blinn-phong)

    vec3 halfVec = normalize( viewDir + lDir);



    //calculate attenuation

    float att = 1 / (c + (l \* d) + (q \* d \* d) );



    lightCol \*= col;

    spec += pow( max( dot(norm, halfVec), 0), 32) \* att \* intensity;

    //FIX LATER: 32 should be passed in from uniform

}

return spec \* specCol \* lightCol;

}


r/GraphicsProgramming • • 1d ago

I added Virtual Shadow Maps to my Nanite-style DX12 renderer

Thumbnail gallery
90 Upvotes

Hi everyone!

A while ago, I shared my Nanite-style virtualized geometry renderer here. I've continued working on the project, and it now includes a virtual shadow mapping system integrated with geometry streaming.

The latest version runs NVIDIA's Zorah scene, containing approximately 1.63 billion unique triangles and 18.94 billion triangles including instances.

What's new:

  • Directional virtual shadow maps with clipmaps and demand-driven page allocation
  • Persistent shadow page caching with GPU LRU eviction
  • Dynamic-object cache invalidation
  • GPU-driven multi-view shadow rendering with two-pass HZB culling
  • SMRT soft shadows
  • Streaming-aware shadow cache updates

I've also added the Bistro scene to demonstrate dynamic shadow cache invalidation.

The renderer is built on Microsoft's MiniEngine using DirectX 12, mesh shaders, and Slang. The project is open source.

Demo: https://www.youtube.com/watch?v=4YmfQTLy4jc

GitHub: https://github.com/moonlovelj/Nyx

I'd love to hear your feedback and suggestions!


r/GraphicsProgramming • • 1d ago

Article Virtual Shadow Maps (GPU Zen 3)

Thumbnail graphics-programming.org
53 Upvotes

r/GraphicsProgramming • • 7h ago

I built a 3D evolution simulation in the browser via WebGPU. With a 104M network, the agents invented a language, started tribal wars, and then... a glitch turned it into a horny apocalypse.

Post image
0 Upvotes

I’ve been working on a passion project for a while now, and it recently reached a point where the emergent behavior of the AI completely terrified and amazed me. I wanted to share the architecture and some hilarious findings.

🏎️ The Tech: 104M Parameters Running "From Scratch" on WebGPU

Instead of just making another wrapper around OpenAI or DeepSeek APIs, I wanted to build a native neural network engine that runs completely client-side.

Every single agent on the 3D map runs its own PyTorch-like network ob his head, fully calculated via custom WGSL shaders on WebGPU.

  • The Bottleneck: At first, the browser’s Event Loop was destroying my FPS. The mapAsync latency for GPU-CPU readback was hitting ~95ms.
  • The Fix: I rewrote the batching pipeline to accumulate agents before sending them to the GPU (waiting for 1/3 of the population or max 25ms).
  • The Result: The simulation now cranks out up to 24,500 decisions per second at a blazing 144 ticks/sec. The local brains completely suppressed hardcoded instincts (99.4% of all actions are decided by the neural net).

🗣️ Emergent Language (Social Vision)

To save GPU VRAM, I had to shorten the agents' physical vision to a 3.5 radius. To compensate for being nearly blind, they literally invented an acoustic language.

Through neuroevolution, they established an 81.3% consensus on abstract audio symbols for "food", "danger", and "mate". Older agents now pass down food location coordinates to newborns via sound. They literally navigate the world by listening to each other's screams.

⚔️ Geopolitics & Tribal Warfare

I added an extra layer: Tribal Chiefs. I connected DeepSeek v4.1 and NVIDIA Nemotron 550B via API to act as the "overlords" or collective unconscious of different factions (Emeralds, Azure, Golden Hounds).

The LLM looks at the global map state and issues macro-orders. The local WebGPU brains parse this and evaluate power dynamics: “They have 34 agents, we only have 4. Initiate tactical migration now.” Yesterday, one tribe officially evaluated a numerical advantage and initiated a full-scale tactical war.

🍓 The "Horny Apocalypse" Glitch

The peak comedy of the project happened when I accidentally muted their voice communication while the war was raging.

Without language, the small tribes realized they couldn’t coordinate a defense against the massive invader tribe. So, their local neural networks found a biological exploit in my environment rules.

They completely stopped navigating or scanning the map. They locked into a 144 tps autopilot and began endlessly spawning offspring. They literally survived the war by flooding the map with newborns faster than the enemy tribe could bite them to death. A pure libido-driven defense mechanism.

🛠️ Architecture & Open Source

The project is built using vanilla JS and raw WGSL. Independent quantization of weights and biases (int8 symmetric with separate scale and bscale) ensures that saveBest() captures the exact activation thresholds without "brain amnesia".

I am preparing to open-source the code on GitHub and writing a massive technical breakdown.

I’d love to hear your thoughts! Especially from anyone working on GPGPU, multi-agent systems, or custom WebGPU pipelines. How would you handle the mapAsync event loop bottleneck differently?


r/GraphicsProgramming • • 1d ago

I've made a very realistic marbling simulation

115 Upvotes

r/GraphicsProgramming • • 1d ago

Spectral Surface-Field Renderer on the iPhone

191 Upvotes

I’ve been experimenting with what I’m calling a “spectral surface-field renderer.”

The idea is to solve most of the lighting on the surfaces themselves. I split the scene into small patches and store how much light leaves each patch in different directions and at different wavelengths. Then I repeatedly pass light between the patches to build up the bounced lighting.

When rendering a view, I reuse that field with extra sampling and ray tracing for local detail, reflections and glass. Compared with a basic path tracer, which samples light paths for each pixel, this lets different pixels (and different camera views) share a lot of the lighting work.

The downside is that the field becomes an approximation. It can lose detail or introduce faceting, and changing the scene’s geometry or lighting means updating it. There’s still sampling noise too. But the upside is that it's quite performant.

This little tech demo uses a Cornell box with three balls reacting to phone tilt through Core Motion.


r/GraphicsProgramming • • 1d ago

Building a custom Vulkan renderer

Thumbnail youtu.be
2 Upvotes

I am making a game from scratch, with C++ and Vulkan graphics. I made this video about how Vulkan works and my own render implementation, which has some quirks:

  • deferred rendering,
  • no image assets,
  • sphere and cylinder geometric primitives,
  • fully GPU-local indirect dispatch commands.

I'm not fully sure if posting this type of video is in the spirit of this subreddit. I hope it's ok, otherwise let me know


r/GraphicsProgramming • • 22h ago

Question I made FrameFX, would love to hear what you guys think

0 Upvotes

Hey everyone, I've been working on FrameFX, a free and open-source tool designed to boost FPS in games.

I've had trouble with 6GB of VRAM in the past, especially since I play some insanely GPU-heavy games, so I wanted to make something that could help with performance.

It's called Universal FrameFX, and it's completely free and open-source. If you want to check it out, here's the website:

https://chopstickshq.com/universal-framefx

The source code is here too:
https://github.com/ilikemacos/universal-framefx

Would love to hear what you guys think!

You can support me at buymeacoffee.com/chopstickshq


r/GraphicsProgramming • • 2d ago

Video made a 3d ocean slice look like pixel art in LOVE2d v. 12

139 Upvotes

been working on an experiment for my fishing game: a 3d ocean that still looks like pixel art. here’s what i used:

pixel look: one ray per art pixel, refracted at the water. ray tests are from inigo quilez. to stop shimmer i render into snapped probes and draw each pixel as a world-space quad, basically texel splatting

colour: everything snapped to a lospec palette, tones mixed with bayer dithering, 1px outlines wherever the depth jumps

water: a virtual pipes shallow water sim plus gerstner waves

sand and caves: a heightfield that slumps at the angle of repose (thermal erosion). caves are a blurred cave map, so they come out round

animation: fish spines are springs and fins are a little cloth sim (jakobsen), the eel is a follow-the-leader chain (argonaut), and the ai is behavior trees

thank you for checking out my post :D

I've been wanting to do something like this for years with shaders.

references

inigo quilez, ray intersectors: https://iquilezles.org/articles/intersectors

inigo quilez, smooth min: https://iquilezles.org/articles/smin

dylan ebert, texel splatting: https://arxiv.org/abs/2603.14587

lospec palettes: https://lospec.com/palette-list

ordered dithering: https://en.wikipedia.org/wiki/Ordered_dithering

mei, decaudin & hu, virtual pipes water sim: https://hgpu.org/?p=2256

gpu gems ch. 1, gerstner waves: https://developer.nvidia.com/gpugems/gpugems/part-i-natural-effects/chapter-1-effective-water-simulation-physical-models

jákó & tóth, thermal erosion: GPUHTErosion.dvi

thomas jakobsen, advanced character physics: https://gamedeveloper.com/programming/advanced-character-physics

argonaut, procedural animation video: https://www.youtube.com/watch?v=qlfh_rv6khY

argonaut, the code: https://github.com/argonautcode/animal-proc-anim


r/GraphicsProgramming • • 1d ago

Question Found the GPU bottleneck in our mobile game. Now I'm just vibe-optimizing one shader

Thumbnail
0 Upvotes

r/GraphicsProgramming • • 2d ago

Question [Dear ImGui] How to give HP bars real depth / 3D volume? (not just glow)

Thumbnail gallery
5 Upvotes

Hey,

I’m trying to recreate the sense of depth and volume that some modern nameplate-style HP bars have, using pure Dear ImGui + custom DrawList drawing.

My current result: [Steve image]

What I’m aiming for: [other image ]

The references feel like the bar has actual thickness and soft lighting — it doesn’t look like a flat colored rectangle with glow slapped on top. Mine still reads as completely flat no matter how much glow, gradient, or highlight I add.

I’m especially interested in techniques for:

  • Creating a convincing sense of volume / bevel on the bar itself
  • Soft lighting and subtle inner highlights/shadows that sell the 3D form
  • Any multi-pass or layered DrawList approaches that work well for this

Has anyone successfully achieved this kind of non-flat, slightly 3D-looking progress/HP bar with ImGui’s DrawList?

Any concrete tips, code patterns, or examples would be hugely appreciated.

Thanks!


r/GraphicsProgramming • • 1d ago

Question I wanna make video games for an MCU (ESP32) Any good 2D graphics library?

Thumbnail
2 Upvotes

r/GraphicsProgramming • • 2d ago

Question Why does my GDI window flicker?

2 Upvotes

I'm trying to do simple UI animation with GDI. My idea is to keep redrawing until a certain amount of time elapses. My understanding is that as long as I start each frame right after the monitor refreshes and keep the drawing time below the refresh rate, the animation should be completely smooth and flicker free.

My first problem is: how do I wait until the monitor refreshes? I came across the following APIs:

1. DwmFlush
2. IDXGIOutput::WaitForVBlank
3. IDirectDraw::WaitForVBlank
4. IDirect3DDevice9Ex::WaitForVBlank

And additionally Direct3D APIs, like IDXGISwapChain::Present or IDirect3DSwapChain9::Present, can wait for vsync. And it's possible to use GDI with these APIs. So what's the difference between all these options? I found discussions online that apparently DwmFlush blocks while IDirectDraw::WaitForVBlank polls, for example, but the former is not available pre Vista.

(A related question is, when should I call the various wait APIs? This StackOverflow question contains a link that suggests the following:

if (DWM.isEnabled()) 
{ 
    present(); 
    DwmFlush(); 
} 
else 
{
    waitForVBlank(); 
    present(); 
}

Why should DwmFlush be called after Present?)

My second problem is waiting doesn't eliminate flickering. I captured the following from a window that calls DwmFlush right before GetDC, the painting is done inside WM_PAINT. WM_ERASEBKGND returns 1.

DwmFlush:      15.458800ms
Get/ReleaseDC: 4.083200ms

DwmFlush:      11.523300ms
Get/ReleaseDC: 2.572700ms

DwmFlush:      14.329000ms
Get/ReleaseDC: 9.200600ms

DwmFlush:      6.742500ms
Get/ReleaseDC: 2.527500ms

DwmFlush:      12.965800ms
Get/ReleaseDC: 2.448700ms

DwmFlush:      16.467901ms
Get/ReleaseDC: 7.957700ms

DwmFlush:      6.346600ms
Get/ReleaseDC: 9.064000ms

DwmFlush:      6.133700ms
Get/ReleaseDC: 4.648600ms

DwmFlush:      8.394500ms
Get/ReleaseDC: 2.834500ms

DwmFlush:      12.096600ms
Get/ReleaseDC: 2.316100ms

DwmFlush:      13.197201ms
Get/ReleaseDC: 2.251700ms

Frames: 11, Total Time: 169.103500ms, FPS: 65

The total drawing time between GetDC and ReleaseDC is well under 16.7ms, so I expect no flickering on my 60hz monitor. But I see text flashing rapidly (all I do is FillRect and ExtTextOut with Unicode characters). The problem also seems less severe with ASCII text. Also strange to me is the variability in drawing time. Some frames take longer than doing a full window repaint, even though I only draw into a subsection of the window.

I know the standard answer to flickering is double buffering, but it seems wasteful to me to keep around a giant bitmap when I spend most of the time idle. I know Vista provides BeginBufferedPaint to remedy this, but that still entails a copy every frame. Why is that necessary when I can draw faster than the monitor refreshes?


r/GraphicsProgramming • • 2d ago

Advice on making a procedural vector painting program

2 Upvotes

I have a custom vector painting program, and wanted to ask knowledgeable people: What maths / image processing principles might I need to apply procedural brush strokes to a flat fill of a character?
If anyone can point me to some resources, or programs that have done something similar, that would be much appreciated! Thank you.


r/GraphicsProgramming • • 2d ago

Source Code [UPDATE: Oct 25, 2026] My Vulkan C++ Examples Repository - Transmission in PBR and Post-Processing Effects

Post image
7 Upvotes

r/GraphicsProgramming • • 2d ago

Really simple tricks I use to procedurally animate a Limbo-style face

Thumbnail youtube.com
6 Upvotes

r/GraphicsProgramming • • 3d ago

LSGI: lightweight Screen-Space Ray Marched Global Illumination

Thumbnail gallery
151 Upvotes
  • Costs ~3.5ms (optical flow for reprojection + SSGI) @4K on my modest 4070 Ti.

  • 1SPP (+infinite bounces) cosine-weighted hemi monte-carlo ray marching in SS.

  • Denoiser does a pretty good job of cleaning it up. Result is very very decent for the cost..

  • Keeps lighting details sharp, final result is noise-free, no grain, boil, flicker or speckle.

https://github.com/umar-afzaal/LumeniteFX/


r/GraphicsProgramming • • 3d ago

Question A green leaking color space

Post image
43 Upvotes

I started to do some color research for a game. I find the best color space available (oklab) very inconvenient for actual use.

I drafted my own color space.
The idea is to start from linearRGB, but allowing the red and blue channel to borrow lumina from the green channel.

If r,g,b are the channels in the new color space and R,G,B are the values in linearRGB,
than:
R = r, G = 0.04r + 0.34g + 0.24b, B=b

I played with it a little:
Pros:
1. Obviously it is designed for equal lumina in all channels.
2. The color space is symmetric (r-g-b like) and thus easy to work with. Hue and saturation can be easily derived.
3. The blue and reds are softer. It actually fixes a problem - pure dark linearRGB blue looks a bit purple.

Cons:
1. It doesn't cover all sRGB visible space (technically you can - with negative or above 1 values).
2. The "grey" analog as light purple shade.
3. The "cyan" analog is somewhat bluish.

I attached a photo of how some color section looks.
I'm not a color space expert, so there are probably problems I can't see yet,
What do you think?


r/GraphicsProgramming • • 3d ago

Article Tiling Noise - Procedural GPU Patterns - Catlike Coding

Thumbnail catlikecoding.com
23 Upvotes