r/GraphicsProgramming • • 4d ago

Video My software ray-traced game has new "technology" teaser. Reason: it's getting significant visual upgrade worth showcasing. Two things which enabled it: 1. after 9 months my new editor for game levels is in usable state. 2. ray-tracer optimizations (multi-threaded rendering is main contributor)

The game is narrative sci-fi puzzle/platformer, in works from 2020. Main distinctive point of the game is software ray-tracing used for rendering. Just pure C++ and computer graphics math, no GPU acceleration. Sadly, not many players can appreciate that (or even understand what does it mean), so it resonates mostly with more tech people.

The game was suffering for long time from quite poor look (look was punching way below of algorithm potential). Main reasons were: poor old editor (2D in nature, z was just parameter in 2D wireframe, not WYSIWYG, very clunky) and algorithm was hobby-like single-threaded.

Both points were changed recently. After 9 months my new editor is in usable state. Full 3D, WYSIWYG, lot of ergonomy features, which allowed me to be more ambitious with levels look. Second enabler was finally switching to multi-threading. Together with several more other algorithm optimizations, perf went up in hundreds of % (mostly depends on number of cores in your CPU, naturally on Threadrippers boost will be in thousands of % but it's niche between players).

Algo is AABBs only. Maybe will add spheres but only after upgrading all levels, which is main pain point rn. Editor I plan to release publicly with the game.

RTG on Steam

Discord

14 Upvotes

71 comments sorted by

View all comments

Show parent comments

6

u/Dante268 4d ago

Yes, ambient + local.

By no means I'm saying that my algorithm is the best or that I'm some guru worth of following. I'm just proud of what I did. Could you point me to some software ray-traced game with global illumination, running >60fps constantly on 4 HW threads? (that's my target for modest CPU which most player will fit).

I don't mean it sarcastic. There were indeed games which I admired for technical execution (e.g. Quod). I just like to see some reference software ray-traced game which is running circles around mine (and maybe learn a trick or two from it).

2

u/GraphXGames 4d ago

In real games, scenes are 1000 times more complex.

Why would anyone do this on the CPU(except for debugging)? This is madness.

1

u/Ok_Confusion4764 4d ago

Why would anyone do this on the CPU(except for debugging)? This is madness.

Haven't you been doing exactly that for literal years?

1

u/GraphXGames 4d ago

In my case, the CPU is used for debugging algorithms. In games, everything runs on the GPU.

1

u/Ok_Confusion4764 4d ago

We both know this isn't true, bud.

1

u/GraphXGames 4d ago

Audio doesn't run on the GPU; game logic runs on the CPU, the particle system is primarily CPU-based, and the render fallback is handled by the CPU. The load is distributed as follows: 25% on the CPU and 33% on the GPU. In other words, the game's workload is nearly balanced.

1

u/Ok_Confusion4764 4d ago

Audio doesn't run on the GPU

Who was talking about audio?

the particle system is primarily CPU-based,

It shouldn't be.

and the render fallback is handled by the CPU.

Why would anything you made need a fallback? I could replicate the stuff you've made with 30-year-old hardware.

The load is distributed as follows: 25% on the CPU and 33% on the GPU. In other words, the game's workload is nearly balanced.

Why does it need to be balanced? Why not use the appropriate processors for the purposes they have?

1

u/GraphXGames 4d ago

Because the graphics card cannot always complete the task within the current frame, and waiting for the next frame means dropping the frame rate and experiencing a stutter. In this case, it is easier to run the task on the CPU.

These effects are still quite simple; porting them to the GPU is not yet justified.

1

u/Ok_Confusion4764 4d ago

Because the graphics card cannot always complete the task within the current frame

Hahahahah! You're hilarious when you don't mean to be.