diff --git a/neercs/video/text-render.cpp b/neercs/video/text-render.cpp index 914ee2d..1a4ac90 100644 --- a/neercs/video/text-render.cpp +++ b/neercs/video/text-render.cpp @@ -47,10 +47,8 @@ void TextRender::Init() ivec2(256, 256), ivec2(1)); m_shader = Shader::Create(LOLFX_RESOURCE_NAME(text)); - m_color = m_shader->GetAttribLocation("in_Attr", - VertexUsage::Color, 0); - m_char = m_shader->GetAttribLocation("in_Char", - VertexUsage::Color, 1); + m_color = m_shader->GetAttribLocation(VertexUsage::Color, 0); + m_char = m_shader->GetAttribLocation(VertexUsage::Color, 1); #if !HAVE_SHADER_4 m_vertexid = m_shader->GetAttribLocation("in_VertexID", VertexUsage::Position, 0); diff --git a/neercs/video/text.lolfx b/neercs/video/text.lolfx index 56a16da..4bec7a7 100644 --- a/neercs/video/text.lolfx +++ b/neercs/video/text.lolfx @@ -5,10 +5,10 @@ #define HAVE_SHADER_4 1 #if HAVE_SHADER_4 -in uint in_Char, in_Attr; +in uint in_Color0, in_Color1; #else -attribute vec4 in_Char, in_Attr; -attribute float in_VertexID; +attribute vec4 in_Color0, in_Color1; +attribute float in_Position; # define out varying #endif @@ -21,6 +21,15 @@ uniform mat4 u_Transform; void main() { +#if HAVE_SHADER_4 + uint in_Attr = in_Color0; + uint in_Char = in_Color1; +#else + vec4 in_Attr = in_Color0; + vec4 in_Char = in_Color1; + float in_VertexID = in_Position; +#endif + #if HAVE_SHADER_4 float u = float(in_Char & 0xfu) / 32.0 + 0.0; float v = float((in_Char >> 4u) & 0xfu) / 32.0 + 0.5;