🔧 Make shaders compatible with GLES

This commit is contained in:
Simon Schneegans
2023-04-02 20:42:38 +02:00
parent c78bc4c094
commit 5aad16c8bf
7 changed files with 44 additions and 32 deletions
+4 -2
View File
@@ -107,12 +107,14 @@ void main() {
if ((!uForOpening && gradient > hideThreshold) ||
(uForOpening && gradient < hideThreshold)) {
// We add some distortion in the scorch zone
// We add some distortion in the scorch zone. This is only possible if using GLES.
vec2 distort = vec2(0.0);
#ifndef GL_ES
if (scorchRange.x < gradient && gradient < scorchRange.y) {
distort = vec2(dFdx(gradient), dFdy(gradient)) * scorchMask * 5.0;
}
#endif
oColor = getInputColor(iTexCoord + distort);
}
@@ -154,4 +156,4 @@ void main() {
}
setOutputColor(oColor);
}
}