r/GraphicsProgramming • • 23h 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 • • 18h ago

Source Code Added DLSS 5 NR to my pet-project

0 Upvotes

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


r/GraphicsProgramming • • 15h ago

Source Code 67 - shadertoy

177 Upvotes

r/GraphicsProgramming • • 3h ago

Article Volumetric Rendering: The "How-to" - Blog post Out now!

11 Upvotes

In our previous What The Graphics! blog, we explored Volume Rendering and why it matters.

Now, we're going deeper into how it works. From raw voxel data to 3D textures, we explore 3D Texture Slicing and how a stack of textured polygons can bring an entire volume to life.

Read it here 🔗 - https://www.3denginerd.com/blog/volumetric-rendering-how-to

Written by us over at 3D ENGINERD.

 


r/GraphicsProgramming • • 23h 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?