Skip to content

Commit

Permalink
[OpenGL] Some shader compilers complain about using uint for mat4 arr…
Browse files Browse the repository at this point in the history
…ay indexes

> error C7011: implicit cast from "uint" to "int"

So use an explicit cast.
  • Loading branch information
past-due committed Dec 1, 2023
1 parent bb5d641 commit f320d54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/base/shaders/terrain_combined_high.frag
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ out vec4 FragColor;

vec3 getGroundUv(int i) {
uint groundNo = fgrounds[i];
return vec3(uvGround * groundScale[groundNo/4u][groundNo%4u], groundNo);
return vec3(uvGround * groundScale[int(groundNo/4u)][int(groundNo%4u)], groundNo);
}

vec3 getGround(int i) {
Expand Down
2 changes: 1 addition & 1 deletion data/base/shaders/terrain_combined_medium.frag
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ out vec4 FragColor;

vec3 getGroundUv(int i) {
uint groundNo = fgrounds[i];
return vec3(uvGround * groundScale[groundNo/4u][groundNo%4u], groundNo);
return vec3(uvGround * groundScale[int(groundNo/4u)][int(groundNo%4u)], groundNo);
}

vec3 getGround(int i) {
Expand Down

0 comments on commit f320d54

Please sign in to comment.