Skip to content

Commit 7b8f3d0

Browse files
committed
fix: sheen
1 parent a69698e commit 7b8f3d0

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • packages/shaderlab/src/shaders/shadingPBR

packages/shaderlab/src/shaders/shadingPBR/BRDF.glsl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ vec3 BRDF_Diffuse_Lambert(vec3 diffuseColor) {
345345
}
346346

347347
float prefilteredDFG(float NoV, float perceptualRoughness) {
348-
return textureLod( material_SheenLUT, vec2(NoV, perceptualRoughness), 0.0).b;
349-
}
348+
return textureLod(material_SheenLUT, vec2(NoV, perceptualRoughness), 0.0).b;
349+
}
350350
#endif
351351

352352
// ------------------------Indirect Specular------------------------
@@ -398,8 +398,7 @@ void initBRDFData(SurfaceData surfaceData, out BRDFData brdfData){
398398

399399
#ifdef MATERIAL_ENABLE_SHEEN
400400
brdfData.sheenRoughness = max(MIN_PERCEPTUAL_ROUGHNESS, min(surfaceData.sheenRoughness + getAARoughnessFactor(surfaceData.normal), 1.0));
401-
float perceptualRoughness = brdfData.sheenRoughness * brdfData.sheenRoughness;
402-
brdfData.approxIBLSheenDG = prefilteredDFG(surfaceData.dotNV, perceptualRoughness);
401+
brdfData.approxIBLSheenDG = prefilteredDFG(surfaceData.dotNV, brdfData.sheenRoughness);
403402
brdfData.sheenScaling = 1.0 - brdfData.approxIBLSheenDG * max(max(surfaceData.sheenColor.r, surfaceData.sheenColor.g), surfaceData.sheenColor.b);
404403
#endif
405404
}

0 commit comments

Comments
 (0)