Mercurial > games > semicongine
changeset 1390:30663c71d9fb
autocommit
author | sam <sam@basx.dev> |
---|---|
date | Sat, 14 Dec 2024 16:29:06 +0700 |
parents | 86b2176168f8 |
children | dfec8cac24b3 |
files | semicongine/text.nim |
diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/semicongine/text.nim Sat Dec 14 16:27:26 2024 +0700 +++ b/semicongine/text.nim Sat Dec 14 16:29:06 2024 +0700 @@ -98,14 +98,18 @@ const int[6] indices = int[](0, 1, 2, 2, 3, 0); const int[4] i_x = int[](0, 0, 2, 2); const int[4] i_y = int[](1, 3, 3, 1); -// const float epsilon = 0.000000000000001; -const float epsilon = 0.1; +const float epsilon = 0.000000000000001; +// const float epsilon = 0.1; void main() { int vertexI = indices[gl_VertexIndex]; - vec3 pos = vec3(glyphData.pos[glyphIndex][i_x[vertexI]], glyphData.pos[glyphIndex][i_y[vertexI]], 0); + vec3 pos = vec3( + glyphData.pos[glyphIndex][i_x[vertexI]] * scale, + glyphData.pos[glyphIndex][i_y[vertexI]] * scale, + gl_VertexIndex * epsilon + ); vec2 uv = vec2(glyphData.uv[glyphIndex][i_x[vertexI]], glyphData.uv[glyphIndex][i_y[vertexI]]); - gl_Position = vec4(pos * scale + position, 1.0) + vec4(0, 0, gl_VertexIndex * epsilon, 0); + gl_Position = vec4(pos + position, 1.0); fragmentUv = uv; fragmentColor = color; } """