Corrected object shader's specularFactor calculation, which would result in NaN values that may propagate on some GPU's to the rest of the color calculation. This resulted in blocks of black pixels on some GPU's including the iPhone 6.
This commit is contained in:
@@ -252,7 +252,10 @@ void main()
|
||||
#if GBUFFER_PASS == 3
|
||||
specularFactor = gbuffer_specular_factor;
|
||||
#else
|
||||
specularFactor = max(0.0,pow(dot(halfVec,normal), material_shininess));
|
||||
mediump float halfVecDot = dot(halfVec,normal);
|
||||
if(halfVecDot > 0.0) {
|
||||
specularFactor = max(0.0,pow(halfVecDot, material_shininess));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -252,7 +252,10 @@ void main()
|
||||
#if GBUFFER_PASS == 3
|
||||
specularFactor = gbuffer_specular_factor;
|
||||
#else
|
||||
specularFactor = max(0.0,pow(dot(halfVec,normal), material_shininess));
|
||||
mediump float halfVecDot = dot(halfVec,normal);
|
||||
if(halfVecDot > 0.0) {
|
||||
specularFactor = max(0.0,pow(halfVecDot, material_shininess));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user