From 355956e532b923f4f62c14d43d04d411a05f1e5c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 6 Sep 2023 14:30:30 -0700 Subject: [PATCH] change equation for bigger reflectionless area --- src/shader.wgsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shader.wgsl b/src/shader.wgsl index c3e98ad..dd55d4e 100644 --- a/src/shader.wgsl +++ b/src/shader.wgsl @@ -109,7 +109,7 @@ fn fs_entity(vertex: EntityOutput) -> @location(0) vec4 { let dir = vec3(-1.0)+2.0*vec3(vertex.texture.x,0.0,vertex.texture.y); let texture_color = textureSample(r_texture, r_sampler, dir).rgb; let reflected_color = textureSample(r_texture, r_sampler, reflected).rgb; - return vec4(mix(vec3(0.1) + 0.5 * reflected_color,texture_color,abs(d)), 1.0); + return vec4(mix(vec3(0.1) + 0.5 * reflected_color,texture_color,1.0-pow(1.0-abs(d),2.0)), 1.0); } fn modulo_euclidean (a: f32, b: f32) -> f32 {