#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);
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)
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) {
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;
void vignette(float r, float g, float b, float offs, float sharp)
{
glUseProgram(sdr_vgn);
- if(vgn_uloc_color) {
+ if(vgn_uloc_color >= 0) {
glUniform3f(vgn_uloc_color, r, g, b);
}
- if(vgn_uloc_offs) {
+ if(vgn_uloc_offs >= 0) {
glUniform1f(vgn_uloc_offs, offs);
}
- if(vgn_uloc_sharp) {
+ if(vgn_uloc_sharp >= 0) {
glUniform1f(vgn_uloc_sharp, sharp);
}
overlay(0, 1.0, 1.0);