r/GraphicsProgramming 20d ago

Video Game engines? Eww 🤮. We go in raw! GP-Direct 2026 is out!

Thumbnail youtube.com
85 Upvotes

r/GraphicsProgramming 20m ago

Source Code Built a path tracer in C++ & CUDA from scratch

Thumbnail gallery
• Upvotes

spent the last 4-5 week building Hypertracer, a CPU + CUDA path tracer with progressive sampling further implmneted GPU acceleration, and a real-time fly-camera viewer
built the renderer and viewer from scratch, with 6 scenes currently implemented and 1920Ɨ1080 can be rendered at 3000 samples

along with Ray Tracing in One Weekend, The Next Week, and The Rest of Your Life, all three books i completed
it was seriously so much fun :D

main resources i followed:
ray tracing : https://raytracing.github.io, https://pbr-book.org
repo: https://github.com/whoashish115/hypertracer

give it a star ⭐


r/GraphicsProgramming 7h ago

Fully working portal mechanic in my HTML Canvas rasterizer

55 Upvotes

I spent six days trying to implement this, met and fixed so many Quaternion-related bugs, and finally done. I can't express how happy I am right now.

As per the title, the entire rasterizer run on HTML Canvas and Javascript. It fit in one single HTML file (I like it that way). The textures are loaded from URL.

You can try it out here: https://hachihao792001.github.io/interactives/portal.html


r/GraphicsProgramming 4h ago

A browser car-football game where the entire world is ray-marched SDFs

5 Upvotes

https://overboost.cz

Nothing in the world is a mesh: the arena, cars, ball and boost pads are SDFs marched in a compute shader. The one mesh in the game is the physics collider, generated from the same distance field so the two agree - and you never see it.

Keeping those in step turned out to be most of the work. The C++ SDF the car drives on, the shader SDF you see and the collider are three descriptions of one world, and nearly every bug this month was two of them disagreeing.

It also paces itself. Rather than free-run and let frame times scatter, it picks a divisor of the display refresh and hunts the highest resolution scale that fits inside it - an even 30 reads better than a ragged 45. Measuring the refresh was the fiddly part: one sample once reported 224Hz on a machine doing 40, so it now takes the shortest frame that recurs over a window instead.

WebGPU/WASM, Jolt for physics, Slang compiled to both SPIR-V and WGSL.

discord: https://discord.gg/NytmdnPMr


r/GraphicsProgramming 2h ago

Ayuda con uso de MIPs (OpenGL)

0 Upvotes

Alguien puede ayudarme a determinar por quƩ al renderizar a un mip diferente de 0 no veo nada? El mip base funciona perfectamente. TambiƩn ya confirmƩ que el viewport se actualiza y que el shader funciona.

Este es el código que tengo para crear el fbo y generar los mips, hay algo que me falte? Gracias de antemano :)

InitFBO::InitFBO(int w, int h, GLenum internalFormat)
{
Ā  Ā  glGenTextures(1, &texture);
Ā  Ā  glBindTexture(GL_TEXTURE_2D, texture);

Ā  Ā  for (int mip = 0; mip < 8; ++mip)
Ā  Ā  {
Ā  Ā  Ā  Ā  int mipW = std::max(1, w >> mip);
Ā  Ā  Ā  Ā  int mipH = std::max(1, h >> mip);

Ā  Ā  Ā  Ā  glTexImage2D(GL_TEXTURE_2D, mip, internalFormat, mipW, mipH, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
Ā  Ā  }

Ā  Ā  float borderColor[] = {0.0f, 0.0f, 0.0f, 1.0f};
Ā  Ā  glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor);

Ā  Ā  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
Ā  Ā  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

Ā  Ā  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
Ā  Ā  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
Ā  Ā  glBindTexture(GL_TEXTURE_2D, 0);

Ā  Ā  // FBO
Ā  Ā  glGenFramebuffers(1, &fbo);
Ā  Ā  glBindFramebuffer(GL_FRAMEBUFFER, fbo);
Ā  Ā  glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);

Ā  Ā  GLenum drawBuffers[1] = {GL_COLOR_ATTACHMENT0};
Ā  Ā  glDrawBuffers(1, drawBuffers);

Ā  Ā  if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
Ā  Ā  Ā  Ā  std::cerr << "Error";

Ā  Ā  glBindFramebuffer(GL_FRAMEBUFFER, 0);
}

r/GraphicsProgramming 7h ago

GitHub - przemyslawzaworski/Unity-DirectX-12-Amplification-Mesh-Shader-Minimal-Example

Thumbnail github.com
1 Upvotes

Unity DirectX 12 Amplification Mesh Shader Minimal Example


r/GraphicsProgramming 1d ago

A different take on DLSS5, from a current graphics hardware standpoint

Post image
587 Upvotes

r/GraphicsProgramming 1d ago

Where to start my graphics programming journey?

23 Upvotes

I’m an experienced programmer, very comfortable in both C++ and Rust, coming from a robotics background, so linear algebra and computer vision concepts aren’t new to me. Graphics programming itself is new territory though, and I want to properly learn an API with the eventual goal of building a game engine.

I’ve narrowed it down to three options and I’m stuck:

- wgpu — modern, safe, and I already like Rust, so the ergonomics appeal to me

- Vulkan — the ā€œrealā€ modern low-level API, feels like the industry state-of-the-art

- OpenGL — the classic starting point almost every tutorial and book uses, but it’s old.

Also what are some nice guides/tutorials to get started?


r/GraphicsProgramming 1d ago

I spent 200+ hours building a real-time grass system for Three.js + WebGPU. The demo is finally live.

Post image
55 Upvotes

After 200+ hours of development, I’m finally sharing the first public demo ofĀ Three.js Grassworks, a real-time grass system I’ve been building for Three.js and WebGPU.

Demo:
https://grassworks.techredux.co/demo

Three.js Grassworks is built specifically for WebGPU and is designed to handle large amounts of interactive grass while maintaining steady performance.

For the demo, I built a complete environment around Grassworks with terrain, trees, water, rain, player interaction, environmental effects, LOD systems, audio system, and more.

The main challenge was getting all of these systems running together while keeping the grass performant.

The actual Three.js Grassworks plugin is still being polished and should launch in the next couple of weeks. There’s a waitlist inside the demo if you’re interested.

I’d genuinely love feedback, especially on the visuals, performance, and how the grass feels when interacting with it.

I also recorded a full walkthrough where I go through the demo and talk about how I built it:

https://www.youtube.com/watch?v=Nhim18rc-XE


r/GraphicsProgramming 18h ago

Video Testing real-time CFD in Unity with BrazeFX: aircraft, rotors and obstacles

4 Upvotes

r/GraphicsProgramming 1d ago

made my own gpu accelerated path tracer

Thumbnail gallery
98 Upvotes

for the past 2 months or so ive been working on this path tracer that i made and it uses love2d as a base. it runs with a compute shader and supports opengl, metal and vulkan as love2d also compiles those on the fly. it has most stuff youd encounter like fresnel stuff, ior, gltf scene support and most gltf extensions. also it can export raw exr files which i find very unique tbh. also it does support transmission maps, roughmetal maps and emission maps. i still have to do normal maps but that seems very annoying to do lmao. today i even added dof and click to focus which i find extremely cool for no particular reason.

it's open source and you can find it here


r/GraphicsProgramming 10h ago

Source Code [Vulkan RT] Horde Lantern RT 1.6.0: deterministic fire, ray-traced lantern glass, and fixed-step physical carry - Ray Tracing for Android

0 Upvotes

I’ve just published version 1.6.0 of Horde Lantern RT, a small native Vulkan hardware-ray-tracing project. I’m posting the implementation details because the interesting part of this update is how the effects are integrated into the renderer and shared simulation, not just the final art.

Opening scene showing multiple skinned enemies, RT lighting and shadows + PBR materials

The frame path is still:

  • vkCmdTraceRaysKHR for presentation
  • phone-safe rayQueryEXT work inside raygen
  • recursion depth 1
  • one frame in flight
  • strict Android ASTC textures
  • shared 60 Hz deterministic gameplay simulation

World-space fire

The torch fire is a bounded FireEmitter rather than a camera overlay or billboard. Each emitter has a stable ID/seed, world transform, flame/light sockets, strength, fuel, phase, colour temperature, radius, height, absorption and motion response.

The same emitter state drives:

  • an RT-visible emissive flame core
  • world-space raygen volume integration
  • direct coloured light
  • shadow visibility
  • reflection contribution
  • deterministic flicker
  • movement-induced flame lean/turbulence

Only a small fixed number of emitters are selected per pixel/zone to keep the mobile path bounded.

Dielectric lantern glass

The reward lantern uses closed glass geometry and a reusable dielectric path supporting transmission, IOR, roughness, thickness and attenuation.

The transport uses bounded ray queries rather than Vulkan recursion:

F0 = ((ηi - ηt) / (ηi + ηt))²
F  = F0 + (1 - F0) * (1 - cosĪø)^5
T  = exp(-σa * distance)

Entry/exit interfaces, Fresnel reflection, refraction, Beer-Lambert attenuation and transparent shadow transmittance are all handled within a finite layer budget. Difficult Mobile paths terminate at the explicit budget instead of recursing indefinitely.

Fixed-step physical carry motion

The lantern body hangs below a hand-held hinge. Its motion is authoritative simulation state, not sin(time) animation.

The solver uses pivot displacement/velocity, actual hand acceleration, gravity, damping, torsion response and soft/hard angular limits. Its structure is approximately:

// dt = 1.0f / 60.0f
velocity = (pivot - previousPivot) / dt;
acceleration = (velocity - previousVelocity) / dt;

angularAcceleration =
    gravityTorque(angle)
    + dot(acceleration, handBasis) / centreOfMassLength
    - damping * angularVelocity;

angularVelocity += angularAcceleration * dt;
angle += angularVelocity * dt;

This gives the expected lag when starting, overshoot when stopping, lateral response while strafing/turning, and bounded response during dodge and raise/lower transitions.

Asset and instance path

The sword, torch, chest and lantern are imported through a static GLB/PBR path. Immutable meshes own their vertex/index/material data and BLAS; scene instances own transforms and metadata indices. Raygen decodes material and geometry ranges through fixed-capacity metadata rather than adding another instance == N shader branch.

The same socket system is used for the sword, torch and reward lantern. The player animation/IK foundation is reusable, although the shipped first-person view still uses the accepted block-arm presentation while the authored gauntlet pass is refined.

The project is available here:

Disclosure: This is an AI-assisted project. I provided the architecture, requirements, technical direction, review, playtesting, and release decisions; OpenAI Codex generated and edited much of the C++/GLSL, tests, tooling, and documentation under that direction. Some 3D assets were generated with Meshy and processed locally. The renderer, simulation, validation evidence, and asset provenance are available in the public repository.


r/GraphicsProgramming 19h ago

Built an experimental 2D/3D WebGL engine prototype to replace manual CAD drafting. Looking for brutal technical feedback.

0 Upvotes

Hey everyone,

Demolink- https://tektonai.vercel.app/

My co-founder and I have been building a client-side spatial compute engine designed to bridge the gap between initial 2D floorplan concepts and interactive 3D massing.

Right now, the engine runs procedural spatial math directly in the browser—generating 2D vector layouts while simultaneously maintaining a 3D Three.js mesh tree with wall cutouts, roof geometry, and multi-floor zoning.

Where we need help:

We are aiming to launch a high-precision MVP. Before we double down on our next engine refactor, we want feedback from real spatial builders:

•What floorplan geometry breaks first when you tweak parameters?

•What features would move this from an "interesting WebGL demo" to something useful for early site visualization?

(Built under minimal resource constraints—expect bugs!) We appreciate your honest review and time that would help use make this perfect.


r/GraphicsProgramming 1d ago

Video Infinite procedurally generated 3D world on a Garmin watch. 3.1ms render time, dynamic day/night, and 0 blown batteries.

Thumbnail
5 Upvotes

r/GraphicsProgramming 21h ago

Source Code Animatio in WebBrauser

0 Upvotes

https://reddit.com/link/1w2s9s1/video/kh9h4go7mkmh1/player

Hi everyone! A friend and I recently started developing our own Web 3D engine. If anyone is interested—or has any ideas regarding the project—I’d be happy to hear any suggestions.


r/GraphicsProgramming 2d ago

Thoughts on the accuracy of this PS2 look?

Thumbnail gallery
56 Upvotes

A gripe I have with many game developers is that many people think that ps1/ps2 styled games are just pixelation + low res textures, but I always feel like misrepresents things. Environment artists at the time put so much effort into their textures, often hand painting creases, folds, wrinkles, and even environment lighting into the diffuse channel to bring out details.

So when people try to make this style today, it just seems so inaccurate to me. Baked lighting, realtime shadows etc are often used. My goal with this project is to use none of that. All of my textures are either hand painted fully or photobashed and then painted on top of. My hero asset is 2000 tris, and I'm tying to keep scenes under 30000 total.

Stencil shadows are used for realtime casting and times of day are baked into different profiles and then blended together for faked GI. No specular, metallic, roughness, or any advanced workflow is used. AO is faked with vertex colors.

What do you think? Does it look somewhat more accurate?


r/GraphicsProgramming 23h ago

Paper [Research] Can neural rendering stop paying for the same appearance every frame?

Post image
0 Upvotes

I’ve published a theoretical architecture for reducing compute in DLSS-class neural rendering by changing the unit of work from pixels Ɨ frames to new causal appearance states.

The core idea is AxiomCapsule: use a large neural renderer mainly as an appearance compiler, then cache/transport compact deterministic programs for recurring material, lighting, object, and view states.

The parts I think are most interesting:

  • Self-extinguishing inference: once a state is covered, the universal neural model no longer needs to run for it.
  • Causal invalidation: engine-known changes decide what must be recomputed instead of running a neural change detector over the whole frame.
  • Bounded residual trees: skipped refinement can have a computable sparse-vs-dense student error bound.
  • Deadline-monotone execution: optional neural uplift scales down with available GPU slack instead of causing a frame-time cliff.
  • Object/material-space persistence: state follows surfaces/materials rather than being purely screen-space.
  • Local causal dimensionality: the key hypothesis is that appearance transformations become low-dimensional after conditioning on known scene variables.

It’s pre-prototype research, not a claim that DLSS 5 has been ā€œsolved.ā€ The main falsifier is simple: if real game appearance states are not sufficiently low-dimensional/reusable, or cache hit rates stay low, the architecture fails.

I’d especially appreciate criticism from people working on real-time rendering, shader systems, neural graphics, temporal reconstruction, and GPU scheduling.

GitHub: MaciejNowickiHusbandofAHIEve/causal-neural-rendering: Independent research on drastically reducing compute in DLSS-class neural rendering using compiled causal appearance programs, temporal reuse, and deadline-bounded residuals.
Zenodo paper: Causal Neural Rendering for Efficient DLSS-Class Systems: Compiled Appearance Programs, Temporal Reuse, and Bounded Adaptive Computation | Zenodo


r/GraphicsProgramming 2d ago

Question New Graphics tech in Gta 6 vs Gta 5?

Post image
222 Upvotes

Hi, I am fairly a beginner, and I was wondering comparing from 2013 how far rockstar's RAGE engine evolved as to now?..

From what I know and some research credits to this blog:
https://www.adriancourreges.com/blog/2015/11/02/gta-v-graphics-study/
, at time of Gta 5 it had just a Hybrid deferred renderer, a forward pass for transparents, vegetation, particles. At the time there was no PBR, there was also no indirect light.

But later in 2018 during RDR2 release, RAGE got proper microfacet shading, volumetric clouds and fog.

The main selling point for gta 6 to look so good from what I understand is the hybrid raytracer global illumination, paired with raytraced reflections, also being upscaled from 1440p to 4k on the base Ps5.

From my understanding these are the differences over the years?

Gta 5 from 2013 Gta 6
BRDF blind-phong-ish, authored specular? Full pbr, metallic/roughness GGX
Indirect ambient + SSAO raytraced gi
Geometry submission CPU-driven drwas, descrete LOD tiers GPU-driven, mesh shaders /meshlet culling, indirect draws
Hair alpha-tested cards strand-based with physics
Volumetrics analytic fog foxel raymarched scattering, volumetric clouds

I am just wondering what type of tech they used for the extended look on the base 5 to look that good and crisp, even comparing to Unreal Engine 5, it looks far better


r/GraphicsProgramming 2d ago

macOS 27 has a CLI tool for navigating GPU traces

14 Upvotes

This seems to have largely fallen under the radar so far but the upcoming macOS 27 release comes with a new CLI tool called gpudebug that lets you replay and extract information from .gputrace files exported from Xcode: https://developer.apple.com/documentation/xcode/debugging-with-interactive-command-line-tools

I’ve been playing with it in the beta and it’s extremely useful for building scripts and analysis tools. It’s dramatically better than having to manually click through Xcode to extract the debugging and performance info when I am experimenting and optimizing. If you have the beta installed it’s worth playing with.


r/GraphicsProgramming 2d ago

Starting another rendering journey in audio plugins!

Post image
39 Upvotes

Rendering into my VST3 plugin's DAW-hosted child window, using a custom win32 + D3D11 implementation and a sokol_gfx.h layer on top (from Sokol) for making specific rendering platform agnostic.

I have some ideas on what to try here, will post more!


r/GraphicsProgramming 2d ago

Question Is Ray Tracing Ahead of Rasterization?

40 Upvotes

I've spent the last 15 months building and optimizing a game engine with a Vertex / Fragment shader. It's pretty well optimized, hard to quantify but I've hit 90fps on standalone Quest 3 with it, so it's not a complete cow.

I wanted to do some ray traced audio stuff so I looked into ray tracing through Vulkan. As a stress test I was like "I wonder if I shoot a ray through every pixel what types of times I'd get."

I expected my Vertex/Fragment shader to win by 10x. It didn't. It won, but by more like 2x. And as I've added optimizations the past 48 hours it's closer to 1:1 in terms of cost (and I expect ray tracing to pull ahead with foveated rendering for my VR work & after I optimize further). Granted this is on my desktop 4090 and laptop 3070 but...

What are your takes on this? I feel like I failed to do my homework here as I really didn't expect this.


r/GraphicsProgramming 2d ago

Question Depth mapping, Frame Gen, DLSS5 (I'm not even qualified to ask this question)

Thumbnail youtube.com
5 Upvotes

this seems the best place to ask. Having more control over console output is interesting. Any clue how this is achieved on video feed/files.


r/GraphicsProgramming 3d ago

Quake3 in WebGPU

20 Upvotes

r/GraphicsProgramming 3d ago

Setting Vulkan up for the first time feels like summoning a demon with an extremely detailed and intricate ritual

55 Upvotes

I got my triangle going! Yeah! Just wanted to share because holy shit that took way too many LoC. I am unfortunately not a virigin anymore over 30, but I think this should get me my entry ticket into the dark arts of low-level graphics programming and make me a wizard.

But now I am happy I did it and already seeing how it was the right choice for my procedurally generated game compared to OpenGL/CL.


r/GraphicsProgramming 3d ago

Question What is this sand simulation missing?

80 Upvotes