Skip to content

Commit

Permalink
Fix gl_Position.z
Browse files Browse the repository at this point in the history
  • Loading branch information
JNNGL authored Jul 11, 2024
1 parent eb82315 commit 1414641
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/resources/shaders/include/minimap/vertex_main.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ if (texture(Sampler0, uv).xyz == vec3(112. / 255., 108. / 255., 138. / 255.)) {
if (vratio < ratio) ratio = 1;
else vratio = 1;
switch (vertexId) {
case 0: { gl_Position = vec4(-1 + 0.04 * vratio, 1 - 0.04 * ratio, 0, 1); uv2 = vec2(0, 1); break; }
case 1: { gl_Position = vec4(-1 + 0.04 * vratio, 1 - 0.70 * ratio, 0, 1); uv2 = vec2(0, 0); break; }
case 2: { gl_Position = vec4(-1 + 0.70 * vratio, 1 - 0.70 * ratio, 0, 1); uv2 = vec2(1, 0); break; }
case 3: { gl_Position = vec4(-1 + 0.70 * vratio, 1 - 0.04 * ratio, 0, 1); uv2 = vec2(1, 1); break; }
case 0: { gl_Position = vec4(-1 + 0.04 * vratio, 1 - 0.04 * ratio, -1, 1); uv2 = vec2(0, 1); break; }
case 1: { gl_Position = vec4(-1 + 0.04 * vratio, 1 - 0.70 * ratio, -1, 1); uv2 = vec2(0, 0); break; }
case 2: { gl_Position = vec4(-1 + 0.70 * vratio, 1 - 0.70 * ratio, -1, 1); uv2 = vec2(1, 0); break; }
case 3: { gl_Position = vec4(-1 + 0.70 * vratio, 1 - 0.04 * ratio, -1, 1); uv2 = vec2(1, 1); break; }
}

vec3 local = IViewRotMat * vec3(1, 0, 0);
Expand Down Expand Up @@ -102,4 +102,4 @@ if (texture(Sampler0, uv).xyz == vec3(112. / 255., 108. / 255., 138. / 255.)) {
texCoord0 = UV0;
texCoord1 = uv;
texCoord2 = uv2;
vertexColor = vcolor;
vertexColor = vcolor;

0 comments on commit 1414641

Please sign in to comment.