projects
/
demo_prior
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
whitted: fixed the transparent shadows with a nasty hack
[demo_prior]
/
sdr
/
whitted.p.glsl
diff --git
a/sdr/whitted.p.glsl
b/sdr/whitted.p.glsl
index
80b6bc9
..
3fa4308
100644
(file)
--- 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 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);
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) {
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
}
}
}
}