mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Corrected ARM BRDF formula. Thanks SmileTheory
This commit is contained in:
parent
8f1512dc5e
commit
9c324b53d1
2 changed files with 3 additions and 3 deletions
|
@ -94,7 +94,7 @@ void main( PS_IN fragment, out PS_OUT result )
|
|||
|
||||
|
||||
half3 halfAngleVector = normalize( lightVector + viewVector );
|
||||
half hdotN = saturate( dot3( halfAngleVector, localNormal ) );
|
||||
half hdotN = clamp( dot3( halfAngleVector, localNormal ), 0.0, 1.0 );
|
||||
|
||||
#if 0 //defined(USE_PBR)
|
||||
|
||||
|
@ -151,7 +151,7 @@ void main( PS_IN fragment, out PS_OUT result )
|
|||
// disney GGX
|
||||
float D = ( hdotN * hdotN ) * ( rrrr - 1.0 ) + 1.0;
|
||||
float VFapprox = ( ldotH * ldotH ) * ( roughness + 0.5 );
|
||||
half3 specularBRDF = ( rrrr / ( 4.0 * PI * D * D * VFapprox ) ) * reflectColor;
|
||||
half3 specularBRDF = ( rrrr / ( 4.0 * PI * D * D * VFapprox ) ) * ldotN * reflectColor;
|
||||
//specularBRDF = half3( 0.0 );
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -331,7 +331,7 @@ void main( PS_IN fragment, out PS_OUT result )
|
|||
// disney GGX
|
||||
float D = ( hdotN * hdotN ) * ( rrrr - 1.0 ) + 1.0;
|
||||
float VFapprox = ( ldotH * ldotH ) * ( roughness + 0.5 );
|
||||
half3 specularBRDF = ( rrrr / ( 4.0 * PI * D * D * VFapprox ) ) * reflectColor;
|
||||
half3 specularBRDF = ( rrrr / ( 4.0 * PI * D * D * VFapprox ) ) * ldotN * reflectColor;
|
||||
//specularBRDF = half3( 0.0 );
|
||||
|
||||
#if 0
|
||||
|
|
Loading…
Reference in a new issue