c++openglglslmsaa

When enabling MSAA, artifacts appear and texture lookups fail on edges


On the edges of my cubes, lines with RGBA 0, 0, 0, 0 appear as texture lookups on that position fail. I have colored the texture lookups that failed magenta in my fragment shader.

Should I render to a texture first, bind it to a quad and perform the MSAA afterwards instead of per cube?

Maybe it samples pixels that are not filled yet.

enter image description here


Solution

  • Using GL_CLAMP_TO_EDGE instead of GL_CLAMP_TO_BORDER solved the issue.