Use stored inverted transposed projection model view matrix
This commit is contained in:
parent
b0cebb67f8
commit
db42dd3d9e
@ -15,9 +15,8 @@ VertexData general_shader_vertex(void *shader, const VertexData *vert, u8 index,
|
||||
shdr->vertices[index].position = project_vec4(vh);
|
||||
shdr->vertices[index].uv = vert->uv;
|
||||
|
||||
M4x4f inv_transpose = mat4x4_inv(mat4x4_transpose(shdr->proj_mv));
|
||||
V4f hnorm = V3_to_V4(vert->normal);
|
||||
hnorm = mat4x4_mul_vec4(inv_transpose, hnorm);
|
||||
hnorm = mat4x4_mul_vec4(shdr->proj_mv_inv_t, hnorm);
|
||||
shdr->vertices[index].normal = project_vec4(hnorm);
|
||||
normalise_v3(shdr->vertices[index].normal);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user