I created my own OpenGL 3D renderer application. If I run my application in Windows I do not have any visual artifacts.
But in Linux(Debian12) when I run my application selected GPU information is below. These are the return values of glGetString(GL_RENDERER)
and glGetString(GL_VERSION)
.
GPU: Mesa Intel(R) UHD Graphics 620 (KBL GT2)
OpenGL Version: 4.6 (Core Profile) Mesa 22.3.6
I got these strange visual artifacts in the image below:
But If I run my application with the environment values below there is no any artifact:
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia ./my_renderer
And the selected GPU information:
GPU: NVIDIA GeForce 940MX/PCIe/SSE2
OpenGL Version: 3.3.0 NVIDIA 535.183.01
Screenshot without artifacts:
I am using a full blue colored jpg file as diffuse texture and full white colored jpg file as specular texture.
Material file of the monkey model:
# Blender MTL File: 'None'
# Material Count: 1
newmtl None
Ns 500
Ka 0.8 0.8 0.8
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2
map_Kd blue.jpg
map_Ks white.jpg
My OpenGL initials are below:
glClearColor(0.7f, 0.7f, 0.7f, 1.0f);
glViewport(0, 0, 1280, 720);
glEnable(GL_FRAMEBUFFER_SRGB);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glFrontFace(GL_CCW);
What could be the reason of this error while using Mesa OpenGL libraries? Should I try to fix this? If I should fix this, how can I fix this error while using Mesa OpenGL libraries?