mirror of
https://github.com/galacean/engine.git
synced 2026-06-20 23:06:00 +08:00
fix: clamp 0 at last output (#2243)
This commit is contained in:
@@ -18,6 +18,7 @@ vec4 gammaToLinear(vec4 srgbIn){
|
||||
}
|
||||
|
||||
vec4 linearToGamma(vec4 linearIn){
|
||||
linearIn = max(linearIn, 0.0);
|
||||
return vec4( pow(linearIn.rgb, vec3(1.0 / 2.2)), linearIn.a);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,9 +34,7 @@ vec3 envBRDFApprox(vec3 specularColor,float roughness, float dotNV ) {
|
||||
|
||||
vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;
|
||||
|
||||
// AB may less than 0 at high roughness, ref: https://github.com/galacean/engine/pull/2173
|
||||
return max(specularColor * AB.x + AB.y, 0.0);
|
||||
|
||||
return specularColor * AB.x + AB.y;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user