RP3 GL_LINES Problem
Posted: Sun Feb 16, 2020 7:47 pm
I have a GL_LINES that takes in a bunch of points that go from [0,0,0] to [1,0,0]. I then can call to draw that line as many times as I want passing in a few uniforms to control location on the screen (Y).
If I move the vertex inside the vertex shader with a color value from the texture going into the shader (so offsetting in the Z direction) what I am noticing is that on vertexes that are changing between frames, I am not getting the interpolation always working. It just doesn't call the frag shader (the frag shader is set to draw just vec4(1.0);
If I increase the behavior, I see like a 10x10 grid showing this strange behavior across the screen. I am using glm, so changing to either perspective or ortho, or changing the LookAt doesn't change this 10x10 grid.
I cannot for the life of me figure out what could cause this. My only guess would have been vertex caching but I cannot see a way to turn that off.
In my loop to draw each line, I call glUniform4f and glUniform4i to update followed by my glDrawArrays. Is there a problem with updating that so often?
The fact that the transforms or anything does't change this grid, makes me believe it is something GPU specific. I can also get this behavior on triangle strips that I am modifying the vertex locations
Here. the lines should all be touching, this was a straight line as described where I just modified the Z location by adding to the vertex value.
Here is a denser picture, again, each line is just from [0,0,0] to [1,0,0] where I am modifying the z value in the vertex shader (and y position). That square pattern you see, there is nothing in the math for the vertex movement that could create that. Zooming in and out, no difference, those squares stay right where they are and affect the lines that pass through those areas.
I've tried all kinds of different line widths (including 1). Blending on and off, Depth map on and off. Here all those are off. Culling is off. I clear the buffer each time.
Note this is rendered into a texture.
If anyone has ANY clue how I could resolve this, greatly appreciated.
Another interesting tidbit. This happens on the vertexes ANIMATING between frames. If I create these offsets and they are the same between frames, the rending is correct. So it's when the vertex are moving between frames that I see this problem occur.
If I move the vertex inside the vertex shader with a color value from the texture going into the shader (so offsetting in the Z direction) what I am noticing is that on vertexes that are changing between frames, I am not getting the interpolation always working. It just doesn't call the frag shader (the frag shader is set to draw just vec4(1.0);
If I increase the behavior, I see like a 10x10 grid showing this strange behavior across the screen. I am using glm, so changing to either perspective or ortho, or changing the LookAt doesn't change this 10x10 grid.
I cannot for the life of me figure out what could cause this. My only guess would have been vertex caching but I cannot see a way to turn that off.
In my loop to draw each line, I call glUniform4f and glUniform4i to update followed by my glDrawArrays. Is there a problem with updating that so often?
The fact that the transforms or anything does't change this grid, makes me believe it is something GPU specific. I can also get this behavior on triangle strips that I am modifying the vertex locations
Here. the lines should all be touching, this was a straight line as described where I just modified the Z location by adding to the vertex value.
Here is a denser picture, again, each line is just from [0,0,0] to [1,0,0] where I am modifying the z value in the vertex shader (and y position). That square pattern you see, there is nothing in the math for the vertex movement that could create that. Zooming in and out, no difference, those squares stay right where they are and affect the lines that pass through those areas.
I've tried all kinds of different line widths (including 1). Blending on and off, Depth map on and off. Here all those are off. Culling is off. I clear the buffer each time.
Note this is rendered into a texture.
If anyone has ANY clue how I could resolve this, greatly appreciated.
Another interesting tidbit. This happens on the vertexes ANIMATING between frames. If I create these offsets and they are the same between frames, the rending is correct. So it's when the vertex are moving between frames that I see this problem occur.