Application prototype #14
@ -193,15 +193,13 @@ void main() {
|
||||
if (debug_mode) {
|
||||
// at the bottom of the screen, show the color scale instead of the
|
||||
// layer count
|
||||
if (gl_FragCoord.y < 10.) layer_cnt = 2 * int(8. * gl_FragCoord.x / resolution.x);
|
||||
if (gl_FragCoord.y < 10.) layer_cnt = int(16. * gl_FragCoord.x / resolution.x);
|
||||
|
||||
// convert number to color
|
||||
vec3 color;
|
||||
if (layer_cnt % 2 == 0) {
|
||||
ivec3 bits = layer_cnt / ivec3(2, 4, 8);
|
||||
color = mod(vec3(bits), 2.);
|
||||
} else {
|
||||
color = vec3(0.5);
|
||||
ivec3 bits = layer_cnt / ivec3(1, 2, 4);
|
||||
vec3 color = mod(vec3(bits), 2.);
|
||||
if (layer_cnt % 16 >= 8) {
|
||||
color = mix(color, vec3(0.5), 0.5);
|
||||
}
|
||||
outColor = vec4(color, 1.);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user