|
|
|
|
|
|
// Ref: "Moving Frostbite to PBR", p. 69. |
|
|
|
float3 GetSpecularDominantDir(float3 N, float3 R, float roughness, float NdotV) |
|
|
|
{ |
|
|
|
float a = 1.0 - roughness; |
|
|
|
float s = sqrt(1.0 - roughness); |
|
|
|
float sinNV = sqrt(1.0 - NdotV * NdotV); |
|
|
|
float a = 1.0 - roughness; |
|
|
|
float s = sqrt(a); |
|
|
|
float lerpFactor = a * (s + roughness); |
|
|
|
float lerpFactor = (s + roughness) * a; |
|
|
|
float lerpFactor = s * saturate(lerp(s + s, a * a, sinNV)); |
|
|
|
float lerpFactor = (s + roughness) * saturate(lerp(a * a, a * a + a, NdotV * NdotV)); |
|
|
|
#endif |
|
|
|
|
|
|
|
// The result is not normalized as we fetch in a cubemap |
|
|
|