I’m writing code to render a texture, but the problem is white glitch.
Another one when i render a texture with a quad
this is my GLSL
// vertex
#version 420 core
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 2) in vec2 a_TexCoord;
layout(location = 3) in float a_TexIndex;
uniform mat4 u_ViewProjection;
out vec4 v_Color;
out vec2 v_TexCoord;
out float v_TexIndex;
void main()
{
v_Color = a_Color;
v_TexCoord = a_TexCoord;
v_TexIndex = a_TexIndex;
gl_Position = u_ViewProjection * vec4(a_Position, 1.0);
}
// fragment
#version 420 core
layout(location = 0) out vec4 color;
in vec4 v_Color;
in vec2 v_TexCoord;
in float v_TexIndex;
uniform sampler2D u_Textures[32];
void main()
{
color = texture(u_Textures[int(v_TexIndex)], v_TexCoord) * v_Color;
}
Is this the part make this glitch?
And what is this glitch call?
New contributor
TNP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
6