From a4236a34dfc0f386182c7ff2d6729613ed73336f Mon Sep 17 00:00:00 2001 From: Aaron Fenyes Date: Mon, 2 Sep 2024 15:15:18 -0700 Subject: [PATCH] Ray-caster: dim the interior layers of spheres This seems to weaken the intersection disk illusion. --- app-proto/inversive-display/src/inversive.frag | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app-proto/inversive-display/src/inversive.frag b/app-proto/inversive-display/src/inversive.frag index 2fcd86e..9913b40 100644 --- a/app-proto/inversive-display/src/inversive.frag +++ b/app-proto/inversive-display/src/inversive.frag @@ -46,6 +46,7 @@ uniform bool debug_mode; const float focal_slope = 0.3; const vec3 light_dir = normalize(vec3(2., 2., 1.)); const float ixn_threshold = 0.005; +const float INTERIOR_DIMMING = 0.7; // --- sRGB --- @@ -143,6 +144,7 @@ void main() { vec2 hit_depths = sphere_cast(sphere_list[id], dir); // insertion-sort the fragments we hit into the fragment list + float dimming = 1.; for (int side = 0; side < 2; ++side) { float hit_z = -hit_depths[side]; if (0. > hit_z) { @@ -154,7 +156,7 @@ void main() { frags[layer] = sphere_shading( sphere_list[id], hit_depths[side] * dir, - color_list[id], + dimming * color_list[id], id ); } @@ -167,6 +169,7 @@ void main() { } } layer_cnt = min(layer_cnt + 1, LAYER_MAX); + dimming = INTERIOR_DIMMING; } } }