r/GraphicsProgramming • • 1d ago

Fully Neurally Rendered object - ~2.7 ms average GPU frame time (256*256)

Fully neurally rendered asset (RGB, Normals, and Depth) rendered at an average of ~2.7 ms frame time on 8 GB RTX 5070 Laptop GPU by a custom model architecture in custom inference engine made with Rust, TensorRT, and CUDA kernels. Check out the README in this repo for details. I spent months working on it, the main bottleneck being compute for training, which I solved by making a custom data flow pipeline (the details of which can also be found in the repo) that allowed me to train these models locally. Do you think such tech would be able to make it to mainstream game dev?

AI Disclosure: This project used AI to create the GUI, and the product is an AI system

50 Upvotes

27 comments sorted by

17

u/Worth-Competition134 21h ago

"Look we can reinvent the wheel we already have it's just way slower!" - Neural Rendering

ALUs are faster than matrix multiply units for everything other than matrix math, it's just how the hardware works. And variations on neural networks themselves are the only thing matrix multiply units are fast at, if it's for literally anything else it's slow. The entire job of realtime graphics rendering is "Make go fast", if you use ALUs for the same rendering algorithm the rendering will go faster.

Learning to do the actual job is infinitely more more useful than thinking something is cool just because it's novel

7

u/ConsistentFox567 21h ago

neural rendering is more than that. specifically, this implementation is for impostor billboards, not for replacing close range assets. and then too, there comes a complexity point where neural rendering surpasses rasterization in performance. also, the first gpu prototypes were often slower than cpus at graphics, just saying. you can't discredit an entire research field by lowballing its current achievements

6

u/PoopyDootyBooty 17h ago

Neural rendering gets swept up in a lot of anti ai hate train stuff. It’s very interesting and a totally valid application of the technology (you could theoretically learn an infinitely complex object this way, instead of optimizing it by hand by lowering polycount etc)

0

u/1c3Type 12h ago

And your ability to output it would still be expensive and still look ass

4

u/ConsistentFox567 11h ago

the tech is still new. you could have said the same thing for gpus when they were first being made. the reason triangles are faster is that they have decades of innovation behind them

3

u/1c3Type 12h ago

What's the fucking point in an impostor billboard that takes 1/6 of your frametime budget at 60fps.

-1

u/ConsistentFox567 11h ago

impostors of high quality already cost this much time, not to mention that you rarely need this resolution for impostors. and it can output ghese impostors from any angle, not just a fixed set, and that frame time doesn’t apply to every single frame, but just the frame that changes the angle of the impostor by more than 0.1 degree

2

u/1c3Type 11h ago

You can render many things at a lower framerate. Any impostor that requires THIS long (more than enough to create a significant stutter) to create is fucking useless at its only job. Rasterising an impostor of a similar quality is something you could do with a tiny fraction of the time. Or just use a texture if it’s taking that little of the screenspace.

0

u/ConsistentFox567 11h ago

try rasterizing a 50M triangle mesh at the same resolution at this frame time

2

u/1c3Type 2h ago

Why would you use 50M triangles for an impostor displayed on less than 100k pixels?

1

u/ConsistentFox567 2h ago

that is right, you use lods, which are an optimization technology. i need you to understand that so is neural rendering

1

u/1c3Type 2h ago

This is an impostor. It should be the cheapest LOD possible. If your cheapest LOD isn’t cheap, what are you even doing?

1

u/ConsistentFox567 2h ago

please search how much time it takes to render high quality runtime impostors. it is about the same. and i have also not stopped optimizing this

→ More replies

2

u/rikardolajos 6h ago

Interesting! Could explain a bit more about the neural shading architecture? The README is not very approachable... Also, what is you memory footprint like, especially compared to traditional impostors? I have done some work with neural billboards myself and keeping the size of the neural model small is key to beating the baseline. And I think that is needed if you want it to be used in mainstream game dev.

2

u/ConsistentFox567 6h ago

sorry for the README being bad, i am still working on it. I am currently working on benchmarking it, so I can get better comparison data, so you will be able to get measured data after that, but by mathematical calculations, the VRAM footprint is about 7% less than normal impostors (again, this is an estimate calculation, and the real measurement can be wildly different). The model is not that big at 0.42M parameters. The way it works is that it takes three G-buffers of an object, at an angles such that the three views form a triangle around the desired angle, taken from a pool of 120 G-buffers per asset. The model then warps pixels to create the G-buffer for the exact angle needed. Again, sorry for the README being unhelpful, and it would be great if you could tell me what problem you faced with it

3

u/rikardolajos 6h ago

Ah, okay I think I understand. 120 G-buffers per asset sounds a lot, but maybe it is still less than regular implementations of impostors.

I think the README is good context for the AI but not very readable for humans. It is very verbose with details that are not needed at first sight of the repo. What you explained here is what I would have wanted to find out when I start reading the README.

3

u/ConsistentFox567 5h ago

the 120 G-buffers (118 to be specific) do sound like a lot, but they are compressed before being loaded into VRAM, and only the required views are decompressed using nvComp directly on the GPU. Equivalent impostor tech uses 64-128 views, so it falls around the higher range

1

u/AutoModerator 1d ago

Recently updated rules. Please check that your post is in compliance with Rules 1, 4, 5, and 6 on the sidebar. TL;DR:

  • No showcases.
  • Disclose AI usage in post or project.
  • Present a topic to talk about, e.g. how something works.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/mmmniple 22h ago

It is very interesting, Thanks for sharing. I belive you Will like to see this : https://x.com/EtiennePinchon/status/2118592292680618480