Rendering artifacts on Intel HD 4000 OpenGL

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
unlinked
Posts: 3
Joined: Fri Jan 22, 2016 7:00 pm

Rendering artifacts on Intel HD 4000 OpenGL

Post by unlinked »

Hi there,

I wonder if anyone could point me in the right direction in tracking down a rendering issue which seems to occur on Intel integrated hardware but not on discrete graphics cards. I'm a total newbie, so it's probably something really obvious.

I'm setting up a scene containing a number of nodes which all reference the same texture but one of them renders with black lines across the texture which get worse the further away from the camera the node is and change orientation and thickness as I move the camera. The problem occurs more widely if I'm using lights in the scene, but even with lighting disabled, certain nodes render badly.

Image
http://www.dropbox.com/s/jymgrb9nnr5fdk ... tches.tiff

If I use the BURNINGSVIDEO renderer it looks fine but under OpenGL on both Windows and OSX I get these same artifacts. The code is pretty trivial and is set up (roughly) thus:

Code: Select all

auto normalTexture = driver->getTexture(texturePath);
scene::IAnimatedMesh* mesh = sceneManager->getMesh(meshPath);
auto node = sceneManager->addAnimatedMeshSceneNode(mesh);
node->setMaterialFlag(video::EMF_LIGHTING, false);
node->setMaterialTexture(0, normalTexture);
 
auto camera = m_sceneManager->addCameraSceneNode(0, core::vector3df(200.f, -300.f, 200.f), core::vector3df(0, 0, 0));
auto upVector = camera->getUpVector();
camera->setUpVector(core::vector3df(0.f, 0.f, 1.f));
camera->setFarValue(1000.f);
camera->setNearValue(1.f);
Can anyone offer any suggestions as to where I should look? Thanks!

Steve.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Rendering artifacts on Intel HD 4000 OpenGL

Post by hendu »

Looks like Z-fighting. Use at least 24 bits of depth in your createDeviceEx call, or use smaller far value/larger near value.
unlinked
Posts: 3
Joined: Fri Jan 22, 2016 7:00 pm

Re: Rendering artifacts on Intel HD 4000 OpenGL

Post by unlinked »

Thanks Hendu, that was spot on - increasing the bit depth for the z-buffer fixed the problem immediately. I'd encountered Z-fighting before but only when two meshes overlapped, didn't realise it could affect a single textured mesh like this.

Once again thanks very much!

Steve.
Post Reply