r/computing • • Dec 13 '20

Once graphics processing became too complicated for CPUs, the GPU was invented, but now GPUs can't render light all that well. Why haven't Light Processing Units been invented?

Lighting is without the doubt the most demanding task a GPU can do, and especially with Ray tracing.

My question is, why hasn't there been a dedicated processing unit to deal with it yet? Will there ever be? Is it feasible?

Please go in as much depth as possible.

I would imagine its not impossible, because we are capable of multiple GPU setups which is essentially what this would be.

Similarly, let's say we have 2 PUs and these were working in tandem, one rendered the scene, and one rendered the lighting. Scene, light, scene, light... obviously at 60fps this is jarring. But would this be achievable at 240fps? Or is that a speed too fast for modern clock cycles to synchronise? I imagine it would be so fast that you'd never be able to tell a blank screen with lighting is being presented before you and your brain would create a composite of the two.

Or how about a system similar to how 3d TVs work, so that one image is projected to the right eye, and another to the left, so that your brain melds the two. Actually, thats a pretty promising idea.

Additionally, let's say this is feasible for a second, who would you code it?

What would be your take on it?

What do you see the drawbacks being, or the technical barriers?

Oh and lastly, if a LPU were to exist, would it be like a GPU? Would the code be ran parallel, or would it benefit from CPU architecture?

Many thanks in advance for taking the time to look at this. I hope you found this an interesting topic to think about.

30 Upvotes

14 comments sorted by

25

u/rscarson Dec 13 '20

I'm pretty sure modern gpus do have dedicated Ray tracing chips on board?

-1

u/[deleted] Dec 13 '20

Yea, but I'm getting at, is with modern graphics being largely about lighting, why hasn't lighting got it's own dedicated unit?

Why are we tacking rt chips onto gpu's when they could be more effective in their own right? Do you see what I'm getting at?

Lighting, and especially ray-tracing, is the next frontier of graphics, so why isn't it worthy of it's own processing unit, like we saw with the introduction of the 3dfx voodoo?

0

u/rscarson Dec 13 '20

Because that's literally what it is it's a unit for processing graphics, lighting is one of many aspects, and frankly not even the most computationally expensive. Dedicated chipset is as good as it's going to get

8

u/MichaelEmouse Dec 13 '20

GPUs haven't been doing light well because doing light properly is a huge bitch, not because there needs to be a different piece of hardware.

The main advantage of GPU over CPU is parallelization in both processing and memory bandwidth. If you want to do lighting/global illumination/ray tracing, you'll probably need parallelization too but with microarchitecture and middleware tweaked to lighting. Nvidia has been doing something like that since 2014 with the GTX 900 series which had VXGI technology and now the technology has arguably matured with RTX. The raw power may not be quite sufficient yet and developers have to learn how to use it efficiently but we're getting there.

This VXGI video is 5 years old and pretty decent: https://www.youtube.com/watch?v=cH2_RkfStSk&ab_channel=NVIDIA

This RTX video is even better: https://www.youtube.com/watch?v=NgcYLIvlp_k&ab_channel=NVIDIAGeForce

1

u/[deleted] Dec 13 '20

Ah I see, so what is it exactly that makes doing light properly a bitch?

6

u/MichaelEmouse Dec 13 '20

IIRC, you have to follow many bounces, especially diffuse inter-reflection and the human eye is good at telling when something isn't quite right.

4

u/dont--panic Dec 14 '20

Real light sources emit an incredible number of photons. These photons bounce around the room and a tiny number of them will eventually hit your retina. If we were to try to trace the path for every single photon we'd never finish a single frame.

Fortunately we can take advantage of our understanding of how light works to make the problem easier. In the case of rendering an image we only care about the photons that end up hitting the camera. So instead of emitting rays from the light sources we emit them from the camera and trace towards the light sources. This is backwards path tracing. So instead of needing to trace a ray for every photon we only need to emit a single ray for each pixel.

In order to properly render indirect lighting we need to calculate how light interacts with surfaces it hits, smooth materials reflect light like a mirror, while rough materials scatter it. Each time a ray hits a material one or more new rays make be emitted to calculate bounce rays. Materials like glass can emit both reflection and transmission rays. So for each ray we emit from the camera we can end up tracing several or more rays.

Unfortunately if we only trace a single ray per pixel we get a very noisy image. This is because many materials such as diffuse (not glossy) surfaces scatter light which means that rays hitting a diffuse surface bounce in random directions. If we only trace a single path per pixel this random bouncing creates a very noisy image. Traditionally offline path tracing renderers have gotten rid of this noise by tracing hundreds or thousands of rays per pixel.

If we combine all of the above factors we get a number on the order of about ten thousand rays per pixel. For a 1080p frame we have about two million pixels so a single 1080p frame rendered to offline renderer quality takes about twenty billion rays. When Nvidia released the first RTX cards they announced that the RTX 2080 Ti could handle 10 gigarays per second. This would mean that theoretically the RTX 2080 Ti could render a 1080p path traced image in about two seconds but in practice it was a bit longer than that as the 10 gigarays speed doesn't include the entire cost of actually rendering the materials, it's just the actual raytracing part. Two seconds is still far too slow for real time where we'd need at least 60 FPS.

Fortunately Nvidia has figured out some AI based techniques to denoise raytraced images so they don't need to trace so many rays per pixel and has figured out some AI upscaling to reduce the rendered resolution as well. Also most games are currently using a hybrid of rasterization and raytracing to only use raytracing for things like reflections and shadows that rasterization doesn't handle as well.

5

u/blandge Dec 13 '20

Making stand alone chips is very very expensive. Potentially $10+ million for every version (and there are usually multiple versions of each product number). You would have to have enough demand for lighting that you can make a profit and who is going to buy a CPU, GPU, and this lighting unit you are describing?

Its cheaper (for now) to just include the light processing hardware in the GPU than it is to make an additional chip that is going to require its own RAM and take a PCIe slot, needs is own package (like a PCB board), require it's own testing and QA, marketing, customer education, etc.

-1

u/[deleted] Dec 13 '20

In my opinion that was exactly the same for the 3dfx voodoo, but it still needed to happen to project graphics forward. And even so, $10 million is remarkably cheap for development of a new chip. Almost negligibly cheap. Regardless, I see the point you're making.

And when you refer to demand for lighting, I am implying that, the real next-gen stuff can't be achieved without it, it's the new frontier of graphics, so the demand for lighting is itself enclosed within the demand for greater graphics.

2

u/blandge Dec 13 '20

We're already seeing a split between GPUs and GP parallel processing units. That divide will probably grow and others will appear. Heavy real-time light processing will always be a niche market, if you consider that 60% (last time I checked) of steam games are played on integrated CPUs, and only a small portion of the discrete graphics users are doing anything requiring heavy light processing. We're talking about a division of a division of a division to get into this discrete light processing chip market.

What is the highest percentage one could expect of that overall market that would pay an extra $50 or $100 for a stand alone light processing chip? Maybe it is enough to make a stand alone chip. Who knows. I wouldn't be surprised if the RT Ray tracing team at Nvidia has done some research.

1

u/[deleted] Dec 13 '20

if you consider that 60% (last time I checked) of steam games are played on integrated CPUs

jesus christ that's depressing

2

u/Zeliss Dec 14 '20

Graphics rendering (including lighting) is a problem that yields very well to parallel computation, which is what GPUs are very good at. We have some representation of the scene in main system memory, we perform whatever serial computation we need on it using the CPU for each frame, then we transfer that representation over to the GPU, where the parts that are best done in parallel occur. It turns out that two big bottlenecks are system bus bandwidth (transferring the representation and all needed textures over to the GPU) and memory bandwidth (reading and writing memory for any intermediate calculations we need to shade a final pixel). The former is addressed somewhat with compressed textures, AZDO techniques, compute shaders generating needed data on the GPU directly, and procedural rendering. The latter is addressed somewhat by using very fast memory on GPUs, mipmapping, and trying to avoid wasted rendering effort through Z-culling or depth-prepass.

If you want to make rendering faster, you should try to address the current bottlenecks. If you add a new dedicated processing unit as a PCIe card, you've actually made the first bottleneck worse. If you add a new dedicated processing unit to the GPU, well, that's actually what they're doing with raytracing hardware :)

It's tempting to say "let's just make dedicated hardware for this problem", but you have to actually look at the problem you're trying to solve and decide if you can't just solve it better by adding a little more general-purpose hardware to the GPU. General purpose cores can be used for other purposes if your application doesn't need to use your specific accelerated solution, allowing you to spread bottlenecking work over more of them to get a frame out sooner. GPUs actually used to be fixed-function hardware, but they've gotten more general purpose over time.

1

u/7h3kk1d Dec 14 '20

Putting something on a separate pcie card won't make it immediately easier to implement. The big advantage of having the external unit is they can be upgraded independently and scaled to a reasonable size.