From 7784999da1f194dcef3f55f688cd37eedba5528d Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 30 Aug 2023 16:54:15 -0700 Subject: [PATCH] tidy up unused shader values --- src/shader.wgsl | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/shader.wgsl b/src/shader.wgsl index cf11303b..41c0e59e 100644 --- a/src/shader.wgsl +++ b/src/shader.wgsl @@ -41,8 +41,6 @@ fn vs_sky(@builtin(vertex_index) vertex_index: u32) -> SkyOutput { struct GroundOutput { @builtin(position) position: vec4, - @location(1) normal: vec3, - @location(3) view: vec3, @location(4) pos: vec3, }; @@ -58,9 +56,7 @@ fn vs_ground(@builtin(vertex_index) vertex_index: u32) -> GroundOutput { ) * 100.0; var result: GroundOutput; - result.normal = vec3(0.0,1.0,0.0); result.pos = pos; - result.view = pos - r_data.cam_pos.xyz; result.position = r_data.proj * r_data.view * vec4(pos, 1.0); return result; } @@ -107,12 +103,6 @@ fn fs_entity(vertex: EntityOutput) -> @location(0) vec4 { @fragment fn fs_ground(vertex: GroundOutput) -> @location(0) vec4 { - //let incident = normalize(vertex.view); - //let normal = normalize(vertex.normal+vec3(cos(vertex.pos.x)/16.0,0.0,sin(vertex.pos.z)/16.0)); - //let reflected = incident - 2.0 * dot(normal, incident) * normal; - - //let reflected_color = textureSample(r_texture, r_sampler, reflected).rgb; - //return vec4(vec3(0.1) + 0.5 * reflected_color, 1.0); let dir = vec3(-1.0)+vec3(vertex.pos.x/16.%1.0,0.0,vertex.pos.z/16.%1.0)*2.0; return vec4(textureSample(r_texture, r_sampler, dir).rgb, 1.0); }