rename confusing variable

This commit is contained in:
Quaternions 2023-08-30 15:40:16 -07:00
parent 24eba89bfa
commit d790bbc280

View File

@ -1,6 +1,6 @@
struct SkyOutput { struct SkyOutput {
@builtin(position) position: vec4<f32>, @builtin(position) position: vec4<f32>,
@location(0) uv: vec3<f32>, @location(0) sampledir: vec3<f32>,
}; };
struct Data { struct Data {
@ -34,7 +34,7 @@ fn vs_sky(@builtin(vertex_index) vertex_index: u32) -> SkyOutput {
let unprojected = r_data.proj_inv * pos; let unprojected = r_data.proj_inv * pos;
var result: SkyOutput; var result: SkyOutput;
result.uv = inv_model_view * unprojected.xyz; result.sampledir = inv_model_view * unprojected.xyz;
result.position = pos; result.position = pos;
return result; return result;
} }
@ -92,7 +92,7 @@ var r_sampler: sampler;
@fragment @fragment
fn fs_sky(vertex: SkyOutput) -> @location(0) vec4<f32> { fn fs_sky(vertex: SkyOutput) -> @location(0) vec4<f32> {
return textureSample(r_texture, r_sampler, vertex.uv); return textureSample(r_texture, r_sampler, vertex.sampledir);
} }
@fragment @fragment