Enlarge the test construction to six spheres
In debug mode, assign most of the color scale to even layer counts. Odd layer counts are topologically prohibited, so we should rarely see bugs severe enough to produce them.
This commit is contained in:
parent
3a721a4cc8
commit
6db9f5be6c
@ -173,11 +173,17 @@ void main() {
|
|||||||
if (debug_mode) {
|
if (debug_mode) {
|
||||||
// at the bottom of the screen, show the color scale instead of the
|
// at the bottom of the screen, show the color scale instead of the
|
||||||
// layer count
|
// layer count
|
||||||
if (gl_FragCoord.y < 10.) layer_cnt = int(8. * gl_FragCoord.x / resolution.x);
|
if (gl_FragCoord.y < 10.) layer_cnt = 2 * int(8. * gl_FragCoord.x / resolution.x);
|
||||||
|
|
||||||
// convert number to color
|
// convert number to color
|
||||||
ivec3 bits = layer_cnt / ivec3(1, 2, 4);
|
vec3 color;
|
||||||
outColor = vec4(mod(vec3(bits), 2.), 1.);
|
if (layer_cnt % 2 == 0) {
|
||||||
|
ivec3 bits = layer_cnt / ivec3(2, 4, 8);
|
||||||
|
color = mod(vec3(bits), 2.);
|
||||||
|
} else {
|
||||||
|
color = vec3(0.5);
|
||||||
|
}
|
||||||
|
outColor = vec4(color, 1.);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,10 @@ fn main() {
|
|||||||
let color_vec = vec![
|
let color_vec = vec![
|
||||||
[1.00_f32, 0.25_f32, 0.00_f32],
|
[1.00_f32, 0.25_f32, 0.00_f32],
|
||||||
[0.00_f32, 0.25_f32, 1.00_f32],
|
[0.00_f32, 0.25_f32, 1.00_f32],
|
||||||
[0.25_f32, 0.00_f32, 1.00_f32]
|
[0.25_f32, 0.00_f32, 1.00_f32],
|
||||||
|
[0.25_f32, 1.00_f32, 0.00_f32],
|
||||||
|
[0.75_f32, 0.75_f32, 0.00_f32],
|
||||||
|
[0.00_f32, 0.75_f32, 0.50_f32],
|
||||||
];
|
];
|
||||||
|
|
||||||
// timing
|
// timing
|
||||||
@ -292,6 +295,9 @@ fn main() {
|
|||||||
sphere_vec.push(&construction_to_world * engine::sphere(0.5, 0.5, ctrl_x.get(), radius_x.get()));
|
sphere_vec.push(&construction_to_world * engine::sphere(0.5, 0.5, ctrl_x.get(), radius_x.get()));
|
||||||
sphere_vec.push(&construction_to_world * engine::sphere(-0.5, -0.5, ctrl_y.get(), radius_y.get()));
|
sphere_vec.push(&construction_to_world * engine::sphere(-0.5, -0.5, ctrl_y.get(), radius_y.get()));
|
||||||
sphere_vec.push(&construction_to_world * engine::sphere(-0.5, 0.5, 0.0, 0.75));
|
sphere_vec.push(&construction_to_world * engine::sphere(-0.5, 0.5, 0.0, 0.75));
|
||||||
|
sphere_vec.push(&construction_to_world * engine::sphere(0.5, -0.5, 0.0, 0.5));
|
||||||
|
sphere_vec.push(&construction_to_world * engine::sphere(0.0, 0.15, 1.0, 0.25));
|
||||||
|
sphere_vec.push(&construction_to_world * engine::sphere(0.0, -0.15, -1.0, 0.25));
|
||||||
|
|
||||||
// set the resolution
|
// set the resolution
|
||||||
let width = canvas.width() as f32;
|
let width = canvas.width() as f32;
|
||||||
|
Loading…
Reference in New Issue
Block a user