Normal Mapping

Everything related to 3D programming
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Normal Mapping

Post by Samuel »

Hello everyone,

I've been getting a few requests lately for a Normal Mapping example. So, I figured it's about time I posted one. It's one of them from Ogre's shader cookbook.
Here's a little picture for comparison.
Image

:shock: Notice the muscles and clothing have a lot better detail.
Most PS3 and Xbox 360 games lived off of Normal mapping.
In fact without it that generation of games wouldn't have looked all that different from the previous generation.
Well, obviously they would have looked a bit different. I'm just saying Normal Mapping played a very important part graphically.

So, here's the download for anyone interested.
Normal Mapping.zip

When I get more energy I'll try to post all the code here on the forums, but for now I need a little timeout.
So, you'll have to get the code from my download for the time being. :P

Enjoy and don't hesitate to ask if you have any questions.
User avatar
DK_PETER
Addict
Addict
Posts: 904
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: Normal Mapping

Post by DK_PETER »

Yeah, it looks really good.
Very nice example.
Thank you for sharing, Samuel.
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
User avatar
AndyLy
Enthusiast
Enthusiast
Posts: 228
Joined: Tue Jan 04, 2011 11:50 am
Location: GRI

Re: Normal Mapping

Post by AndyLy »

I have not had much time to test, but this material works well (in my game).
I wrote to you about the problems with the lights, whith "old materials", with new one everything is fine.
Later will test better, but I hope everything will be fine.
I do not know how you did it, but thanks for your voodoo. :)
'Happiness for everybody, free, and no one will go away unsatisfied!'
SMsF town: http://www.youtube.com/watch?v=g6RRKYf_Pd0
SMf locations module (Ogre). Game video: http://www.youtube.com/watch?v=ZlhBgPJhAxI
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: Normal Mapping

Post by Bananenfreak »

Hey Samuel,
I will also try your code in my Project. Thank you for sharing it with us :)
Image
User avatar
AndyLy
Enthusiast
Enthusiast
Posts: 228
Joined: Tue Jan 04, 2011 11:50 am
Location: GRI

Re: Normal Mapping

Post by AndyLy »

ImageImage
ImageImage
ImageImage
'Happiness for everybody, free, and no one will go away unsatisfied!'
SMsF town: http://www.youtube.com/watch?v=g6RRKYf_Pd0
SMf locations module (Ogre). Game video: http://www.youtube.com/watch?v=ZlhBgPJhAxI
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Normal Mapping

Post by Samuel »

Nice pictures, AndyLy. Are they just for comparison or is there something wrong that I'm not noticing?
User avatar
AndyLy
Enthusiast
Enthusiast
Posts: 228
Joined: Tue Jan 04, 2011 11:50 am
Location: GRI

Re: Normal Mapping

Post by AndyLy »

Just for comparison. If something goes wrong, I'll let you know immediately. :)

P.s. There is one problem with fog. Objects become white.
I marked objects without normal maping. They normally displayed in the fog. ( Fog(RGB(50,50,50),1,40,160) )

Image
'Happiness for everybody, free, and no one will go away unsatisfied!'
SMsF town: http://www.youtube.com/watch?v=g6RRKYf_Pd0
SMf locations module (Ogre). Game video: http://www.youtube.com/watch?v=ZlhBgPJhAxI
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: Normal Mapping

Post by Bananenfreak »

Samuel, why your Normalmapping Needs a specularmap? Those Normalmappingthings I know don´t Need specularmaps...
Image
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Normal Mapping

Post by Samuel »

@AndyLy
I'll experiment a bit with the fog and try to find out what's wrong.

@Bananenfreak
You could technically go without the specular map, but it can be useful at times. You may already know this, but a specular map allows one to specify which portions
of a texture will receive specular lighting. For example we could edit the sinbad_bodySpec.png to be completely black expect the circle for the eyes which would be white.
Now when specular lighting is enabled only the eyes will receive specular lighting. Which would be more realistic looking.
If you don't need specular lighting then you can just use a solid black specmap.
Post Reply