Normal AO Specular Mapping Shader Bumpmap Problems

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
white_waluigi
Goblin
Posts: 253
Joined: Sat Sep 28, 2013 3:46 pm
x 10

Normal AO Specular Mapping Shader Bumpmap Problems

Post by white_waluigi »

I use the following shader (or material) to get per pixel lighting into my project:
http://www.ogre3d.org/tikiwiki/tiki-ind ... g%20Shader
Now the per pixel lighting works absolutely fine but with the specular maps and the normal map i am not that sure.

Specular maps give me absolutely no effect and bumpmap only work in a binary fasion, meaning, i can get a result if i only use black and white, meaing that some parts of the texture are completely dark, some are full lit.

Now could someone please test it themselfes? Just to see if this is an exclusive problem for me? i currently only have acess to one computer. It runs Linux Mint 16 64bit with a Geforce GTX 650. Just to see if its just my setup.
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 216

Re: Normal AO Specular Mapping Shader Bumpmap Problems

Post by scrawl »

Specular maps give me absolutely no effect
What do you mean? Is the specular unaffected by the specular map or do you have no specular at all? In the latter case, make sure you have correct specular colors set for both the material and your lights.

Bump mapping requires tangents, meaning, the meshes/entities you use this material on must be created with tangent information built in (OgreXMLConverter -t option, but you can also build those from code)
white_waluigi
Goblin
Posts: 253
Joined: Sat Sep 28, 2013 3:46 pm
x 10

Re: Normal AO Specular Mapping Shader Bumpmap Problems

Post by white_waluigi »

OH, okay, ill try it with tangent information, thanks.
white_waluigi
Goblin
Posts: 253
Joined: Sat Sep 28, 2013 3:46 pm
x 10

Re: Normal AO Specular Mapping Shader Bumpmap Problems

Post by white_waluigi »

Thanks a lot, it works now.
white_waluigi
Goblin
Posts: 253
Joined: Sat Sep 28, 2013 3:46 pm
x 10

Re: Normal AO Specular Mapping Shader Bumpmap Problems

Post by white_waluigi »

Just for curiosity, why do i need tangents for bumpmap?
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 216

Re: Normal AO Specular Mapping Shader Bumpmap Problems

Post by scrawl »

Because normals in a bump map are typically stored in tangent space, so to get the final object space (or world space) normal, the tangent needs to be known.

You could also do object-space normal mapping, but unlike tangent space, this would not work properly for animated meshes,
white_waluigi
Goblin
Posts: 253
Joined: Sat Sep 28, 2013 3:46 pm
x 10

Re: Normal AO Specular Mapping Shader Bumpmap Problems

Post by white_waluigi »

Ok, i got it, thanks.
Post Reply