I am using a LOD system to replace a big array of QUADS with Point Sprites.
The QUADS or point sprites are in a tightly packed blended volume to create a cloud or nebula effect.
In order to get the Point Sprites to “edge-blend” together nicely I am using GL_COORD_REPLACE_ARB and then using those coordinates in my fragment shader to make the PointSprites render as circles, thus…
vec2 mod_coord = gl_TexCoord.st * 2.0 - 1.0; gl_FragColor = gl_Color * (1.0 - length(mod_coord));
But this gives me instability and flickering in the rendering on a frame by frame basis. 50% of the time I get portions of the block disappearing.
If I remove the above logic and replace it with…
gl_FragColor = gl_Color;
I get square point sprites, but they are stable.
I pass the texture coords into the fragment shader from the vertex shader, thus…
gl_TexCoord = gl_MultiTexCoord0;
…relying on the fixed funtion pipeline to generate them.
Although I am not technically using the point sprites as point sprites, but rather fast quads, can anyone explain why I would see the instability?