r/GraphicsProgramming • • 2h ago

Video Head-to-head - literally :) my CPU renderer vs SwiftShader on 4 logical processors

Enable HLS to view with audio, or disable this notification

0 Upvotes

413,532 triangles, with no geometry simplification

960 × 840 resolution

4 logical processors, enforced through process affinity

96 measured frames per renderer, following the same camera path

8 stationary warmup frames each

Pop Data Engine is 1.78× faster in this run.

Just bragging :)

It is in early development (this is actually 3d engine development for my OS) so there is a lot to work on, but it is fast :)


r/GraphicsProgramming • • 14h ago

Source Code Liquid metal hero with Three.js — a chrome blob that reflects a studio of 6 colored lights, follows the cursor, no textures (free source + write-up)

Thumbnail
0 Upvotes

r/GraphicsProgramming • • 11h ago

Brass that bounces twice with no simulation: the vertex shader solves each floor hit

Post image
85 Upvotes

I don't simulate the brass in my Godot gun effects at all. I just evaluate a casing's position from its age in the vertex shader. That's pretty much the stateless particles from Lutz Latta's "Building a Million Particle System" (GDC 2004). What I added is the bounces.

On a flat floor I can get the hit time straight from the quadratic. The shader loops over the bounces like this:

for (int k = 0; k < MX_BOUNCES; k++) {   // 2
    float h = max(p.y - gy, 0.0);
    float t_hit = (v.y + sqrt(max(v.y * v.y + 2.0 * g * h, 0.0))) / g;
    if (t_hit <= 0.0 || tt < t_hit) break;
    p += v * t_hit;
    p.y = gy;
    v.y = -e * (v.y - g * t_hit);   // restitution
    v.x *= fr;
    v.z *= fr;                       // friction
    tt -= t_hit;
}

After the second bounce it slides with tau * (1 - exp(-t / tau)) and I tip it over onto its side. Ejecting one is a single write into two uniform arrays. Brass from three seconds ago costs what brass from this frame costs.

I also kept a GDScript copy of the formula so the game can ask where a casing is. At 10 sample times they agree within 5.4 mm, about a pixel! In the GIF the dotted line is the GDScript side and the casing is the shader. I made the casing bigger and turned restitution up to 0.5 for it, because at my default of 0.34 the second hop is about 2 px tall.

It only knows one floor height, though. A casing will go straight through a wall. Two bounces looked like enough to me, but I'm not sure a third would even read on screen?


r/GraphicsProgramming • • 2h ago

Can only go so far with a toy engine

6 Upvotes

Does anyone else feel like you hit a wall building a toy engine where eventually it’s like I can’t really evaluate how good the engine actually is without building a game with it

Like an engine in isolation doesn’t mean much, it needs real content to actually be comparable to anything

But as a programmer I can’t do that so you can only go so far with it


r/GraphicsProgramming • • 22h ago

Source Code Very primitive raycasting renderer in 10 lines of C

Thumbnail gallery
143 Upvotes

Actually the raycasting logic itself is just a single line, but it's done in propably the most inefficient way possible.

The map is just a single 64 bit integer, so I could fit a small 8x8 level in it, and I can index it with some unorthodox bitshift magic.

Also all the integer constants are huge, because I wanted do to the whole thing without floating point math, which makes everything even more unreadable, but at least it's funny ig.

I'm very proud of this one.


r/GraphicsProgramming • • 13h ago

Video A low-poly 3D Renderer

Enable HLS to view with audio, or disable this notification

3 Upvotes

r/GraphicsProgramming • • 14h ago

Real-Time Shading Symposium 2027 - Call for Submissions

Thumbnail
5 Upvotes

r/GraphicsProgramming • • 16h ago

Video Experimenting with line growth

Enable HLS to view with audio, or disable this notification

10 Upvotes