more shader opengl backwards-compatibility

This commit is contained in:
2024-06-22 14:42:31 -06:00
parent e34b69ab20
commit 69b7ce4549
2 changed files with 3 additions and 3 deletions

View File

@@ -184,7 +184,7 @@ class ShaderFrontend implements FrontendPlugin {
case Some("SCREEN_UV"):
transformedCode += "openfl_TextureCoordv";
case Some("SCREEN_PIXEL_SIZE"):
transformedCode += "vec2(1 / openfl_TextureSize.x, 1 / openfl_TextureSize.y)";
transformedCode += "vec2(1.0 / openfl_TextureSize.x, 1.0 / openfl_TextureSize.y)";
case Some("uniform"):
var uType = expect("uniform type", nextToken);
@@ -297,7 +297,7 @@ class ShaderFrontend implements FrontendPlugin {
defaultSetterExps.push(macro $i{name + suffix} = $expressionInterpreted);
}
transformedCode += 'uniform $uType $name = ${expression};';
transformedCode += 'uniform $uType $name;';
case Some(other):
transformedCode += other;
default:

View File

@@ -7,7 +7,7 @@ uniform vec3 color_a = vec3(0.5);
uniform vec3 color_b = vec3(0.5);
uniform vec3 color_c = vec3(1.0);
uniform vec3 color_d = vec3(0.0, 0.33, 0.67);
uniform int iterations = 10; // : hint_range(1, 50, 1)
uniform int iterations = 10; // : hint_range(1, 50, 1)
uniform float speed = 1.0; // : hint_range(0.1, 10.0)
uniform float zoom = 1.0; // : hint_range(0.1, 5.0)
uniform float subtract = 0.5; // : hint_range(0.1, 1.0)