diff --git a/android/core/src/processing/opengl/FillShaderVertFull.glsl b/android/core/src/processing/opengl/FillShaderVertFull.glsl index c9a79eb50..cd6f6ce7f 100644 --- a/android/core/src/processing/opengl/FillShaderVertFull.glsl +++ b/android/core/src/processing/opengl/FillShaderVertFull.glsl @@ -83,10 +83,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 diff --git a/android/core/src/processing/opengl/FillShaderVertLit.glsl b/android/core/src/processing/opengl/FillShaderVertLit.glsl index 33d2360e7..7c184a807 100644 --- a/android/core/src/processing/opengl/FillShaderVertLit.glsl +++ b/android/core/src/processing/opengl/FillShaderVertLit.glsl @@ -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 diff --git a/java/libraries/opengl/src/processing/opengl/FillShaderVertFull.glsl b/java/libraries/opengl/src/processing/opengl/FillShaderVertFull.glsl index c9a79eb50..edbcb78fb 100644 --- a/java/libraries/opengl/src/processing/opengl/FillShaderVertFull.glsl +++ b/java/libraries/opengl/src/processing/opengl/FillShaderVertFull.glsl @@ -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); diff --git a/java/libraries/opengl/src/processing/opengl/FillShaderVertLit.glsl b/java/libraries/opengl/src/processing/opengl/FillShaderVertLit.glsl index 33d2360e7..7c184a807 100644 --- a/java/libraries/opengl/src/processing/opengl/FillShaderVertLit.glsl +++ b/java/libraries/opengl/src/processing/opengl/FillShaderVertLit.glsl @@ -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