Optimize text rendering for long strings

This commit is contained in:
Phireh 2024-01-06 14:35:11 +01:00
commit 3b78739efd
3 changed files with 71 additions and 56 deletions

View file

@ -1,13 +1,17 @@
#version 330 core
layout (location = 0) in vec2 vertex; // <vec2 pos>
out vec2 texuv;
uniform mat4 transform;
out VS_OUT {
vec2 texuv;
flat int index;
} vs_out;
uniform mat4 transforms[400];
uniform mat4 projection;
void main()
{
gl_Position = projection * transform * vec4(vertex.xy, 0.0, 1.0);
texuv = vertex.xy;
texuv.y=1.0f-texuv.y;
gl_Position = projection * transforms[gl_InstanceID] * vec4(vertex.xy, 0.0, 1.0);
vs_out.index = gl_InstanceID;
vs_out.texuv = vec2(vertex.x, 1.0f - vertex.y);
}