Skip to content

Commit

Permalink
[resources/shaders/game] Fixed matrix multiplication.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Oct 29, 2023
1 parent 70ef018 commit b4cb504
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions resources/shaders/game.vs.sc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $output v_position, v_normal, v_color0, v_texcoord0, v_texcoord1, v_texcoord2

void main() {
// Used for lighting
v_position = u_model[0] * vec4(a_position.xyz, 1.0);
v_position = mul(u_model[0], vec4(a_position.xyz, 1.0));
v_normal = vec4(a_normal, 1.0);

v_color0 = a_color0;
Expand All @@ -30,7 +30,7 @@ void main() {
v_blockFace = a_position.w;

// Distance from eye
v_dist = length(u_view * v_position);
v_dist = length(mul(u_view, v_position));

gl_Position = u_proj * u_view * v_position;
gl_Position = mul(u_proj, mul(u_view, v_position));
}

0 comments on commit b4cb504

Please sign in to comment.