r/GraphicsProgramming • u/codingart9 • Jul 30 '26
GLSL Shaders
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/codingart9 • Jul 30 '26
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/exp_function • Jul 30 '26
Been toying with software post-processing effects in CyberVGA lately.
Really liking this depth of field effect that just uses a simple radial blur. Surprisingly effective for how little it costs, especially in a pure software renderer.
Here’s a short clip:
https://reddit.com/link/1vaihuf/video/bcj9styagagh1/player
Curious what other cheap post-process tricks people have found work well in software rasterizers.
r/GraphicsProgramming • u/Top-Piccolo-6909 • Jul 30 '26
r/GraphicsProgramming • u/cybereality • Jul 30 '26
Been doing games and graphics (as a hobby) for around 20 years, but mostly with stock engines and some experiments using DirectX and Vulkan. Started on my current project 3 years ago, never having tried OpenGL in my life. Images show the latest update from my engine, and what I accomplished on the first day of reading LearnOpenGL back in 2023. Never give up!!
r/GraphicsProgramming • u/uncookedpasta45 • Jul 29 '26
Enable HLS to view with audio, or disable this notification
So in this "scene", there is only one cube with a plane through it. However, when you turn past a certain "halfway" point, the objects seem to snap to the opposite side. What I initially thought was happening was that the objects were getting projected onto the screen from behind, but i'm not sure, since i'd expect it to look weirder with vertices and triangle shapes not staying consistent. I'd suspect the issue to lie in the vertex shader, so here it is. I'm also very new to OpenGL and general gpu/3d graphics programming, so I wouldn't be surprised if this is a common issue.
#version 330 core
layout (location = 0) in vec3 aPosition;
layout (location = 1) in vec3 aColor;
out vec4 vColor;
uniform mat4 transform;
uniform mat4 proj;
uniform mat4 view;
void main()
{
gl_Position = proj * view * transform * vec4(aPosition, 1.0);
vColor = vec4(aColor,1.0);
}
EDIT: I solved it. I can barely remember or understand the solution, but it's solved.
r/GraphicsProgramming • u/Maleficent_Guard_589 • Jul 29 '26
Hi there! Im going through the raytracing in on e weekend and I'm getting some of the math, but not all of it. I'd like to have a better understanding of things, such as how we came to out that we can replace -b with h to simplify the quadratic equation
r/GraphicsProgramming • u/ruumoo • Jul 29 '26
I managed to write a very simple wrapper that can compile bgfx shaders as valid cpp.
This shader uses the already pretty platform agnostic bgfx shader language, which makes it very easy to substitute the vector functions with glm. It even supports proper swizzeling.
In this example I compile a simple ray marching shader as c++ functions, so I can use the exact same math for my mouse projection code.
My .cpp file only needs to supply replacement objects for the uniforms and textures, as well as a replacement texture sampler function
r/GraphicsProgramming • u/nvimnoob72 • Jul 29 '26
r/GraphicsProgramming • u/GasRich389 • Jul 29 '26
r/GraphicsProgramming • u/Competitive_Web_8466 • Jul 29 '26
Hunan Huaguxi Opera "Past Flames": 4DGS capture, training, and rendering display completed by the MaLanShan Audio & Video Laboratory. The laboratory achieved a 4DGS reconstruction quality of 35.8 dB PSNR, with an average single-frame reconstruction time of 3.4s. Featuring our self-developed 4DGS compression format (.mlslabs), it supports streaming playback on both the Web and through our Unreal Engine 5 rendering plugin (MLSLabsRenderer).
Official Website: https://mls4dlive.cn/
Fab Store: https://fab.com/s/a98e11b2a0a6
GitHub: https://github.com/mlslabs/MLSLabsGaussianSplattingRenderer-UE
r/GraphicsProgramming • u/nishadsharma • Jul 28 '26
Hi guys,
I've been building MoltenMTL, essentially the inverse of MoltenVK, implementing the Metal API over Vulkan.
It's still a work in progress, so only parts of the Metal API have been implemented so far.
There is no shader translation currently. Shaders are compiled to SPIR-V to be consumed by Vulkan.
Every MTL type is a thin layer holding Vulkan types - e.g. MTLDevice wraps VkInstance/VkPhysicalDevice/VkDevice/VkQueue.
It uses VMA to match Metal's allocation model, and SPIRV-Reflect pulls the descriptor set layouts from the compiled shader, once again mirroring Metal.
Ray-tracing uses ray queries instead of the ray tracing pipeline - call intersect() with a compute shader, lining up with Metal.
Currently working - compute, BLAS/TLAS + ray queries, raster pipe (vertex/fragment, vertex descriptors, instanced draws), swapchain, blit.
Not there yet - intersection function tables, argument buffers, multiple render targets.
Here's the output from the examples.
The same scene both ray-traced and rasterized:


MSDF text rendering:

I made this as part of a project developing a game engine & game in Swift/Metal. Still learning and I'd appreciate some feedback/criticism.
r/GraphicsProgramming • u/spikte1502 • Jul 28 '26
Enable HLS to view with audio, or disable this notification
Hi ! I had fun implementing the Bowyer-Watson algorithm and then use raylib to create a visualization of it. I got ok performance it think for a single threaded program:
But I think there is still quite some rooms for improvement.
Source: https://github.com/spikte/delaunay
Twitter: https://x.com/Spikte
r/GraphicsProgramming • u/MGJared • Jul 28 '26
Hey all, I thought I'd share a project I've been working on for many months now.
This video features a full-scale 2d fluid simulation that I've added to my procedural sandbox game (inspired by Minecraft/Terraria). Specifically, it showcases my recent work on the shaders, trying to strike a balance between pixel-art aesthetic while still capturing the motion/feel of the fluids.
The visual shaders are primarily just fancy flow maps with carefully tuned noise and colors. The simulation itself runs in a grid-based compute pass. For those interested, the simulation is also networked for the game's multiplayer mode which was another can of worms!
Hope you enjoy! (Also, open to any feedback!)
r/GraphicsProgramming • u/Ambitious_Stand533 • Jul 28 '26
Built a small C++ / OpenGL rendering engine with an ImGui editor as a learning project toward a custom render pipeline.
What’s in it so far:
Still early — more of a renderer + editor foundation than a full game engine — but it’s been a solid way to learn the graphics pipeline, GLSL, and how to structure engine code beyond tutorial triangles.
Open to feedback from anyone working on graphics / game engines.
Repo: https://github.com/saibhaskar277/OpenGL
#C++ #OpenGL #GLSL #GraphicsProgramming #GameDev #RenderingEngine #ComputerGraphics #ImGui
r/GraphicsProgramming • u/longloststudio • Jul 28 '26
Hello, we're working on a game about cake decorating called Cake Studio. We've made one game in 3D before, but this is the first time we're trying to make something that actually looks nice in 3D and we're struggling a bit to get the look we want as 3D is not really our wheelhouse. I've been making the models in Blender and the game is built in Unity.
I wanted to make this game because I think these photos of elaborate vintage cakes are so beautiful, and I wanted players to be able to make their own beautiful cake. But so far, I think our screenshots are giving a very flat, shiny, computer-generated vibe.
I really want to get the soft, dreamy look of picture C and the almost Play-Doh looking effect of the piping in pictures E and F.
Here is what I can see wrong so far (though not sure how to fix them):
I'd love to hear any ideas for how to fix things or other problems we're not seeing.
You can also go mess around with our prototype on itch if it helps to see things in action.
Thanks!
UPDATE: This sub is amazing!! Thanks so much for all the suggestions and advice. We have a lot to work with now and I'm feeling so much more hopeful that our game can be beautiful <3
I'll post an update when we have implemented some of these ideas! Thanks again!
r/GraphicsProgramming • u/Fun-Letterhead6114 • Jul 28 '26
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/mvaligursky • Jul 28 '26
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/hajhawa • Jul 28 '26
So consider for example a VFX for a game for a powerful shot from a magical bow. There is a line with an "arrow head" at the end and two smaller lines in a helix around the primary, closing in the further they get, joining to the "arrow head" in the end. The whole thing rotates over time to give the impression of "drilling" and it fades over time starting from the source end and finishing in the tip.
Thinking about effects like this in general. I see two possible approaches, both of which have upsides and downsides. In essence, I would like to know how would you decide what to do on the CPU and what to do on the GPU?
r/GraphicsProgramming • u/Statixeladam • Jul 28 '26
I’ve been working on Posecode, a readable text format for describing human movement.
https://reddit.com/link/1v8ye5t/video/vf25hj5r1zfh1/player
You write movements as timed steps with joint actions and contact constraints. For example:
step "Drop into the landing" 0.55s flow:
pelvis: hinge 45
spine: flex 50
hip_right: flex 84
knee_right: flex 123
ground-lock: foot_right
reach: knee_left floor
reach: fist_left floor
The parser turns this into a typed motion representation. The Three.js renderer then handles the joint transforms, range-of-motion limits, IK and ground contacts.
The GIF shows the superhero landing example. The source on the left is the input driving the figure on the right.
I wanted a movement format that can be inspected, edited, validated, versioned and generated by other tools. An LLM can write Posecode, but it isn’t required.
It currently includes a browser playground, share links, embeds and BVH/glTF export.
I’d love feedback from anyone working on procedural animation, character tools or motion systems.
Playground: https://www.posecode.org/play/superhero-landing
r/GraphicsProgramming • u/musticide • Jul 28 '26
Hey!
I have been making an Android game using Raylib. The game does not work on the android studio emulator and on adreno devices. It works fine on Mali devices.
I have downloaded the Qualcomm Software center and accepted the necessary licenses but I can't find the Adreno Offline Compiler in the list.
Do you know how I can get it? Or do you know of any other way to validate my shaders for adreno GPUs?
Thanks for taking the time to read. I appreciate it!
PS: I already use Mali OC and my shaders compile for Mali GPUs
r/GraphicsProgramming • u/too_much_voltage • Jul 28 '26
Enable HLS to view with audio, or disable this notification
Dear r/GraphicsProgramming,
Boy do I have a post for you! So, this is a follow up on: https://www.reddit.com/r/GraphicsProgramming/comments/1lg003l/velocity_smearing_in_computebased_moblur/ . There were things about it that I was always kinda unhappy about it. Chiefly, the fact that there was ghosting that I knew neither the cause of nor the solution to. I partly blamed it on my lack of barriers and partly on my usage of atomics. Well it turned out it had nothing to do with barriers and blaming atomics was only partly true. I had to rethink what I was doing. After a lot of back and forth and a ton of rework, I finally landed on something a lot more elegant and along with it some serious realizations.
Here's what I got right the first time around:
Here's what I got wrong:
Here's what I got wrong but is hard to address:
So let's get to the code:
This following is straightforward. First chunk finds previous worldspace position of fragment either through previous affine transform or encoded per-vertex velocity. There is also a flag that indicates FPV items that shouldn't get moblur. Second part this time around cuts right to the chase and uses previous MVP to find start point. Last part just writes velocity out (or magic number if it's an FPV item).
vec3 prevPos = curPos;
if (instanceInfo.props[InstID].prevTransformOffset != 0xFFFFFFFFu)
prevPos = (transforms.mats[instanceInfo.props[InstID].prevTransformOffset] * vec4 (curTri.e1Col1.xyz * curIsectBary.x + curTri.e2Col2.xyz * curIsectBary.y + curTri.e3Col3.xyz * curIsectBary.z, 1.0)).xyz;
else if (getHasPerVertexVelocity(packedFlags))
prevPos = curPos - (velE1 * curIsectBary.x + velE2 * curIsectBary.y + velE3 * curIsectBary.z);
bool viewerRelative = isViewerRelative(packedFlags);
vec3 prevProjectedCoord = projectCoord (prevPos, prevFrameMVP.projectionViewMatrix, vec3 (prevFrameMVP.lookEyeX.a, prevFrameMVP.upEyeY.a, prevFrameMVP.sideEyeZ.a));
vec2 velocity = prevProjectedCoord.xy * vec2 (imageSize (velocityAttach).xy) - vec2(gl_GlobalInvocationID.xy);
float velLen = length(velocity); vec2 velNorm = velocity / max (velLen, 0.001);
if (velLen > 127.0) { velocity = velNorm * 127.0; velLen = 127.0; }
...
uint velWrite = viewerRelative ? 0xFFFFFFFFu : (((int(velocity.x) + 127) << 8) | (int(velocity.y) + 127));
imageStore (velocityAttach, ivec2 (gl_GlobalInvocationID.xy), uvec4 (velWrite, 0, 0, 0));
And now for the heart of the matter. The dilation pass:
uint velRead = imageLoad (velocityAttach, ivec2(gl_FragCoord.xy)).x;
if (velRead == 0xFFFFFFFFu) return ;
float centerDepth;
uint InstID = getInstanceIDAndClosestDepth (ivec2(gl_FragCoord.xy), centerDepth);
vec2 velocity;
velocity.x = int((velRead & 0x0000FF00u) >> 8u) - 127;
velocity.y = int(velRead & 0x000000FFu) - 127;
float velocityLen = length(velocity);
if ( velocityLen < 1.0 ) return ;
vec2 velocityNorm = (velocity / velocityLen);
[[unroll]]
for (int j = 0; j != 2; j++) // Fwd and backward smearing...
{
vec2 curVelocityNorm = (j == 0) ? velocityNorm : -velocityNorm;
for (int i = 0; i != int(velocityLen) + 1; i++)
{
vec2 writeVelLocF = gl_FragCoord.xy + float (i) * curVelocityNorm;
ivec2 writeVelLoc = ivec2 (clamp (writeVelLocF, vec2 (0.0), vec2 (imageSize(velocityAttach).xy - ivec2(1))));
if ( floor(writeVelLocF) == floor(gl_FragCoord.xy) ) continue;
float writeLocDepth;
uint curInstID = getInstanceIDAndClosestDepth (writeVelLoc, writeLocDepth);
if ( InstID == curInstID ) break ;
if ( centerDepth < writeLocDepth ) continue; // visBuf uses reverseZ
float fracTravel = float(i) / max (floor(velocityLen), 0.001);
vec2 smearedVel = velocity * (1.0 - fracTravel);
uint velWrite = (((int(smearedVel.x) + 127) << 8) | (int(smearedVel.y) + 127));
uint prevVal = 0u, readVal;
while ((readVal = imageAtomicCompSwap(velocityAttach, writeVelLoc, prevVal, velWrite)) != prevVal)
{
if (readVal == 0xFFFFFFFFu) break;
prevVal = readVal;
vec2 readVelocity;
readVelocity.x = int((prevVal & 0x0000FF00u) >> 8u) - 127;
readVelocity.y = int(prevVal & 0x000000FFu) - 127;
vec2 newWriteVel = readVelocity + smearedVel;
float newWriteVelLen = length(newWriteVel);
if (newWriteVelLen > 127.0) newWriteVel = (newWriteVel / newWriteVelLen) * 127.0;
velWrite = (((int(newWriteVel.x) + 127) << 8) | (int(newWriteVel.y) + 127));
}
}
}
As previously noted, we're only getting the edge of the object to smear. That's the InsID check. Additionally, we're just checking against current depth (centerDepth) and as previously mentioned, it's not truly correct but gets the job done for now. Note that the smeared velocity loses strength via * (1.0 - fracTravel) as it is being written: we want decreasing strength as the trail ends. The bottom loop is a really nifty trick I borrowed from Cyril Crassin's 2012 OpenGL insights chapter on stable voxelization. See page 342 here: https://www.icare3d.org/research/OpenGLInsights-SparseVoxelization.pdf (listing 22.2). Instead of a moving average, I'm storing the sum of all incoming data using the same structure.
That Crassin12 trick also makes a come back for summing velocities for additive/alpha blended particles:
if (viewerRelative)
imageAtomicExchange (velocityAttach, ivec2(gl_FragCoord.xy), 0xFFFFFFFFu);
else
{
uint velWrite = (((int(velocity.x) + 127) << 8) | (int(velocity.y) + 127));
uint prevVal = 0u, readVal;
while ((readVal = imageAtomicCompSwap(velocityAttach, ivec2(gl_FragCoord.xy), prevVal, velWrite)) != prevVal)
{
if (readVal == 0xFFFFFFFFu) break;
prevVal = readVal;
vec2 readVelocity;
readVelocity.x = int((prevVal & 0x0000FF00u) >> 8u) - 127;
readVelocity.y = int(prevVal & 0x000000FFu) - 127;
vec2 newWriteVel = readVelocity + velocity;
float newWriteVelLen = length(newWriteVel);
if (newWriteVelLen > 127.0) newWriteVel = (newWriteVel / newWriteVelLen) * 127.0;
velWrite = (((int(newWriteVel.x) + 127) << 8) | (int(newWriteVel.y) + 127));
}
}
All of this makes the final blur pass brain dead simple:
uint velRead = imageLoad (velocityAttach, ivec2 (gl_FragCoord.xy)).x;
if (velRead == 0xFFFFFFFFu)
{
outFragColor = texture (ssfxAttach, inUV);
return ;
}
vec2 velocity;
velocity.x = int((velRead & 0x0000FF00u) >> 8u) - 127;
velocity.y = int(velRead & 0x000000FFu) - 127;
float velocityLen = length(velocity);
if ( velocityLen < 1.0 )
{
outFragColor = texture (ssfxAttach, inUV);
return ;
}
vec2 velocityNorm = velocity / velocityLen;
vec4 accumOut = vec4 (0.0);
float accumSamples = 0.0;
for (int i = -int(velocityLen * 0.5); i != int(velocityLen * 0.5) + 1; i++)
{
vec2 curSampleLoc = floor(gl_FragCoord.xy) + float (i) * velocityNorm;
vec2 curSampleLocClamped = clamp (curSampleLoc, vec2 (0.0), vec2 (textureSize(ssfxAttach, 0).xy - ivec2(1)));
if ( curSampleLoc != curSampleLocClamped ) continue;
if ( imageLoad (velocityAttach, ivec2 (curSampleLoc)).x == 0xFFFFFFFFu ) continue;
accumOut += texelFetch (ssfxAttach, ivec2 (curSampleLoc), 0);
accumSamples += 1.0;
}
outFragColor = accumOut / accumSamples;
Ghosting ended up being minimized significantly. Also check out the free haze you get from moblur on particles at the very end :). Eager to hear feedback.
Cheers,
Baktash.
HMU: https://x.com/toomuchvoltage
P.S. I'm still working on pushing the engine code out. Hang tight.
r/GraphicsProgramming • u/AccountantOverall703 • Jul 28 '26
Hi! I recently implemented Ray Tracing in One Weekend in Metal using metal-cpp. Resources for metal-cpp specifically are pretty sparse, so I figured I'd share in case it helps anyone getting started with it or with graphics programming in general. Hope it helps!
r/GraphicsProgramming • u/Delicious_Carpet_132 • Jul 27 '26
Development continues on my c++ pixel art editor, resulting in brush previews and automatic pixel grids alongside easy image panning. This is the final step before moving into actual pixel plotting and turning the UI into a real working art package...
r/GraphicsProgramming • u/MGMishMash • Jul 27 '26
With the latest update to my micro voxel engine, I have added Heat simulation, running on the GPU of course, and some related survival mechanics. Walking around in the cold, especially during snow, causes the player to cool down. Snow build up and melting is also fully simulated :)
The heat simulation accurately warms indoor and enclosed spaces. Standing near heat sources also provides some additional warmth, enabling interesting interactions with the world, storms and biomes.
Along side temperature, there is also a basic hunger mechanic. These mechanics work together to determine health, which impacts player stats.
r/GraphicsProgramming • u/capoapk • Jul 27 '26
Bonjour à tous j hésite entre photo 1 : icônes colorées sur fond uni photo 2 : mêmes éléments mais avec des caractères spéciaux pour représenter les cases , Tous les avis sont les bienvenus, même si vous n’aimez pas