mirror of
https://github.com/processing/processing4.git
synced 2026-02-02 13:21:07 +01:00
Using float constants in the shaders to avoid errors by the GLSL compiler on Mac.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user