Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Normal Mapping !

Author
Message
maicl
17
Years of Service
User Offline
Joined: 19th Jun 2007
Location:
Posted: 14th Jul 2010 22:21 Edited at: 14th Jul 2010 22:25
Hi,

I Have this model :



and this map :



Now how can I Apply the normal map effect to my model ?!
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 15th Jul 2010 18:09
Use SET BUMP MAPPING ON Object Number, Image Number.

So many games to code.......so little time.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 16th Jul 2010 17:01
Or get a Normal Mapping shader (there are a bunch of them in here)

Ultimate Shader Pack: http://forum.thegamecreators.com/?m=forum_view&t=79849&b=8

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Jul 2010 19:49 Edited at: 17th Jul 2010 01:29


or use a shader.

zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 16th Jul 2010 23:16 Edited at: 17th Jul 2010 00:40
Sorry to hijack, but what are the benefits of using a shader over set blend mapping on? I have had issues with light placement inside of shaders, and this seems like it could be a decent easy solution.

I use the shader inside of the Ultimate Shader Pack and it seems that everything looks great... unless I want to rotate the model. If I do rotate it, the model stays lit up and shaded in the same spots as if it never rotated. I drew an awesome picture to show what I mean (). Any help would be great.


Also: say I had two pictures
"regular texture.png",1
"Normal map.png",2

Would I use blend mapping like this:?

set blend mapping on 1, 0, 1, 0, 1
set blend mapping on 1, 1, 2, 0, 24

I don't understand the D3D parameters for the "Blend Mode"
(edit: sorry, I may get the answer myself when I get home. I'm at the office right now and can't really test it. )
Thanks for any help, and again, sorry to hijack.

My green thumb grew the tree my Trojan War horse was crafted from. With roses in our pockets we rally round the tombstones. Ashes to ashes, we all fall down.

Attachments

Login to view attachments
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Jul 2010 01:28
To add a diffuse texture to that same object you would

set blend mapping on 1, 0, 1, 3, 24
set blend mapping on 1, 1, 2, 3, 7

The first number is the Object number
The second is the texture stage (0-7)
The third number is the image number
The fourth is the UV stage (i've always left this at 3)
The fifth number is the D3D Blend Mode

I haven't explored all of the possibilities of the set blend mapping on command, but I've played with it extensively and found out quite a bit.

1. It's slower than a shader
2. Blend mode 24 handles normal maps quite well
3. Blend mode 7 ADDS the image to the current texture
4. Blend mode 4 MULTIPLIES the image to the current texture

I could go on and on, but those are the basics to texture something with a normal map and diffuse texture.

As for shader lighting, I have never seen that issue with the shadow not being updated. When you are using shaders, the shader should know the position of the light, and recalculate how the light hits the object each sync.

zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 17th Jul 2010 20:55 Edited at: 17th Jul 2010 20:55
Quote: "As for shader lighting, I have never seen that issue with the shadow not being updated. When you are using shaders, the shader should know the position of the light, and recalculate how the light hits the object each sync."

I'm not sure why it does it, but I think I will scrap the shader idea for now. The set blend mapping on should work pretty well with what I am doing and I don't see to much of a performance drain from it.

Thank you for the in-depth answer, KISTech. This should be extremely helpful for my project!

My green thumb grew the tree my Trojan War horse was crafted from. With roses in our pockets we rally round the tombstones. Ashes to ashes, we all fall down.

Login to post a reply

Server time is: 2024-09-28 20:20:59
Your offset time is: 2024-09-28 20:20:59