Skip to content

Commit

Permalink
fix: specular name
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhhkrx committed Dec 26, 2024
1 parent dd6e0ec commit e9f3480
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/shader-shaderlab/src/shaders/shadingPBR/BRDF.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ void initBRDFData(SurfaceData surfaceData, out BRDFData brdfData){
brdfData.specularColor = specularColor;
#endif
brdfData.roughness = max(MIN_PERCEPTUAL_ROUGHNESS, min(roughness + getAARoughnessFactor(surfaceData.normal), 1.0));
brdfData.specularDFG = envBRDFApprox(brdfData.specularColor, brdfData.roughness, surfaceData.dotNV);
brdfData.envSpecularDFG = envBRDFApprox(brdfData.specularColor, brdfData.roughness, surfaceData.dotNV);

#ifdef MATERIAL_ENABLE_CLEAR_COAT
brdfData.clearCoatRoughness = max(MIN_PERCEPTUAL_ROUGHNESS, min(surfaceData.clearCoatRoughness + getAARoughnessFactor(surfaceData.clearCoatNormal), 1.0));
Expand Down
2 changes: 1 addition & 1 deletion packages/shader-shaderlab/src/shaders/shadingPBR/BTDF.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

// Use specularFGD as an approximation of the fresnel effect
// https://blog.selfshadow.com/publications/s2017-shading-course/imageworks/s2017_pbs_imageworks_slides_v2.pdf
vec3 specularDFG = brdfData.specularDFG;
vec3 specularDFG = brdfData.envSpecularDFG;

refractionTransmitted *= (1.0 - specularDFG);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void evaluateSpecularIBL(Varyings varyings, SurfaceData surfaceData, BRDFData br
vec3 speculaColor = brdfData.specularColor;
#endif

outSpecularColor += surfaceData.specularAO * radianceAttenuation * radiance * brdfData.specularDFG;
outSpecularColor += surfaceData.specularAO * radianceAttenuation * radiance * brdfData.envSpecularDFG;
}

void evaluateSheenIBL(Varyings varyings, SurfaceData surfaceData, BRDFData brdfData, float radianceAttenuation, inout vec3 diffuseColor, inout vec3 specularColor){
Expand Down

0 comments on commit e9f3480

Please sign in to comment.