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.

DarkBASIC Professional Discussion / Real Time Normal Mapping

Author
Message
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Jul 2013 14:45
In my Greyhound Racing game I want the dogs feet to make indentations in the sand. I thought that I might be able to paste normal map sprites on a texture screen, and then grab the screen. Then the feet will make Normal Map indents. Is that possible? Or are Normal Map pre-calculated, and too slow to calculate on the fly?

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 3rd Jul 2013 14:56
Quote: "Is that possible?"


Yes.

Quote: "Or are Normal Map pre-calculated, and too slow to calculate on the fly?"


It should be fast enough to do in real time because you only need to modify a small part of the normal map each sync.

I'm not sure off-hand of the best way of implementing this but, yes, it can definitely be done.
ShellfishGames
13
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 3rd Jul 2013 15:03
I'm certainly not an expert on shaders and 3D stuff in general, but I think if everything else fails you could still use decals (instead of manipulating existing textures on the fly). Unless you want the indents to stay there the whole time, that is. In that case you'd need a lot of decals and increase your polycount quite a bit over time.

But if, on the other hand, you make your texture a render target so that you can paste sprites directly onto it, it should work as well. Pretty straight forward I guess. At least I don't see a problem with this method.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 3rd Jul 2013 15:13
Just dug out an old demo of mine. There might be better ways of doing this.

Just press "m" to get normal mapped craters.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Jul 2013 15:36
That's great thanks!

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Jul 2013 15:38
Hi there
Good example GG. but what about when we scale object texture ?? ... what about somethink like this:

http://forum.thegamecreators.com/?m=forum_view&t=163098&b=11

Adding of course bumpmapping to the trail...

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 3rd Jul 2013 20:43
Nice demo chafari.

As a quick experiment I changed this



to this

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Jul 2013 21:27
If you want me to upload the Greyhound track I will do it. It's a huge plain with a huge texture.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Jul 2013 02:31
@Green Gandalf Thanks. this was an old example I made time ago for a 20 lines and never ended. Perhaps with your change looks better...I add disable object zread and goes ok as well .

I'm not a grumpy grandpa

Login to post a reply

Server time is: 2026-07-07 04:31:54
Your offset time is: 2026-07-07 04:31:54