From: John Tsiombikas Date: Wed, 9 Dec 2020 00:49:31 +0000 (+0200) Subject: whitted: fixed the transparent shadows with a nasty hack X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=demo_prior;a=commitdiff_plain;h=f949c0b80e6e55b95f9fd5a2949eb644e8356dba whitted: fixed the transparent shadows with a nasty hack --- 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 } }