Fix redundant renormalisation of vertex attribute.
This commit is contained in:
parent
0e7c1e80eb
commit
3e8c7e69a2
|
@ -40,7 +40,7 @@ fn mat4to3(m: mat4x4<f32>) -> mat3x3<f32> {
|
||||||
fn vertex(vertex: VertexInput) -> VertexOutput {
|
fn vertex(vertex: VertexInput) -> VertexOutput {
|
||||||
var out: VertexOutput;
|
var out: VertexOutput;
|
||||||
var clip_pos = view.view_proj * (mesh.model * vec4<f32>(vertex.position, 1.0));
|
var clip_pos = view.view_proj * (mesh.model * vec4<f32>(vertex.position, 1.0));
|
||||||
var clip_norm = mat4to3(view.view_proj) * (mat4to3(mesh.model) * normalize(vertex.normal));
|
var clip_norm = mat4to3(view.view_proj) * (mat4to3(mesh.model) * vertex.normal);
|
||||||
var clip_delta = vec2<f32>(vstage.width * normalize(clip_norm.xy) * clip_pos.w * view_uniform.scale);
|
var clip_delta = vec2<f32>(vstage.width * normalize(clip_norm.xy) * clip_pos.w * view_uniform.scale);
|
||||||
out.clip_position = vec4<f32>((clip_pos.xy + clip_delta) / clip_pos.w, model_origin_z(), 1.0);
|
out.clip_position = vec4<f32>((clip_pos.xy + clip_delta) / clip_pos.w, model_origin_z(), 1.0);
|
||||||
return out;
|
return out;
|
||||||
|
|
Loading…
Reference in New Issue