Sign in to follow this  
Promit

Your preferred or desired BRDF?

Recommended Posts

Chris_F    3030

I've been having an issue with different Cook-Torrance geometry terms though - most of these BRDF's are modulated by NdotV in some way, with the assumption that this can't be negative, else the fragment wouldn't be visible. However, in actual game scenes, this assumption doesn't hold! Simply picture a cube that's had normals generated without hard-edges / with every face in the same smoothing group (or alternatively, picture a sphere that's been LOD'ed super-aggressively into a cube - same thing). In this case there's a huge number of fragments where NdotV will be negative, but simply cutting off the lighting for these fragments looks really unnatural.
To get around these unnatural cut-offs in my game scenes, I've simply scaled/biased NdotV (and NdotL to maintain reciprocity) into the 0-1 range right before doing the specular calculations, which produces a "wrapped geometry term", instead of one that becomes zero at the horizon...
Has anyone else dealt with this issue?

Kelemen Szirmay-Kalos! Kelemen Szirmay-Kalos! Kelemen Szirmay-Kalos!

 

Okay, okay, I'll try and add some useful content later on. But seriously, it's designed to be a Cook-Torrance geometry term that doesn't suck. It succeeds.

 

The Kelemen Szirmay-Kalos visibility approximation is indeed very handy. My minimalistic Cook-Torrance uses it because it's dirt cheap and gives good results, but it suffers from the same shortcoming as the original Cook-Torrance geometry term, and that is that it does not take the roughness of the surface into account at all.

 

I'm still not sure about the way retroreflection is being handled. It seems to me that most natural materials display very little in the way of retroreflection, and mostly at grazing angles. This is captured by Oren-Nayar and GGX. Objects with very high levels of retroreflection are synthetic and consist of macroscopic corner reflectors, or similar. It would be nice if these could be modeled more accurately.

 

Path tracing of a flat surface made up of corner reflectors. L = V = ~45°

 

[attachment=13962:untitled.png]

 

 

Edited by Chris_F

Share this post


Link to post
Share on other sites
Hodgman    51234

Unless I've misread (edit: yes I have), Kelemen doesn't help with that issue, because the geometry factor still becomes zero when N.V becomes zero.

 

To illustrate, here's my test cube with smoothed normals, something pretty common in low to medium poly game scenes:

EdtyN6a.png

 

And here's how it looks with the Cook-Torrence specular using Smith or Kelemen geometry terms, with and without my dodgey scale/bias hack (the difference in saturation is due to the tone-mapper). This cube is surrounded by directional lights so that there's one at least pointing at each face, yet there's huge black areas, simply because they're apparently not visible (N.V is negative).

44OqYRf.png

N.B. the contribution for each light is still multiplied by the real, unbiased NdotL, so that faces that aren't visible to each light aren't lit by them.

 

[edit] Ah yeah, the Kelemen visibility approximation (without my scale/bias hack) looks like:

wcYJlTk.png

But as Chris pointed out, it doesn't take roughness into account, which is a bit disappointing.

Edited by Hodgman

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this