I've recently started programming a very, very, basic doom-like/quake-like engine using LWJGL - it's more or less a learning project. I started on OpenGL 1/2 and now I'm working with OpenGL 3/4 and I've run into a bit of an issue:
The issue, if it's not quite as obvious as I think it is, is that the edges where the triangles meet appear to wobble, depending on the angle you're looking.
These are the enables/hints I've got set:
Changing the hints and/or enables/disables appears to have no effects on the issue. If I turn off backface culling the colours on the hidden faces "creep" over the top of the top face where the edge "wobbles".
I'm sure this isn't the fragment or vertex shader because even if they just pass the position/colour through them the issue persists.
Has this issue happened to anyone else before and any clue what causes it?
I'm happy to provide any code, though it might not be completely standard java code (I'm new to java, but programmed in free pascal for a few years), I just don't know what is relevant in this case.
Just some information about what I've got:
- I have 3 matrices (Projection, Viewing and Model) and a computed normal matrix for use in lighting.
- The cube is composed of 12 triangles, all defined CCW
- The cube is rendered as GL_TRIANGLES
- This prism is a cube scaled on the X and Z by a factor of 10 (Even if unscaled, the issue persists)
- The window has an OpenGL 4.3 context (The context version seems to have no effect, though it requires a minimum context of 3.0)
Thanks for your time!