Page 1 of 2
Normal maps in Ogre?
Posted: Fri Apr 03, 2009 4:39 pm
by Blobby
Has anybody managed to display a normal mapped model in Ogre?
Posted: Fri Apr 03, 2009 4:45 pm
by Fluid Byte
What is a "normal mapped model"? You mean the vertex normals by any chance?
Posted: Fri Apr 03, 2009 7:09 pm
by DarkDragon
Here is an example with HLSL:
http://www.bradan.eu/files/ogre_normalmapping.zip
On Linux you need to use GLSL. But porting it is easy. Maybe you'll see some kind of borders like on a football. That's because of the original mesh, not the normal mapping.
Fluid Byte wrote:What is a "normal mapped model"? You mean the vertex normals by any chance?
Normalmapping is like Bumpmapping.
You specify the normal per texel beside the normals per vertex.
Posted: Sat Apr 04, 2009 7:17 am
by Blobby
woah! Awesome example, Daniel!
I find normal mapping without specular highlights only really stands out if an object or lightsource is moving around. So it's a wasted effect on things like walls with stationary lighting.
Whereas stationary specular objects tend to look 3D regardless, this will be because the specular highlights shift across the surface as the camera position changes.
So if I wanted specular highlights then would I need to edit the shader file for that?.
Posted: Sat Apr 04, 2009 8:57 am
by DarkDragon
Well there are already specular highlights.
I've updated it now specifies the specular color in the pb source and the shininess within the material script.
Same link:
http://www.bradan.eu/files/ogre_normalmapping.zip
(You may clear your cache before)
Here is the difference:
Here with a different texture.png:

Posted: Sat Apr 04, 2009 12:44 pm
by Blobby
Oh that's just blooming perfect!.
BTW - You should get a paypal address listed at the bottom of your posts. Or maybe on your website.

Posted: Sat Apr 04, 2009 12:56 pm
by DarkDragon
Blobby wrote:Oh that's just blooming perfect!.
Thanks.
Blobby wrote:BTW - You should get a paypal address listed at the bottom of your posts. Or maybe on your website.

Hehe, yes I should really consider this.
Posted: Sat Apr 04, 2009 1:12 pm
by Blobby
yes, you should! People like to have some way to show their appreciation!
Oh, and with your example I found a cool optical illusion!. If you stare at the model spinning around for a minute or two and then press your mouse on the titlebar - the application will freeze, yet you'll notice the monkey *appears* to spin very slowly in the opposite direction.
It's groovey!

Posted: Sat Apr 04, 2009 3:30 pm
by DarkDragon
I've updated it (there was a warning, that a uniform variable is missing). Same link, clear your cache maybe.
Posted: Sat Apr 04, 2009 5:36 pm
by Blobby
Splendid!
Posted: Wed Apr 08, 2009 9:12 pm
by max_aigneraigner@web.de
O_o GREAT!
I didn't know that shader effects are possible in the pb-ogre o_O...
wow. you've got it ^^

(are you currently working on a projekt with ogre?)
Posted: Thu Apr 09, 2009 8:42 am
by DarkDragon
max_aigneraigner@web.de wrote:O_o GREAT!
I didn't know that shader effects are possible in the pb-ogre o_O...
wow. you've got it ^^

(are you currently working on a projekt with ogre?)
Maybe

. But I have no time, so I'm not working on anything officially.
Posted: Thu Apr 09, 2009 9:54 pm
by Blobby
Hey Daniel,
Can I ask which tool you use to generate your material files and shaders?.
I do plan to try all the Ogre tools, but if you've done that already and you can recommend a few then it'd save us all a ton of time.
Posted: Thu Apr 09, 2009 10:03 pm
by Blobby
max_aigneraigner@web.de wrote:O_o GREAT!
I didn't know that shader effects are possible in the pb-ogre o_O...
wow. you've got it ^^

(are you currently working on a projekt with ogre?)
Yes, I imagine a lot of people don't realize this. There's no examples on the forum at all.
It's no wonder so many people are turning their back on Ogre and using other engines. Maybe Fred needs to highlight the advanced abilities of Ogre with Purebasic.
Posted: Thu Apr 09, 2009 11:20 pm
by djes
Blobby wrote:There's no examples on the forum at all.
http://www.purebasic.fr/english/viewtop ... ht=shaders