From f949c0b80e6e55b95f9fd5a2949eb644e8356dba Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Wed, 9 Dec 2020 02:49:31 +0200 Subject: [PATCH] whitted: fixed the transparent shadows with a nasty hack --- sdr/whitted.p.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdr/whitted.p.glsl b/sdr/whitted.p.glsl index 80b6bc9..3fa4308 100644 --- a/sdr/whitted.p.glsl +++ b/sdr/whitted.p.glsl @@ -143,7 +143,7 @@ vec3 shade(in vec3 ro, in vec3 rd, in HitPoint hit) vec3 norm = faceforward(hit.norm, rd, hit.norm); vec3 ldir = light_pos - hit.pos; - vec3 amb = hit.mtl.diffuse * 0.02; + vec3 amb = hit.mtl.diffuse * 0.01; isect_scene(hit.pos + norm * 0.01, ldir, shadow_hit); @@ -192,7 +192,7 @@ bool isect_scene(in vec3 ro, in vec3 rd, out HitPoint hit_res) nearest.mtl = mtl_glass; } if(hit.dist < 1.0) { - opacity *= mtl_glass.refr; + opacity *= mtl_glass.refr * 0.25; // XXX hack quarter the refr, fresnel would reduce it drastically } } -- 1.7.10.4