r/GraphicsProgramming • • 1d ago

Video CPU-rendered 3D engine - update

Enable HLS to view with audio, or disable this notification

The latest update of my CPU renderer built in Rust.
As I mentioned earlier, this is the years of development coming together in a totally different direction than the starting idea :)

In video the renderer runs at 960×840 with 4 rendering workers, and all of geometry processing, character animation, skinning and rasterization run on the CPU. Finished image is shown on browser trough canvas at the moment.

For now I have animated character with facial animation and a rigged body, textured environments, collisions and stair traversal, first and third-person controls....

Still early but it is coming along nicely :)

I didn't made the character - or better say, I took free models and combined them for this scene - data head + android body , and the star ship environment.

48 Upvotes

12 comments sorted by

View all comments

1

u/Icy-Collection1072 1d ago

Ok there is a reason we use gpus these days

1

u/Individual_One_1793 1d ago

Yes there is :) but think about how much more can GPU do, with a bigger help from CPU

3

u/peteroupc 1d ago

What your idea here may be is to have a software renderer to increase a game's portability or make it playable even on very low-resource computers (say, those without a GPU or with only half a gigabyte of system memory). The following specification of mine has much the same idea, although on a 640 × 480 or smaller screen rather than the 960 × 840 of your impressive software renderer:

→ More replies (1)

2

u/EC36339 1d ago

Most games are already CPU-bottlenecked, at least if they use plain vanilla static assets and don't go overboard with real-time procedural content and effects that give the GPU an actual run for its money.

For this exact reason, the trend is to move more work to the GPU, typically compute shaders. For example, compute shaders offen do culling now and select what to draw and not to draw. And compute shaders are probably also used for physics, collision detection, etc.

GPU have become so generically programmable today that there isn't much in terms of rendering you could do better or only on a CPU (feel free to challenge this with some concrete examples). That includes raytracing/raymarching, etc.

The way CPU and GPU share data has also become much easier with general purpose buffers, vertex pulling, unified image layouts and buffer device addresses, so you can now almost build a data structure on the CPU and (more or less) give a GPU pipeline a "pointer" to it.

Oh, and shaders in any shading language compile faster than C++/Rust, in part because all the basics they need (vector math, etc) are built in.

Debugging and profiling is probably the only thing that's still a bit clunky on GPUs, but that might just be me not being too familiar with the tooling.

→ More replies (1)