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
Specular map in material
- Jabberwocky
- OGRE Moderator
- Posts: 2819
- Joined: Mon Mar 05, 2007 11:17 pm
- Location: Canada
- x 218
- Contact:
Re: Specular map in material
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.
- madmarx
- OGRE Expert User
- Posts: 1671
- Joined: Mon Jan 21, 2008 10:26 pm
- x 50
Re: Specular map in material
C'mon, don't be so extrem!
The good the solution is shaders.
The bad solution that works is to simply use 2 passes.
And that's all folks !
Best,
Pierre
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
}
Best,
Pierre
Tutorials + Ogre searchable API + more for Ogre1.7 : http://sourceforge.net/projects/so3dtools/
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0
- Jabberwocky
- OGRE Moderator
- Posts: 2819
- Joined: Mon Mar 05, 2007 11:17 pm
- Location: Canada
- x 218
- Contact:
Re: Specular map in material
I guess that kind of works.
It's just unusual to use a specular map without also using a normal map.
It's just unusual to use a specular map without also using a normal map.
- fantasian
- Halfling
- Posts: 81
- Joined: Fri May 29, 2009 8:47 am
- Location: Selanic, Greece
- x 2
- Contact:
Re: Specular map in material
This doesn't work, cause specular is applied on top of the texture, disregarding fully the actual texture.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.And that's all folks !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 }
Best,
Pierre
This SHOULD work:
texture_unit
{
colour_op_ex modulate src_specular src_texture
texture crystal-shard_spec.png
}
but not here (Ogre 1.6)