Page 1 of 1

Specular map in material

Posted: Thu Sep 30, 2010 11:03 pm
by lokoyd
Hello !
By advance, sorry for my bad english ^^
I export meshs from blender to ogre and I would like to know how to use a specular map (png) in a ogre material. Some one could help me please ?

Thanks :)

Re: Specular map in material

Posted: Mon Oct 04, 2010 3:40 pm
by Jabberwocky
Regular materials don't support specular maps. You'll need to use a shader. There are some shaders that come with Ogre that you might want to learn about.

Re: Specular map in material

Posted: Mon Oct 04, 2010 6:52 pm
by madmarx
C'mon, don't be so extrem!

The good the solution is shaders.

The bad solution that works is to simply use 2 passes.

Code: Select all

pass
{
    diffuse 1 1 1 1
    specular 1 1 1 1
    texture_unit
    {
           texture diffuseMap.png
    }
}
pass specularPass
{
    diffuse 0 0 0 0
    emissive 0 0 0 0
    specular 1 1 1 1 64
    ambiant 0 0 0 0
    texture_unit
    {
           texture mySpecularmap.png
    }
    scene_blend add
}
And that's all folks :D !

Best,
Pierre

Re: Specular map in material

Posted: Mon Oct 04, 2010 11:11 pm
by Jabberwocky
I guess that kind of works. :P
It's just unusual to use a specular map without also using a normal map.

Re: Specular map in material

Posted: Tue Nov 01, 2016 5:25 pm
by fantasian
madmarx wrote:C'mon, don't be so extrem!

The good the solution is shaders.

The bad solution that works is to simply use 2 passes.

Code: Select all

pass
{
    diffuse 1 1 1 1
    specular 1 1 1 1
    texture_unit
    {
           texture diffuseMap.png
    }
}
pass specularPass
{
    diffuse 0 0 0 0
    emissive 0 0 0 0
    specular 1 1 1 1 64
    ambiant 0 0 0 0
    texture_unit
    {
           texture mySpecularmap.png
    }
    scene_blend add
}
And that's all folks :D !

Best,
Pierre
This doesn't work, cause specular is applied on top of the texture, disregarding fully the actual texture.
This SHOULD work:
texture_unit
{
colour_op_ex modulate src_specular src_texture
texture crystal-shard_spec.png
}
but not here (Ogre 1.6)