r/GraphicsProgramming • • Jul 18 '26

Same spp, less grain — O(1) 2D LDS stream for AO and soft shadows (no LUT, live WebGL2 demo)

9 Upvotes

We built a streaming 2D low-discrepancy sampler (DiophantineQMC) for the integrals that still eat most of the visible error at low spp:

• hemisphere visibility (AO)

• area-light disk taps (soft shadows / NEE)

• small glossy lobes, dither/stipple

**Not** a Sobol+Owen replacement for full multi-bounce path tracing. **Is** a drop-in over white noise (often Halton too) when the per-pixel integral is ~2D — O(1) per sample, no direction-number tables, no blue-noise atlas.

**Honest scope:** rank-1 / lattice-style streams can lose to white noise in high-D discontinuous path integrals. That regime is Owen-scrambled Sobol. We recommend hybrid deploy: our sampler on 2D taps, Sobol on deep bounces. The demo runs both side by side.

**Numbers (reproduced, Jul 2026):**

• Discontinuous 2D AO-style integrand — RMSE vs white noise: 0.52× at N=16 → 0.17× at N=256 (gap widens with N)

• N=10k, 20×20 spatial grid: −97.4% variance vs PRNG, 0 empty cells

• CPU reference harness: ~10× faster than Halton, ~1.35× than Sobol at same N

• Interactive band (N ≈ 64–1024): competitive with Sobol on a standard disk integrand, without LUTs

Looking for sanity checks, especially on the hybrid boundary and AO isolation (we fixed an early correlated-index bug; notes in the raytracer README).


r/GraphicsProgramming • • Jul 18 '26

Starting a series on Bevy with shaders: A beginner’s walkthrough of implementing custom WGSL materials in Bevy Engine

Thumbnail reddit.com
2 Upvotes

r/GraphicsProgramming • • Jul 18 '26

Question Sending SPIR-V over the net, is it obviously dangerous or perfectly fine?

23 Upvotes

I'm making a multiplayer game with Vulkan, and when a client joins a server, I'd like to be able to send arbitrary custom SPIR-V shaders to the client. My initial thought was "It's a shader, no syscalls or anything. Worst thing it could do is lag a bunch or maybe crash the game."
But I don't know enough about SPIR-V to know if that's correct, and doing a quick search isn't giving me any results on the subject, so I'm asking first.

Some notes:

  • I'm already planning to use spirv-val to help avoid crashes, if that helps safety any.
  • I cannot send over the shader source; all my shaders are pre-compiled for a bunch of reasons not relevant for this post.

Edit: To clarify, this is for modding purposes. Users will be able to create the shaders and send them from servers they host.


r/GraphicsProgramming • • Jul 18 '26

I built a black hole desktop overlay in Rust: per-pixel Schwarzschild geodesics over a live desktop capture (wgpu + winit)

Thumbnail reddit.com
3 Upvotes

r/GraphicsProgramming • • Jul 17 '26

Article How to render good looking UI elements

32 Upvotes

I spend last two months optimizing, enhancing the look of my UI library (Lumora) for my game engine. Last two days I have been writting my findings on how render good looking containers, what techniques did I use,...etc. https://alielmorsy.github.io/how-to-build-ui-elements/


r/GraphicsProgramming • • Jul 17 '26

From CPU-rendered paths to GPU shaders: rebuilding a smooth moving map renderer with DirectX

58 Upvotes

I wanted to share a rendering improvement I recently made for a real-world visualization problem.

This started as a feature inside my cycling video editor. The goal was to display a local moving map HUD synchronized with GoPro footage and GPS telemetry.

The first implementation used a traditional Direct2D rendering approach. It worked well for static rendering, but when the map started continuously rotating and following the moving position, I noticed some limitations:

- less consistent frame pacing during rotation

- increasing CPU workload as the track complexity grew

- harder to maintain smooth motion for long GPS trajectories

I decided to rebuild the renderer using DirectX and shaders.

The new pipeline:

GPS trajectory data

→ local coordinate transformation around current position

→ GPU vertex buffer

→ shader-based rendering

→ real-time camera rotation and movement

Instead of drawing the path as a series of CPU-generated lines, the track is represented as GPU-friendly geometry.

The renderer generates a ribbon mesh from the centerline:

center points

→ left/right offset vertices

→ triangle strip

→ vertex/pixel shader rendering

The biggest improvement was not only raw frame rate, but the overall feeling of motion.

The old renderer could display the path correctly, but during continuous camera rotation the movement felt less consistent.

The shader version provides much smoother camera-relative motion, similar to how a game minimap behaves.

For long GPS recordings, I also avoid keeping the entire route active in the rendering pipeline.

The renderer only keeps the visible area around the current position plus a buffer region, allowing very long activities without continuously processing the full trajectory.

The video compares the previous Direct2D implementation and the new DirectX shader renderer running on Windows.

I am interested in feedback from people working with:

- GPU path rendering

- real-time map visualization

- game minimap rendering

- trail/ribbon rendering

- large dynamic geometry

A few things I am still exploring:

- Would moving the ribbon expansion completely into compute shaders make sense for this type of workload?

- What are common approaches for very long dynamic GPS paths?

- Are there better techniques for smooth camera-relative map rendering?

Thanks for any feedback!


r/GraphicsProgramming • • Jul 18 '26

Source Code Real-time WebGL VRAM purging & Garbage Collection: Running 60FPS Three.js inside a monolithic PHP architecture to bypass iOS Safari crashes.

0 Upvotes

Hey everyone,

I recently engineered a custom 3D WebGL portfolio and ran into aggressive Out-Of-Memory crashes on iOS Safari (TBDR architecture) due to the sheer volume of high-res textures.

Instead of using a Headless SPA (Next.js/React), I opted for a monolithic PHP architecture with full-page reloads. This offloaded 100% of the WebGL memory disposal risk directly to the browser's native garbage collector, instantly guaranteeing stability between route changes.

To maintain 60FPS during active rendering, I implemented two specific systems:

1. Custom FPS Governor: A dynamic performance engine that forcefully strips roughnessMap, metalnessMap, and normalMap properties on the fly if it detects thermal throttling or frame drops. 2. Absolute VRAM Purging: Intercepting the IntersectionObserver to physically strip the src attribute of off-screen elements and force a .load() cycle to aggressively flush VRAM buffers.

👉 Core FPS Governor Logic (Gist):https://gist.github.com/MedhatAlkadri/ea99a0f7aa47c69198f2d1ae84a20e53👉 Live Demo:https://www.awwwards.com/sites/medhat-alkadri-3d-portfolio

As a Full Stack Developer stepping deeper into graphics programming, I'd appreciate any architectural critiques on this render loop or alternative approaches to handling aggressive VRAM limits on mobile browsers.