]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't use "sample" as variable name in GLSL
authorMikko Rasa <tdb@tdb.fi>
Sat, 24 Apr 2021 11:45:32 +0000 (14:45 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 24 Apr 2021 11:45:32 +0000 (14:45 +0300)
In later versions it's a keyword.

builtin_data/_ambientocclusion_combine.glsl
builtin_data/_ambientocclusion_occlude.glsl

index 88929066b73f7cca9a77cc062223935522ce511a..2e9f75fc30595c05066c77c3c780718c24ed8d7a 100644 (file)
@@ -15,11 +15,11 @@ void main()
                        vec2 offset = vec2(float(i), float(j))-1.5;
                        vec2 sample_coord = texcoord+offset*tex_scale;
                        float occ = texture(occlusion, sample_coord).r;
-                       float sample = texture(depth, sample_coord).r;
+                       float sample_depth = texture(depth, sample_coord).r;
                        float z_range = occlusion_radius*length(offset)*edge_depth_threshold;
                        float min_depth = project(vec3(center.xy, center.z+z_range)).z;
                        float max_depth = project(vec3(center.xy, center.z-z_range)).z;
-                       if(sample>=min_depth && sample<=max_depth)
+                       if(sample_depth>=min_depth && sample_depth<=max_depth)
                        {
                                sum += occ;
                                count += 1.0;
index 260f1efa770a89a04679dfc39c7c5de3277d7cc7..62fd153b712589e205f73738887a7db4e05f05c9 100644 (file)
@@ -14,10 +14,10 @@ void main()
        for(int i=0; i<n_samples; ++i)
        {
                vec3 psp = project(center+transform*sample_points[i]);
-               float sample = texture(depth, psp.xy*0.5+0.5).r;
-               if(sample>=min_depth)
+               float sample_depth = texture(depth, psp.xy*0.5+0.5).r;
+               if(sample_depth>=min_depth)
                {
-                       if(sample<psp.z)
+                       if(sample_depth<psp.z)
                                occlusion_sum += 1.0;
                        count += 1.0;
                }