A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
lokoyd
Gnoblar
Posts: 1 Joined: Thu Sep 30, 2010 10:51 pm
Quote
0
login to like this post
Post
by lokoyd » Thu Sep 30, 2010 11:03 pm
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
Jabberwocky
OGRE Moderator
Posts: 2819 Joined: Mon Mar 05, 2007 11:17 pm
Location: Canada
x 220
Contact:
Quote
0
login to like this post
Post
by Jabberwocky » Mon Oct 04, 2010 3:40 pm
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 51
Quote
1
login to like this post
Post
by madmarx » Mon Oct 04, 2010 6:52 pm
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
!
Best,
Pierre
Jabberwocky
OGRE Moderator
Posts: 2819 Joined: Mon Mar 05, 2007 11:17 pm
Location: Canada
x 220
Contact:
Quote
0
login to like this post
Post
by Jabberwocky » Mon Oct 04, 2010 11:11 pm
I guess that kind of works.
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:
Quote
0
login to like this post
Post
by fantasian » Tue Nov 01, 2016 5:25 pm
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
!
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)