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);
#define FLOOR_OFFS vec3(3.0, 0.0, 0.0)
#define FLOOR_SIZE vec2(5.5, 15.0)
+#define REFL_POS vec3(1.36, -0.5, 0.0)
#define GLASS_POS vec3(0.0, 0.2, 1.2)
bool isect_scene(in vec3 ro, in vec3 rd, out HitPoint hit_res)
nearest.dist = 10000.0;
- if(isect_sphere(ro, rd, vec3(1.5, -0.5, 0.0), 0.85, hit)) {
+ if(isect_sphere(ro, rd, REFL_POS, 0.85, hit)) {
nearest = hit;
nearest.mtl = mtl_sph;
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
}
}