• Advertisement
Sign in to follow this  

Benefits of Physically Based Rendering

This topic is 2155 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, guys. I'd like to ask your opinions on the somewhat recent trend of replacing the old lighting models (Blinn-Phong) by more physically accurate ones (Oren-Nayar, Cook-Torrance, Ward, etc.).It seems like nowadays lots of people are switching to these models and other physically based techniques to obtain energy conservation and more intuitive artistic parameters but do these models really provide a significant boost in visual realism?
I'm asking this because I've tried a combination of Oren-Nayar for diffuse and Cook-Torrance for specular and I did not notice any increase in realism, the resulting lighting is slightly different but not necessarily better nor worse, just different. I've even done some comparison renderings in 3dsMax and they also don't show any increase in realism, once again they just look different. What's your take on this subject?

One more thing, how could Oren-Nayar be used with ambient lighting stored in Spherical Harmonics? The SH coefficients to approximate a cosine convolution are well known and widely used, but now we need coefficients that approximate the Oren-Nayar diffuse convolution, does anyone know if these coefficients have already been derived?

Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
I've tried a combination of Oren-Nayar for diffuse and Cook-Torrance for specular and I did not notice any increase in realism, the resulting lighting is slightly different but not necessarily better nor worse, just different.
If you're simply swapping the lighting model over without tuning the data for it, I wouldn't expect it to look much better. i.e. if your data was made to look good with blinn-phong, it might not necessarily look good with oren-nayar/cook-torrance.
When I switched over, we pretty much had to re-paint all of our specular maps/values to really get the benefits.

One nice thing about physically based methods is that if you plug in real-world values, you can expect to get real-world results. As an example, our tech-artist was showing me the new Blender GPU ray-tracer recently and it's material editor; we chucked in three specular terms with the beckmann distrubtion and the IOR of copper at red, green and blue light wavelengths. The result was a believably shiny surface with the pink/orange colour of copper. I can convert those IOR values into a spec-mask and give it to the artists as an exact reference colour for pure copper.
Conversely, you can take your spec-mask values and convert them back to IOR values to see what kind of real-world material you've painted.

Share this post


Link to post
Share on other sites

Hey, guys. I'd like to ask your opinions on the somewhat recent trend of replacing the old lighting models (Blinn-Phong) by more physically accurate ones (Oren-Nayar, Cook-Torrance, Ward, etc.).It seems like nowadays lots of people are switching to these models and other physically based techniques to obtain energy conservation and more intuitive artistic parameters but do these models really provide a significant boost in visual realism?
I'm asking this because I've tried a combination of Oren-Nayar for diffuse and Cook-Torrance for specular and I did not notice any increase in realism, the resulting lighting is slightly different but not necessarily better nor worse, just different. I've even done some comparison renderings in 3dsMax and they also don't show any increase in realism, once again they just look different. What's your take on this subject?

One more thing, how could Oren-Nayar be used with ambient lighting stored in Spherical Harmonics? The SH coefficients to approximate a cosine convolution are well known and widely used, but now we need coefficients that approximate the Oren-Nayar diffuse convolution, does anyone know if these coefficients have already been derived?

Thanks in advance


Oren-Nayar's also a lighting model for very rough surfaces, whereas Cook-Torrance (assuming a Beckmann distribution, not all C-T's are considered equal ;)) and its ilk are more often than not formulated for highly reflective surfaces, so you kind of have a shading dichotomy going on. An analogy that might hold some weight would be using an isotropic specular model for hair-- sure, it uses 'real' formulae to determine lighting, but it doesn't really describe the surface you're using it for very adequately.

RE: Oren-Nayar SH coefficients-- just project the BRDF yourself. Fix the view term and roughness components and there you go. You can create a 2D lookup texture much like Bungie did for their analytic area specular model and can probably index it the same way they do.

Share this post


Link to post
Share on other sites

If you're simply swapping the lighting model over without tuning the data for it, I wouldn't expect it to look much better. i.e. if your data was made to look good with blinn-phong, it might not necessarily look good with oren-nayar/cook-torrance.
When I switched over, we pretty much had to re-paint all of our specular maps/values to really get the benefits.


It was not a simple switch between lighting models. For instance, I adjusted the roughness of the Oren-Nayar to try to approximate rough surfaces like concrete ones. I tried this with both my engine and with 3dsMax, both yielded unimpressive results.


One nice thing about physically based methods is that if you plug in real-world values, you can expect to get real-world results. As an example, our tech-artist was showing me the new Blender GPU ray-tracer recently and it's material editor; we chucked in three specular terms with the beckmann distrubtion and the IOR of copper at red, green and blue light wavelengths. The result was a believably shiny surface with the pink/orange colour of copper. I can convert those IOR values into a spec-mask and give it to the artists as an exact reference colour for pure copper.


Well, from what I've seen, these physically based models look much better in offline rendering then in real-time.This is probably because a realistic BRDF is more useful to a path tracer since it can provide realistic diffuse lighting and neat indirect lighting effects like glossy reflections, while in real-time rendering the model can only e used to generate the direct diffuse lighting and a specular highlight.

Share this post


Link to post
Share on other sites
For Cook-Torrance I would imagine you'd not only need specifically tuned spec masks but you'd also need something to give an all around specular term rather than just a single light and a diffuse ambient; otherwise the results aren't going to be terribly noticeable. and while both Oren-Nyar and Cook Torrance are definitive improvements under the right conditions, neither are totally dramatic.

For a real world example of what I mean just go and look at Halo 3 and Reach. Bungie spent a lot of ram and milliseconds on getting a cook-torrance evaluation to work in realtime on the 360. And while metal and such does look neat in these games, other, more obvious and widely used features would almost certainly have contributed more to each games look.

In other words there are a lot other things that you'd want to spend your resources on before you get to advanced BDRF models. But with the next generation coming up next year developers are looking for stuff to throw all those new resources at, and better BDRF models are straightforward to implement from a coders point of view, so why not?

Share this post


Link to post
Share on other sites
Well, from what I've seen, these physically based models look much better in offline rendering then in real-time.This is probably because a realistic BRDF is more useful to a path tracer since it can provide realistic diffuse lighting and neat indirect lighting effects like glossy reflections, while in real-time rendering the model can only e used to generate the direct diffuse lighting and a specular highlight.
you'd also need something to give an all around specular term rather than just a single light and a diffuse ambient; otherwise the results aren't going to be terribly noticeable.
^^This is a good point -- if you don't have a lot of lights being evaluated under the BRDF, you're not going to notice it. In offline rendering, every surface becomes an (indirect) light-source, so there's a lot more light going through the BRDF, making the subtle specular improvements a lot more noticable.

In games, traditionally we've used pretty simple ambient lighting solutions -- if your ambient light isn't going through your cook-torrence BRDF, then it's still going to look very "Lamberty" a lot of the time.

On my most recent game, we're using a heavily approximate version of cook-torrence on almost all surfaces. To make the 360/PS3 happy, we've limited ourselves to only evaluating two lights per pixel. The first light is used to represent the main lighting conditions in the scene (usually the sun).
Instead of having an "ambient term" in our lighting, we use the second light to light up the non-lit areas. Per vertex, we pick an arbitrary direction that's both pointing away from the view-direction and the main-light-direction, find out what the ambient colour is in that direction (e.g. via a cube-map or SH probe, etc) and use that direction/colour as a directional light (evaluated with cook-torrence per-pixel). This gives us a 3d ambient light-source which contributes specular (somewhat) properly.

Originally, our ambient term was simply based off this ambient light map/probe and the diffuse colour (i.e. [font=courier new,courier,monospace]SampleEnvironment(normal) * albedo[/font]), but this meant that our surfaces always looked really plain when in shadow -- metal/skin/cotton/satin all looked the same. When we switched to the above scheme, all of our materials held their 'character' under any lighting conditions.

Share this post


Link to post
Share on other sites
I've been doing a more thorough comparison between the old Phong model and the combination of Oren-Nayar and Cook-Torrance and I admit that I was a too quick on my initial judgement about these two models. This is what I concluded from my recent experiments:

- Oren-Nayar: I still think the difference between this model and the old Phong model is barely noticeable. It does provide a bit more realism for simulating rough surfaces by reflecting more light when it hits the surface at grazing angles (the surface doesn't become so dark in comparison to Phong). I'm still not convinced of the benefits of switching to this model, in particular because it would force me to increase my G-buffer with a roughness parameter, but since memory bandwidth is not a problem right now I may just pay that price for the slight increase in realism.

- Cook-Torrance: I found that my implementation was incorrect, once I fixed it the resulting specular was astonishing. This model can really provide a natural looking specular with an elongated effect (Blinn could too but it didn't look natural). Adjusting the roughness of the material spreads the light in a very realistic way in contrast to Phong which always looked too bright and too much like a perfect mirror. This one I'll definitely keep in my engine.

Please feel free to comment, I'd like to know if you guys share my opinion or if there's something more to it that I may be missing.


On my most recent game, we're using a heavily approximate version of cook-torrence on almost all surfaces. To make the 360/PS3 happy, we've limited ourselves to only evaluating two lights per pixel. The first light is used to represent the main lighting conditions in the scene (usually the sun).
Instead of having an "ambient term" in our lighting, we use the second light to light up the non-lit areas. Per vertex, we pick an arbitrary direction that's both pointing away from the view-direction and the main-light-direction, find out what the ambient colour is in that direction (e.g. via a cube-map or SH probe, etc) and use that direction/colour as a directional light (evaluated with cook-torrence per-pixel). This gives us a 3d ambient light-source which contributes specular (somewhat) properly.


That's a very interesting approach, I'll have to give it some thought to understand it completely but it does seem promising at first sight. You don't happen to have some screenshots available for us to see the result, do you? laugh.png

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement