Optimize text rendering for long strings
This commit is contained in:
parent
678414f014
commit
3b78739efd
3 changed files with 71 additions and 56 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue