Your preferred or desired BRDF?

Started by
50 comments, last by Hodgman 11 years, 1 month ago

I'm just curious what everyone's using nowadays, or what you'd like to investigate looking forward. I guess Normalized Blinn Phong is the easy starter choice, and Cook-Torrance is a popular model amongst the more expensive ones. But I'm wondering what else is out there and what the advantages and disadvantages of those models are.

Also, what BRDF do you want to use that is currently near feasible? What would you choose if your min spec was 3x SLI GTX Titans? ;)

SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Advertisement
You may want to check:

Disney Slides
Beyond a Simple Physically Based Blinn-Phong Model in Real-Time (+ slides)
Calibrating Lighting and Materials in Far Cry 3

As you can see, brdf was a a hot topic last year in SIGGRAPH 2012.

PS: There's more.

Cheers.

I personally like how Ashikhmin-Shirley looks since the diffuse term changes with the view angle. This is true for Oren-Nayar as well but it is less noticeable.

We presented a more accurate and more efficient Oren-Nayar last year at SIGGRAPH (see links provided by Matias Goldberg: “Beyond a Simple Physically Based Blinn-Phong Model in Real-Time (+ slides)”)

I am not so much into Cook-Torrance as it seems to result in overpowering speculars, at least for me. Since I don’t have a way to actually specify reflectance at normal incidence on my models for my engine yet it could be that I just don’t have a very good conversion of specular power to reflectance at normal incidence. But checking images online they do also seem to have much wider and area-encompassing speculars.

I would use our improved Oren-Nayar model by default for low-end devices.

If computing power is removed from the equation I would stick with Ashikhmin-Shirley coupled with the layered material system that was also presented in the same link as above (of course, only when appropriate—not all surfaces need a layered-material system).

Here are results of Ashikhmin-Shirley:

LSBRDF19.png

This shot in particular sold me on Ashikhmin-Shirley with the nice transition of oranges over the hood of the car.

LSBRDF20.png

No ambient-occlusion was used on the bumper. It is just the natural result of Ashikhmin-Shirley.

More…

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

If you are interested in a good overview of the semi-standard lighting models, take a look in the Lighting section of Programming Vertex, Geometry, and Pixel shaders. Jack wrote a good, in-depth discussion of each of them individually, and the shader code should be at least a good starting point for your work (assuming HLSL of course...).

P.S.: My preference is: all of them! Make your material system flexible enough to swap them in and out with data definitions!

I've taken to Cook-Torrance with the GGX distribution and Smith geometry factor (thanks CryZe) for specular, and the qualitative version of Oren-Nayar for diffuse.


analytic

::begin parameters
color Diffuse 1 0 0
color Specular 1 1 1
float DiffuseScale 0 1 0.5
float SpecularScale 0 0.999 .028
float Roughness 0.005 2 0.2
::end parameters

::begin shader

vec3 BRDF( vec3 L, vec3 V, vec3 N, vec3 X, vec3 Y )
{
    vec3 Kd = Diffuse * DiffuseScale;
    vec3 Ks = Specular * SpecularScale;

    vec3 H = normalize(L + V);
    float NdotL = clamp(dot(N, L), 0, 1);
    float NdotV = dot(N, V);
    float NdotH = dot(N, H);
    float LdotH = dot(L, H);

    float a_2 = Roughness * Roughness;
    float NdotL_2 = NdotL * NdotL;
    float NdotV_2 = NdotV * NdotV;
    float NdotH_2 = NdotH * NdotH;
    float OneMinusNdotL_2 = 1.0 - NdotL_2;
    float OneMinusNdotV_2 = 1.0 - NdotV_2;

    vec3 Fd = 1.0 - Ks;

    float gamma = clamp(dot(V - N * NdotV, L - N * NdotL), 0, 1);
    float A = 1.0 - 0.5 * (a_2 / (a_2 + 0.33));
    float B = 0.45 * (a_2 / (a_2 + 0.09));
    float C = sqrt(OneMinusNdotL_2 * OneMinusNdotV_2) / max(NdotL, NdotV);

    vec3 Rd = Kd * Fd * (A + B * gamma * C) * NdotL;

    float D = NdotH_2 * (a_2 - 1.0) + 1.0;

    vec3 Fs = Ks + Fd * exp(-6 * LdotH);

    float G1_1 = 1.0 + sqrt(1.0 + a_2 * (OneMinusNdotL_2 / NdotL_2));
    float G1_2 = 1.0 + sqrt(1.0 + a_2 * (OneMinusNdotV_2 / NdotV_2));
    float G = G1_1 * G1_2;

    vec3 Rs = (a_2 * Fs) / (D * D * G * NdotV);

    return Rd + Rs;
}

::end shader

If you are interested in a good overview of the semi-standard lighting models, take a look in the Lighting section of Programming Vertex, Geometry, and Pixel shaders. Jack wrote a good, in-depth discussion of each of them individually, and the shader code should be at least a good starting point for your work (assuming HLSL of course...).

P.S.: My preference is: all of them! Make your material system flexible enough to swap them in and out with data definitions!

Naturally -- this isn't an engineering thread. I'm just a bit tired of seeing the same four or so BRDFs over and over again and I was hoping for a wider view of the subject.

L.Spiro -- it looks interesting and I like a couple things about it. Something about the look of the brighter specular areas really goes down poorly with me though. I'm not sure it's the BRDF though; the highlights are very blown and I'm wondering if maybe I'm just not happy with the choice of tonemap in those shots. The roof of the orange car looks very odd to me, and the specular on the blue one is awfully wide.

SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

I went over my shader again and found 2—count them—2 places where I used wrong dot products.

One should have been HdotL but was HdotN and the other should have been HdotN but was HdotL.

I also realized a way to remove a sqrt().


float Nu = fAnisotropy.x;
float Nv = fAnisotropy.y;
float Ps_num = sqrt( (Nu + 1) * (Nv + 1) );
 

Ps_num can be calculated ahead of time and sent to the shader.

I will post my results later but the crap specular you noticed is fixed. I have been wondering about that for a long time too but every time I went over my shader I missed those little letters.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

After fixing the above and also changing my formula for converting specular power to the anisotropy values, here are better results of Ashikhmin-Shirley.

[attachment=13822:Ash2.png]

[attachment=13823:Ash3.png]

[attachment=13821:Ash0.png]

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Those new screens look great, L.S.!

I've taken to Cook-Torrance with the GGX distribution and Smith geometry factor (thanks CryZe) for specular, and the qualitative version of Oren-Nayar for diffuse.

Thumbs up for the BRDF explorer format so I can see exactly what it looks like biggrin.png

Also, what BRDF do you want to use that is currently near feasible?

I'm trying to nail down the BRDF's for my current project at the moment, and I'd like to come up with a single one to simplify deferred shading...

The features that I think I need so far are: Non-lambertian diffuse, IOR/F(0º)/spec-mask, anisotropic roughness, metal/non-metal, retro-reflectiveness and translucency.

So far, I've got multiple options for implementing these features, but I've not yet researched retro-reflective BRDF's yet, and just have my own hacks based on intuition. Can anyone recommend me any existing models that support retro-reflection?

Naturally -- this isn't an engineering thread. I'm just a bit tired of seeing the same four or so BRDFs over and over again and I was hoping for a wider view of the subject.

There are pictures too - just pretend those ugly equations aren't there :P

This topic is closed to new replies.

Advertisement