Using float constants in the shaders to avoid errors by the GLSL compiler on Mac.

This commit is contained in:
codeanticode
2012-04-12 11:17:33 +00:00
parent e4dbc6fd9c
commit 5d29c7d6aa
4 changed files with 9 additions and 9 deletions

View File

@@ -83,11 +83,11 @@ void main() {
// Normal vector in eye coordinates
vec3 ecNormal = normalize(normalMatrix * inNormal);
if (dot(-ecVertex, ecNormal) < 0) {
if (dot(-ecVertex, ecNormal) < zero_float) {
// If normal is away from camera, choose its opposite.
// If we add backface culling, this will be backfacing
ecNormal *= -1;
}
ecNormal *= -one_float;
}
// Light calculations
vec3 totalAmbient = vec3(0, 0, 0);

View File

@@ -80,10 +80,10 @@ void main() {
// Normal vector in eye coordinates
vec3 ecNormal = normalize(normalMatrix * inNormal);
if (dot(-ecVertex, ecNormal) < 0) {
if (dot(-ecVertex, ecNormal) < zero_float) {
// If normal is away from camera, choose its opposite.
// If we add backface culling, this will be backfacing
ecNormal *= -1;
ecNormal *= -one_float;
}
// Light calculations