I've successfully developed a tile-based engine, but I'm facing an issue with antialiasing in WebGL. Everything looks great when antialiasing is disabled, but enabling it causes some edge pixel rendering problems. These pixels often appear as background pixels and affect the depth buffer's handling of intense (higher alpha) pixels.
My attempt to fix this by disabling the depth buffer and adjusting the blending factors to GL_SRC_ALPHA_SATURATE and GL_ONE resulted in strange white pixels being drawn instead. Despite padding my textures extensively to prevent filtering issues, the problem persists.
I've experimented with glSampleCoverage() but haven't had any success with random values. I'm also unsure about its functionality since examples online are scarce.
Disabling the depth buffer is not preferred, and GL_MULTISAMPLE is unavailable for use. I work in an Emscripten with C++ environment, but I believe there should be a generic OpenGL solution to this problem.
Is there a way to selectively disable antialiasing in WebGL for specific geometry?
Good:
Bad: