#version 150 #extension GL_ARB_shader_atomic_counters : require out vec4 fragColor; layout(binding=0, offset=0) uniform atomic_uint ac; layout(binding=1, offset=0) uniform atomic_uint ac2; void main() { float counter = float(atomicCounterIncrement(ac)); float counter2 = float(atomicCounterIncrement(ac2)); // These are just here so the compiler does not optimize them away. float r = (counter/ 255.f) / 255.f; float b = (counter2/ 255.f) / 255.f; fragColor = vec4(r, 0, b, 1); }