From: John Tsiombikas Date: Sat, 12 Dec 2020 22:33:52 +0000 (+0200) Subject: foo X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=7f33f4df3bdd41375f215548adc8016a55f03472;p=demo_prior foo --- diff --git a/sdr/whitted.p.glsl b/sdr/whitted.p.glsl index 44bb180..1c40d1d 100644 --- a/sdr/whitted.p.glsl +++ b/sdr/whitted.p.glsl @@ -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; diff --git a/src/part_whitted.c b/src/part_whitted.c index bda876b..6c176b4 100644 --- a/src/part_whitted.c +++ b/src/part_whitted.c @@ -101,7 +101,7 @@ static void draw(long tm) glVertex2f(-1, 1); glEnd(); - vignette(0.43, 0.38, 0.45, vgn_offset, vgn_sharp); + vignette(0.15, 0.05, 0.15, vgn_offset, vgn_sharp); if(dbgtex && dbg_alpha > 0.0) { glUseProgram(0); diff --git a/src/post.c b/src/post.c index c834073..994c93e 100644 --- a/src/post.c +++ b/src/post.c @@ -151,13 +151,13 @@ void overlay_tex(struct texture *tex, float alpha) 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);