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 / Evolved normal map shader help?

Author
Message
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 4th Apr 2010 01:20 Edited at: 4th Apr 2010 01:21
I have been attempting trying to use bump mapping on an object I am making for an RTS. This post may belong on the 3D forum, but as it involves code too I am posting here.
I have no real clue as to the best or easiest way to add bump mapping to an object so far I have tried this.
Make the object, UVW wrap and texture as I normally do.
Load the texture into the gimp and apply bump map.
Then using evolved's normal mapping example I change the code to load in my object, texture and bump texture.
Using that and the supplied normalize texture(with the demo download) it looks sort of bumpmapped, some areas are better than others, but the lighting is wrong. I think the normalize map must be changed also to get the final effect working.
I am at a loss as how to proceed at the second as I cannot even load in a dds texture to view it. Possibly I need some sort of Nvidia tool for this final step?
If anyone has any tips for this. For instance the bump mapped texture I make looks nothing like the example ones, but it certainly adds depth to the object. So if there is a better way to convert the image rather than using the bump map option, that would be handy to know.
I would sure like to know what that dds texture looks like and what I need to do to get my uvw map texture converted over.

http://s6.bitefight.org/c.php?uid=103081
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 4th Apr 2010 01:30 Edited at: 4th Apr 2010 02:01
There is a plugin somewhere to load/ save DDS files in GIMP. Not sure where to get it, but I got it months ago from somewhere. Theres somewhere linked to the main GIMP site with that sort of stuff on it

Not sure if you've found this, but there's also a normal map creator for GIMP too. I've had these for quite some time now. You have to go to the filter menu to create the normal map

I'm not sure the GIMP's bump map option is really of much to use in creating 3D bump maps.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Apr 2010 02:17 Edited at: 4th Apr 2010 02:19
Which file is a dds image? If it's the normal map or base texture just use



Then look at the image in MS Paint or whatever you normally use.

Or if you only want to look at it, load it into DBPro in the usual way and texture a plain or use paste image, etc.

If it's the normalizer image then you need something which can display cube dds maps. Nvidia's FX Composer or the Microsoft's DxTex.exe (both free) will do that. Both enable you to create your own cube maps. DxTex.exe is part of the MS DX9 SDK which is a rather big download.
Dark Goblin
20
Years of Service
User Offline
Joined: 19th May 2006
Location:
Posted: 4th Apr 2010 03:29
There is no need to change the Normalize Texture.
Also you can use any file format you want for the shader.

Take your Base Textur and put it into a folder (should be Media or something, dont know).
Than take any normal map textur (take one that fits your texture, so it looks right), and put it into the same folder.
Than go into your code and change the textures. This should work perfectly.

Now there is one thing you have to check, when creating your own objects.
The shader uses the Object Normals, so if they are not like they should, the Normal Mapping is wrong!

In you problem, I would think that you have forgotten to add the normalize texture, because this happened to me a lot of times.
Maybe upload your version with your object and I can look into it, so I can maybe fix your problem!

... efxMod Developer!
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 4th Apr 2010 21:26 Edited at: 5th Apr 2010 00:01
Thanks everyone for the ideas. I reloaded up the code earlier after reading all you said above Dark Goblin. I had done that pretty much to the letter. What do you know? Today the light source is bang on. Must have been a system issue. Although I will probably not use the lighting shader as it will probably slow my game to a crawl. But I will possibly add it as an option.
I have got the normal map plugin for the gimp and have used that. Although I'm not sure which one looks better. I imagine a proper normal map created with a high and low poly model would look way better, but is beyond my abilities and time constraints at the moment.
Now I just need a way to figure out fake shadows lol. Shaders are very slow in that area. Texture baking would be useful but can't think of a way to do it in a game where you can build anywhere you want and at different angles.
I enclose a pic of one of my tests.

http://s6.bitefight.org/c.php?uid=103081

Login to post a reply

Server time is: 2026-07-26 17:37:02
Your offset time is: 2026-07-26 17:37:02