Normal maps in Ogre?

Advanced game related topics
Blobby
User
User
Posts: 17
Joined: Tue Mar 03, 2009 2:30 pm

Normal maps in Ogre?

Post by Blobby »

Has anybody managed to display a normal mapped model in Ogre?
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

What is a "normal mapped model"? You mean the vertex normals by any chance?
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
DarkDragon
Addict
Addict
Posts: 2228
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Here is an example with HLSL:

http://www.bradan.eu/files/ogre_normalmapping.zip

Image

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.
bye,
Daniel
Blobby
User
User
Posts: 17
Joined: Tue Mar 03, 2009 2:30 pm

Post 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?.
DarkDragon
Addict
Addict
Posts: 2228
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post 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:
Image Image

Here with a different texture.png:
Image
bye,
Daniel
Blobby
User
User
Posts: 17
Joined: Tue Mar 03, 2009 2:30 pm

Post 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. ;)
DarkDragon
Addict
Addict
Posts: 2228
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post 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.
bye,
Daniel
Blobby
User
User
Posts: 17
Joined: Tue Mar 03, 2009 2:30 pm

Post 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! :)
DarkDragon
Addict
Addict
Posts: 2228
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

I've updated it (there was a warning, that a uniform variable is missing). Same link, clear your cache maybe.
bye,
Daniel
Blobby
User
User
Posts: 17
Joined: Tue Mar 03, 2009 2:30 pm

Post by Blobby »

Splendid!
User avatar
max_aigneraigner@web.de
User
User
Posts: 67
Joined: Sun Nov 02, 2008 10:37 pm
Location: Bavaria
Contact:

Post 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?)
DarkDragon
Addict
Addict
Posts: 2228
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post 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.
bye,
Daniel
Blobby
User
User
Posts: 17
Joined: Tue Mar 03, 2009 2:30 pm

Post 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.
Blobby
User
User
Posts: 17
Joined: Tue Mar 03, 2009 2:30 pm

Post 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.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Blobby wrote:There's no examples on the forum at all.
:cry: http://www.purebasic.fr/english/viewtop ... ht=shaders
Post Reply