tidy up unused shader values

This commit is contained in:
Quaternions 2023-08-30 16:54:15 -07:00
parent 3c73aeeaa8
commit 7784999da1

View File

@ -41,8 +41,6 @@ fn vs_sky(@builtin(vertex_index) vertex_index: u32) -> SkyOutput {
struct GroundOutput { struct GroundOutput {
@builtin(position) position: vec4<f32>, @builtin(position) position: vec4<f32>,
@location(1) normal: vec3<f32>,
@location(3) view: vec3<f32>,
@location(4) pos: vec3<f32>, @location(4) pos: vec3<f32>,
}; };
@ -58,9 +56,7 @@ fn vs_ground(@builtin(vertex_index) vertex_index: u32) -> GroundOutput {
) * 100.0; ) * 100.0;
var result: GroundOutput; var result: GroundOutput;
result.normal = vec3<f32>(0.0,1.0,0.0);
result.pos = pos; result.pos = pos;
result.view = pos - r_data.cam_pos.xyz;
result.position = r_data.proj * r_data.view * vec4<f32>(pos, 1.0); result.position = r_data.proj * r_data.view * vec4<f32>(pos, 1.0);
return result; return result;
} }
@ -107,12 +103,6 @@ fn fs_entity(vertex: EntityOutput) -> @location(0) vec4<f32> {
@fragment @fragment
fn fs_ground(vertex: GroundOutput) -> @location(0) vec4<f32> { fn fs_ground(vertex: GroundOutput) -> @location(0) vec4<f32> {
//let incident = normalize(vertex.view);
//let normal = normalize(vertex.normal+vec3<f32>(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<f32>(vec3<f32>(0.1) + 0.5 * reflected_color, 1.0);
let dir = vec3<f32>(-1.0)+vec3<f32>(vertex.pos.x/16.%1.0,0.0,vertex.pos.z/16.%1.0)*2.0; let dir = vec3<f32>(-1.0)+vec3<f32>(vertex.pos.x/16.%1.0,0.0,vertex.pos.z/16.%1.0)*2.0;
return vec4<f32>(textureSample(r_texture, r_sampler, dir).rgb, 1.0); return vec4<f32>(textureSample(r_texture, r_sampler, dir).rgb, 1.0);
} }