Normal AO Specular Mapp Shader does not map normals correctl

Problems building or running the engine, queries about how to use features etc.
Post Reply
jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm
x 10

Normal AO Specular Mapp Shader does not map normals correctl

Post by jonim8or »

I'm having a small problem with the Normal AO Specular Mapping Shader of the wiki.
The contribution of my normal map to the normals is hardly noticeable. In Blender some of the faces have flipped (wrong) normals, these have been baked to the normal map too. Only the effect of these (inverted) parts of the normal map can be seen.
This is the normal map I use:
The used normal map.
The used normal map.
40ftgeneratedNormals.png (24.6 KiB) Viewed 489 times
Here the effect of the inverted normals can be seen, but there is no effect of the "normal" normals
result of using the normal map
result of using the normal map
wrongnormal.png (12.73 KiB) Viewed 489 times
With the rockywall example from the materials, the normals also don't show up.

The scene is lighted with 1 directional light.
The other maps (specular, ambient) work ok with this shader, it's just that it doesn't understand the normals.
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Re: Normal AO Specular Mapp Shader does not map normals correctl

Post by nullsquared »

Well I wrote that shader and I can guarentee you the normal mapping works because I tested it myself :mrgreen: Does your mesh have proper normals and tangents? Normal mapping needs both. Also, are you sure the normal map is actually applying? Perhaps you're not specifying the name of the normal map correctly.
jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm
x 10

Re: Normal AO Specular Mapp Shader does not map normals correctl

Post by jonim8or »

Does your mesh have proper normals and tangents?
Ah, I forgot to convert using the -t flag (or select "tangent" in blender mesh exporter options)
Thanks for the shaders!

Is it also to modify the texture unit parameters? (like scroll, filtering, etc.)
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Re: Normal AO Specular Mapp Shader does not map normals correctl

Post by nullsquared »

jonim8or wrote:
Does your mesh have proper normals and tangents?
Is it also to modify the texture unit parameters? (like scroll, filtering, etc.)
Scrolling and other animations are fixed-function based, so you'd have to implement them in the shader. Filtering, however, will still work properly, and so will animated textures.
User avatar
icaro56
Greenskin
Posts: 105
Joined: Sun Feb 15, 2009 2:03 am
Location: Belo Horizonte, MG, BRA
x 1

Re: Normal AO Specular Mapp Shader does not map normals corr

Post by icaro56 »

This shader don't works in ninja.mesh. Why?

Code: Select all

Entity *ent3 = mSceneMgr->createEntity("Ninja3", "ninja.mesh");
	
nodeNinja3 = mSceneMgr->getRootSceneNode()->createChildSceneNode("NinjaNode3");
nodeNinja3->attachObject(ent3);
nodeNinja3->yaw(Degree(180));
nodeNinja3->translate(-80,0,0);
ent3->getMesh()->buildTangentVectors(Ogre::VES_TANGENT);

ent3->setMaterialName("ogreninja");


material

Code: Select all

material ogreninja : base_material
{
    set_texture_alias diffuseMap nskingr.jpg
    set_texture_alias specMap nskingr.jpg
    set_texture_alias normalMap nskingr_NRM.jpg
}
I generate the tangent. Nullsquared, please, could you help me?
Ícaro Motta
Post Reply