File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ fn getFresnel(
99 iridescenceIntensity: f32
1010 #endif
1111) -> vec3f {
12- let fresnel: f32 = pow(1.0 - max (cosTheta, 0.0 ), 5.0);
12+ let fresnel: f32 = pow(1.0 - saturate (cosTheta), 5.0);
1313 let glossSq: f32 = gloss * gloss;
1414 let ret: vec3f = specularity + (max(vec3f(glossSq), specularity) - specularity) * fresnel;
1515
@@ -21,6 +21,6 @@ fn getFresnel(
2121}
2222
2323fn getFresnelCC(cosTheta: f32) -> f32 {
24- let fresnel: f32 = pow(1.0 - max (cosTheta, 0.0 ), 5.0);
24+ let fresnel: f32 = pow(1.0 - saturate (cosTheta), 5.0);
2525 return 0.04 + (1.0 - 0.04) * fresnel;
2626}` ;
Original file line number Diff line number Diff line change @@ -9,8 +9,7 @@ vec3 getFresnel(
99 float iridescenceIntensity
1010#endif
1111 ) {
12- float safeCosTheta = clamp(cosTheta, 0.0, 1.0);
13- float fresnel = pow(1.0 - safeCosTheta, 5.0);
12+ float fresnel = pow(1.0 - saturate(cosTheta), 5.0);
1413 float glossSq = gloss * gloss;
1514 vec3 ret = specularity + (max(vec3(glossSq), specularity) - specularity) * fresnel;
1615#if defined(LIT_IRIDESCENCE)
@@ -21,8 +20,7 @@ vec3 getFresnel(
2120}
2221
2322float getFresnelCC(float cosTheta) {
24- float safeCosTheta = clamp(cosTheta, 0.0, 1.0);
25- float fresnel = pow(1.0 - safeCosTheta, 5.0);
23+ float fresnel = pow(1.0 - saturate(cosTheta), 5.0);
2624 return 0.04 + (1.0 - 0.04) * fresnel;
2725}
2826` ;
You can’t perform that action at this time.
0 commit comments