3 ms·
It's not just that ray tracing looks better than rasterization for the same scenario, but that some scenarios are simply impossible / impractically complicated
by bryal 6y ago
It's not just that ray tracing looks better than rasterization for the same scenario, but that some scenarios are simply impossible / impractically complicated to render with only rasterized graphics. Just one example is specular reflections with non-screen space content and a dynamic environment.
Rasterized graphics can do specular reflections quite well as long as the reflection only shows things that are currently in view. One can then perform a limited form of ray tracing in the depth buffer to detect which part of the screen is visible where in the reflection. However, as soon as we want to reflect things outside of the screen it gets tricky, as we can't simply perform this screen space ray tracing. Instead, we have to rely on pre-baked reflection map textures. This works well enough for static objects, like the environment, but you can't see dynamic content, like players, as they can't be pre-baked into the texture. Also, it's useless when there are no static objects, like in Minecraft where there's no such thing as a static environment -- every block can change dynamically. And this is where the limit of specular reflections of rasterization is basically hit. There are of course workarounds, like rendering the scene a second time from the mirrors perspective, and then combining the view render and the mirror render, but you can imagine it gets prohibitively expensive quite fast as you add a few more reflective objects to the scene. Also, this method doesn't work for glossy reflections -- that's even more complex.
So this is just one example of how rasterized graphics limits us -- we can't have more than a few reflective objects in a scene which features dynamic geometry, which is a very sensible thing to want to have!
In my opinion, ray tracing really is that much better than the approximations we've developed. Also consider how much faster / cheaper it would be for a studio to create new graphics engines when you only have to write 1000 lines of ray tracing code instead of 100'000 lines of rasterization hacks (for a worse-looking result!).
- pixel_fcker 6y agoHate to tell you this but ray tracing gets just as complicated. You’re just shifting the realism bar much higher, but certain effects are always just out of reach in a given time budget and require specialised solutions and hacks to achieve.
- bryal 6y agoIn a given time budget, maybe, but that wasn't much a part of the question I answered. The question asker compared ray tracing to brute forcing finding primes vs. using a sieve -- and that's just not how it is. Also, I'm not sure about "just as complicated". Is rendering refraction with dispersion "just as complicated" to achieve in a given time budget with ray tracing as with rasterization? I must admit I'm not well versed in modern rasterization hacks, but as far as I know that is simply impossible to achieve, regardless of how much time you have.
- pixel_fcker 6y ago> Also consider how much faster / cheaper it would be for a studio to create new graphics engines when you only have to write 1000 lines of ray tracing code instead of 100'000 lines of rasterization hacks (for a worse-looking result!). You were talking about games here, no? That's ultimate hard time constraint. 1000 loc gets you a very basic path tracer which isn't really going to be good for very much. Your dispersion example is interesting - you can't really do it correctly with rasterization, no, although you can do a distorted background texture lookup with individually offset/blurred RGB channels. If you want to do rough glass you can just increase the blur amount. Not correct but looks 'good enough' in a lot of cases. With ray tracing you can just trace 3 rays (one for one for each of red, green and blue). Simple! Except can you really afford 3 rays? Also how much do offset them by? You could use Cauchy's formula and use real refraction indices, but then you're going to get ugly separation between the channels. You could sample the whole visible spectrum and use temporal accumulation to build up the correct color, but now you've got color noise. What happens if you want to simulate rough glass? That's going to be very noisy indeed. What about shadows from the glass? You can't afford to render caustics to do it correctly after all. Do you just ignore them? That'll look weird. Use a fresnel-weighted transparent shadow? Probably but now you have to handle that correctly everywhere and running a shader for shadow rays is expensive too so maybe you have to special-case that situation so most of your scene lands on the happy path. My point is that anyone can write a basic path tracer in a weekend that will correctly simulate light transport given an infinite amount of time. Writing a renderer that will produce an image of a given quality in a given amount of time, incorporating a list of effects that an art director has decided are essential to the look of you product, is a very hard task still. It's simpler in a lot of ways, but also has to handle a lot of other complexities for the things that aren't possible in a rasterizer but are still very expensive to compute in a ray tracer.