I have a really strange (at least to me) problem with a bunch of glsl shaders.
So, this is my workflow:
- I’m rendering a point cloud (glPointSize=1) and first want to mark some points
- I do a bunch of rendering passes marking the points and after each pass I discard the points that have been marked in previous runs. This I can do in two ways:
- manually remove the marked points from the dataset after each rendering (slow)
- pass a vertex array containing information about which point has already been marked and use a simple test in the shader like
if (marked == 1)
- After the marking process, I do a completely different rendering with visualization purposes (and not marking), with a different pair or shaders and from a different viewpoint.
If I use discard; in the marking fragment shader, I get that gl_Normal is always 0 in the rendering shader, even though I’m passing non-zero normals along the geometry.
If I manually remove the marked points from the dataset, everything works out fine.
No GL errors, no shader warnings.
Any clue would be highly appreciated!