Shading different on ATI / NVIDIA cards

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
mrdoubleb
Posts: 9
Joined: Tue Apr 12, 2011 1:10 pm

Shading different on ATI / NVIDIA cards

Post by mrdoubleb »

Hi we just added a light to our scene for shaders. Now we noticed it looks good on all ATI cards but somehow on NVIDIA cards its working not that good. I already search for a bit but couldnt find anything.

Nvidia:
Image

Ati:
Image

Notice the different shadow on the front and at the front small weapon and the top hatch.

And yes we have tried on several pc's.

Also when u turn the tank the shading with ATI is nice diffuse but on NVIDIA the shadings are ON/OFF

Someone know if this is a issue? or else how to fix this?
Last edited by mrdoubleb on Wed Apr 13, 2011 4:57 pm, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Looks like your normals are not normalized. Did you set the material flag NORMALIZE_NORMALS when scaling meshes? Some cards cope quite good with non-normalized normals, but others don't.
mrdoubleb
Posts: 9
Joined: Tue Apr 12, 2011 1:10 pm

Post by mrdoubleb »

hybrid wrote:Looks like your normals are not normalized. Did you set the material flag NORMALIZE_NORMALS when scaling meshes? Some cards cope quite good with non-normalized normals, but others don't.
Yes those are set after scaling... so thats not the problem i think?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, so are the bright areas textures with a different texture? Could be a wrong texture size or wrapping mode which is unsupported by the driver.
mrdoubleb
Posts: 9
Joined: Tue Apr 12, 2011 1:10 pm

Post by mrdoubleb »

hybrid wrote:Ok, so are the bright areas textures with a different texture? Could be a wrong texture size or wrapping mode which is unsupported by the driver.
there are 3 textures:

the barrel
turret
tankbase

they are all the same texture they are applied in maya. And are loaded via the .mtl file exported by maya. The objects are loaded as .obj files exported by maya.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ah, .obj materials support bump mapping (parallax/normal maps), which could also cause some problems. Can you upload at least the material file? Also, make sure that the sizes of the textures are power-of-two. Although, usually ATI has more problems with NPOT textures.
Erelas
Competition winner
Posts: 20
Joined: Mon Apr 18, 2011 8:40 am

Post by Erelas »

Hi there, I'm in the OP's team.

The problem we are facing is not the difference in brightness on top of the tank turret, those parts don't have a texture assigned to it yet, but a lambert material type I think (.mtl file says illum instead?), with some different colors.

The actual problem is that diffuse lighting is different on the cards:

Image

Here are the contents of our .mtl file:

Code: Select all

newmtl surfaceShader1SG
illum 4
Kd 0.00 0.00 0.00
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
map_Kd ../textures/camo.jpg
Ni 1.00
newmtl surfaceShader2SG
illum 4
Kd 0.11 0.11 0.11
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
Ni 1.00
newmtl surfaceShader3SG
illum 4
Kd 0.00 0.00 0.00
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
Ni 1.00
Our camo texture actually was NPOT (500*500), that wasn't the cause though.

Thanks for helping so far.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

This could be a problem with the color material setting. Try to alter the setting to ECM_NONE or ECM_AMBIENT to avoid getting to bright diffuse colors. But it looks more like a problem with normal handling, still. Check the barrel, the facetted look on ATI shows an approximated, but working normal. The NVidia version is completely lacking any separation of the faces.
LizardGamer
Posts: 83
Joined: Fri May 28, 2010 8:59 am
Location: Perth, Australia

Post by LizardGamer »

Are the video drivers updated?
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

LizardGamer wrote:Are the video drivers updated?
:P checking that usually fixes these related problems for me 9/10 times.

gotta stay on top of those driver updates! 8)
ent1ty wrote: success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
at a cost measure in computer resources ;)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I think I didn't suggest to check the driver settings so far. Make sure that you don't have some user defined settings for 'maximal speed' or something like that. Otherwise, some settings from Irrlicht could be overridden by the driver.
Erelas
Competition winner
Posts: 20
Joined: Mon Apr 18, 2011 8:40 am

Post by Erelas »

We fixed the problem, it actually was the light radius of the light node in our scene that was too high (We tried to simulate the sun).
Bit weird that this is handled differently on ati and nvidia.

Now shading is pretty much identical on both cards, so case closed. Thanks for the help!
Post Reply