foo
[demo_prior] / sdr / whitted.p.glsl
index 44bb180..1c40d1d 100644 (file)
@@ -37,8 +37,8 @@ vec3 tex_chess(in vec3 col1, in vec3 col2, in vec2 spos);
 
 #define GREY(x)        vec3(x, x, x)
 
-const Material mtl_sph = Material(GREY(0.05), GREY(0.8), 80.0, 0.8, 0.0, 0.0);
-const Material mtl_glass = Material(GREY(0.0), GREY(0.8), 80.0, 0.99, 0.99, 1.52);
+const Material mtl_sph = Material(vec3(0.05, 0.15, 0.08), GREY(0.8), 80.0, 0.8, 0.0, 0.0);
+const Material mtl_glass = Material(GREY(0.02), GREY(0.8), 80.0, 0.99, 0.99, 1.52);
 const Material mtl_air = Material(GREY(0.0), GREY(0.8), 80.0, 0.99, 0.99, 1.0);
 const Material mtl_floor = Material(GREY(0.5), GREY(0.0), 1.0, 0.0, 0.0, 0.0);
 
@@ -163,11 +163,11 @@ vec3 shade(in vec3 ro, in vec3 rd, in HitPoint hit)
 
 vec3 backdrop(in vec3 dir)
 {
-       return vec3(0.1, 0.15, 1.0);
+       return vec3(0.02, 0.38, 0.6) * 0.9;
 }
 
-#define FLOOR_OFFS     vec3(3.0, 0.0, 0.0)
-#define FLOOR_SIZE     vec2(5.5, 15.0)
+#define FLOOR_OFFS     vec3(3.0, 0.0, -9.0)
+#define FLOOR_SIZE     vec2(5.5, 12.0)
 
 #define REFL_POS       vec3(1.36, -0.5, 0.0)
 #define GLASS_POS      vec3(0.0, 0.2, 1.2)
@@ -207,7 +207,7 @@ bool isect_scene(in vec3 ro, in vec3 rd, out HitPoint hit_res)
        if(isect_floor(ro, rd, FLOOR_SIZE, hit) && hit.dist < nearest.dist) {
                nearest = hit;
                nearest.mtl = mtl_floor;
-               nearest.mtl.diffuse = tex_chess(vec3(1.0, 0.0, 0.0), vec3(1.0, 1.0, 0.0), hit.surfpos);
+               nearest.mtl.diffuse = tex_chess(vec3(0.25, 0.01, 0.01), vec3(0.3, 0.3, 0.1), hit.surfpos);
        }
 
        if(nearest.dist >= 9999.0) {
@@ -297,7 +297,7 @@ float hack_fresnel(vec3 i, vec3 n, vec3 fresnel_val)
 vec3 tex_chess(in vec3 col1, in vec3 col2, in vec2 spos)
 {
        float foo = step(0.5, mod(spos.x * 8.0, 1.0)) * 2.0 - 1.0;
-       float bar = step(0.5, mod(spos.y * 24.0, 1.0)) * 2.0 - 1.0;
+       float bar = step(0.5, mod(spos.y * 12.0, 1.0)) * 2.0 - 1.0;
 
        float xor = (foo * bar) * 0.5 + 0.5;