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 / Relief Mapping problem...

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Jul 2010 17:52
OK, so this is the first time in my life I have used a shader. With that said, here is my problem:

First of all, I was not able to get my textures working with the shader in the example files from evolved. All I did is replace one of the texture files with my texture files, but it didn't achieve the effect I wanted. Here are the two texture files I used:




One is the usual texture, and the other is a normal map texture created with gimp.

The example from evolved is attached to this post. I added those two textures above into the example, but it's not doing what I want. Any suggestions?

Then comes the problem with integrating it into my game... This is pretty much the way I load the level. I tried adding it in already, but it doesn't do anything either... Any help greatly appreciated ^^



TheComet

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 24th Jul 2010 18:08
Try using these.

I've had that same problem before.... I don't remember what I did to fix it. What format are your textures? (I don't have winzip)

The fastest code is the code never written.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Jul 2010 18:22
Hi

I tested your textures, and they also don't seem to do what they should...

This is what yours looked like:

http://i254.photobucket.com/albums/hh100/TheComet92/mud.jpg

And this is what it should look like:

http://i254.photobucket.com/albums/hh100/TheComet92/shouldlooklikethis.jpg

I attached a zip version on this post so you can open it to

TheComet

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 24th Jul 2010 19:09 Edited at: 24th Jul 2010 19:18
Ahhh. I've not used releif maping before.... Let me look at the code you are using. I will also test the Evolved example on mine and see what the difference is between normal maping and releif maping.
EDIT:
Are you sure you are using the correct .fx? I got the same result by using Normal Maping.....

The fastest code is the code never written.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Jul 2010 21:09
Quote: "Are you sure you are using the correct .fx? I got the same result by using Normal Maping....."


So you are saying the result you got from normal mapping is the same as relief mapping? Are you sure you zoomed right down to the floor just as I did in the screenshots? That's where you'll notice the difference. If not, then I don't know what's happening... I'm sure I'm using the correct .fx ...

TheComet

The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 24th Jul 2010 21:39
Quote: "The example from evolved is attached to this post. I added those two textures above into the example, but it's not doing what I want. Any suggestions?"

Well, if you would look at the normalmap textures that Evolved used, then you'll notice that he uses another method to achieve those deep reliefs. While your normalmap is opaque, Evolveds' textures have transparency. I could be wrong, though.

Cheers

Slayer rules!!! Yeaaah, man!
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 24th Jul 2010 22:48
Here's a screenshot.... The floor is done as a normal map and the cube is the releif maping.

The fastest code is the code never written.
Demon000
18
Years of Service
User Offline
Joined: 21st Aug 2007
Location:
Posted: 25th Jul 2010 01:51
I've tested this shader sometime ago. I think you need transparency in the image as The Slayer said and I think the transparency value the image should have depends on the depth of each pixel.

I'm not 100% sure, but after analizing the transparency levels of the demo images that's the conclusion I reached. It seemed to work fine once I made my image that way.
Math89
22
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 25th Jul 2010 15:47
Your problem is that you need to put the bump map in the alpha (opacity) channel of the normal map. At the moment, the shader behaves exactly like a normal mapping shader because the bump is set to 1 (or 0) for the whole image, which hides the effect of the displacement.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Jul 2010 20:54
Quote: "Your problem is that you need to put the bump map in the alpha (opacity) channel of the normal map."


Oh, ok... Sounds simple... Erm, how do I do that?

TheComet

Math89
22
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 26th Jul 2010 01:03
You need an image editing program such as photoshop or gimp. There must be a tool somewhere allowing you to draw on the alpha channel. All you need to do is to copy the bump map in there.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Jul 2010 01:18
I use Texture Maker or DXTex.exe for that sort of thing. You might be able to use native DBPro bitmap commands as well.

Login to post a reply

Server time is: 2026-07-25 13:35:16
Your offset time is: 2026-07-25 13:35:16