0

I have been having a problem in pyOpenGL when placing a real-time rendered texture onto a warped mesh. The problem is that the mesh is somewhat visible as can be seen in the below image:

What renders with NVIDIA graphics card

However, this only occurs when I am using my NVIDIA graphics card (I have an NVIDIA Optimus laptop, but have tried it on PCs with NVIDIA cards with the same result). Rendering works correctly with my laptop's integrated graphics card:

What renders with Intel integrated graphics

I am unsure how to fix this and don't know whether it is a problem with OpenGL as a whole, pyOpenGL or just my program. Is anyone able to help me with this problem? It is important that the software that I am developing is not tied down to integrated graphics and my research into this problem has come up blank.

Juls0419
  • 39
  • 4
  • 2
    Most likely the integrated graphics doesn't have a feature that the NVIDIA cards have, so the integrated gfx is off, not the other way around. Could be [different opengl versions](https://www.opengl.org/discussion_boards/showthread.php/167337-OpenGL-and-graphics-card-compatibility-issues), depth buffer precision, line width, alpha channel in the texture, shader features... Do you check the results of all openGL calls? – Kenney Feb 29 '16 at 16:19
  • Your mention of alpha channels helped me find discussions of similar problems online. Although the alpha suggestions that people were giving didn't help, they did lead to me discovering that adding FSAA partially fixes my problem. The diagonals are still present on the rectangles, however, the checkerboard pattern in the background is now free from anomalies. – Juls0419 Feb 29 '16 at 17:58
  • FSAA will smooth out edges but is very slow. It's hard to say what the problem is without the code - perhaps you have a github repository for it? – Kenney Feb 29 '16 at 18:07
  • 1
    My code can be found here: https://github.com/uoscompsci/ASPECTA-Server/blob/master/src/API.py Thanks for the help! – Juls0419 Feb 29 '16 at 18:11
  • The code that may be interesting to you can be seen in renderSurfaceTex() and drawPolygon(). – Juls0419 Feb 29 '16 at 18:22
  • And also possibly createTexture(). – Juls0419 Feb 29 '16 at 18:23
  • 1
    Because the mesh is visible on white and red quads but not black, I think the NVIDIA card has found a way to mix a zero into the texture calc. I can't duplicate your setup so this is only a suggestion, but check that every texture has WRAP_S & T set to something (eg Texture.LoadTexture leaves it undefined) and also should the wrap modes be CLAMP rather than REPEAT? – Hugh Fisher Feb 29 '16 at 23:13
  • Thanks, Hugh. You make a good point about GL_CLAMP being more appropriate. I have updated that in my code, however, that didn't resolve my rendering problem. – Juls0419 Mar 01 '16 at 13:37
  • 2
    One last suggestion. You have various _SMOOTH options hinted at maximum and enabled. Could the NVIDIA card be tessellating the quads into triangles and then individually smoothing the edges? Try turning those options off, as they all went away in the GL 3 Core Profile, so may not work reliably on modern hardware. – Hugh Fisher Mar 01 '16 at 23:10
  • Thanks for the suggestion! It solves the graphical anomalies altogether, with the drawback that it is at the cost of the graphics looking much more jaggy. I will look into alternative ways to provide the smoothing, but this is fine as a temporary solution. Thanks for your help! – Juls0419 Mar 02 '16 at 08:37

0 Answers0