Fix text position

This commit is contained in:
Georg Hagen
2025-01-05 17:15:18 +01:00
parent aca64c57b7
commit 56cb508002
5 changed files with 18 additions and 17 deletions

View File

@@ -20,7 +20,7 @@ layout(set = 1, binding = 0) uniform CameraData
} cam;
void main() {
gl_Position = cam.viewProjection * node.world * vec4(position[gl_VertexIndex], 1.0, 1.0);
gl_Position = cam.viewProjection * node.world * vec4(position[gl_VertexIndex], 0.0, 1.0);
fragTextureCoordinates = textureCoordinates[gl_VertexIndex];
outColor = color;
outBgColor = bgColor;

View File

@@ -53,7 +53,7 @@ void main()
}
else
{
vec4 billboardPos = vec4(0.5, 0.5, 0.5, 1);
vec4 billboardPos = vec4(0.5, 0.5, 0, 1);
vec4 viewPos = cam.view * node.world * billboardPos;
float dist = -viewPos.z;
gl_Position = cam.projection * (viewPos + vec4(pos.xy * dist * 0.2, 0, 0));