gamnit: don't use `texture` as it may be a std function
authorAlexis Laferrière <alexis.laf@xymus.net>
Mon, 20 Feb 2017 05:37:22 +0000 (00:37 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 27 Feb 2017 19:50:11 +0000 (14:50 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/gamnit/depth/particles.nit
lib/gamnit/flat.nit

index 11b9aac..3c40ac1 100644 (file)
@@ -252,12 +252,12 @@ class ParticleProgram
                uniform bool use_texture;
 
                // Texture to apply on this particle
-               uniform sampler2D texture;
+               uniform sampler2D texture0;
 
                void main()
                {
                        if (use_texture) {
-                               gl_FragColor = texture2D(texture, gl_PointCoord) * v_color;
+                               gl_FragColor = texture2D(texture0, gl_PointCoord) * v_color;
                                if (gl_FragColor.a <= 0.01) discard;
                        } else {
                                gl_FragColor = v_color;
@@ -272,7 +272,7 @@ class ParticleProgram
        var use_texture = uniforms["use_texture"].as(UniformBool) is lazy
 
        # Visible texture unit
-       var texture = uniforms["texture"].as(UniformSampler2D) is lazy
+       var texture = uniforms["texture0"].as(UniformSampler2D) is lazy
 
        # Color tint per vertex
        var color = attributes["color"].as(AttributeVec4) is lazy
index 8501ef4..6487ed2 100644 (file)
@@ -361,7 +361,7 @@ class Simple2dProgram
                uniform bool use_texture;
 
                // Texture to apply on this object
-               uniform sampler2D texture;
+               uniform sampler2D texture0;
 
                // Input from the vertex shader
                varying vec4 v_color;
@@ -370,7 +370,7 @@ class Simple2dProgram
                void main()
                {
                        if(use_texture) {
-                               gl_FragColor = v_color * texture2D(texture, v_coord);
+                               gl_FragColor = v_color * texture2D(texture0, v_coord);
                                if (gl_FragColor.a == 0.0) discard;
                        } else {
                                gl_FragColor = v_color;
@@ -385,7 +385,7 @@ class Simple2dProgram
        var use_texture = uniforms["use_texture"].as(UniformBool) is lazy
 
        # Visible texture unit
-       var texture = uniforms["texture"].as(UniformSampler2D) is lazy
+       var texture = uniforms["texture0"].as(UniformSampler2D) is lazy
 
        # Coordinates on the textures, per vertex
        var tex_coord = attributes["tex_coord"].as(AttributeVec2) is lazy