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.

Bug Reports / Bump Mapping shows ugly white bits

Author
Message
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 28th Mar 2006 19:16
Turning on bump mapping with the SET BUMP MAPPING ON command produces ugly white artifacts.

Here is the code I used (the media is attached - in a folder with the source code)


An image to show what I mean.



Attachments

Login to view attachments
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 28th Mar 2006 19:23 Edited at: 28th Mar 2006 19:23
The Images I had in the download above were 1024 x 1024 and it was almost 5Mb. So here they are 256x256, it shouldn't affect the result but it will save you downloading






SCI_CO
20
Years of Service
User Offline
Joined: 20th Apr 2004
Location: USA
Posted: 28th Mar 2006 20:00 Edited at: 28th Mar 2006 20:07
I had the some prob.

You need to use a normal map for bump mapping not the black and white image you have there.

The normal map has three colors red,green and blue.
A easy why to make a normal map is to create a height map
with a terain and the B,W image you have and set up three lights
red,green and blue.

blue light on top
red light at north
green light at west

oops

Then save a image from the blue lights position
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 28th Mar 2006 21:12
but then wouldnt that be normal mapping and therefore require the command SET NORMAL MAPPING ON?


SCI_CO
20
Years of Service
User Offline
Joined: 20th Apr 2004
Location: USA
Posted: 28th Mar 2006 21:16
All I know is the noraml map works and the B,W map dosn`t.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 28th Mar 2006 21:18
Good to know, thanks.

Perhaps then the help file should be updated to reflect this.


coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 28th Mar 2006 21:19
I've attached a height to normal map generator that I found in the ultimate shader thread 2. Just put your height map in the directory and
rename it to bump.bmp. Then run the bump to normal.bat file. It will output the file "normal.bmp". Use that for the bumpmapping.

Attachments

Login to view attachments
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 28th Mar 2006 21:20
Oh, and you'll need to edit the .bat file to goto the directory where the .bat file is stored.

Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 28th Mar 2006 21:49 Edited at: 28th Mar 2006 21:50
Thanks for the generator:

Unfortunately I Still get white artifacts ... not as bad this time but still there. Also now the texture has lost a lot of quality.

Here is the normal map:


And this is the result of SET BUMP MAPPING ON with the normal map:



SCI_CO
20
Years of Service
User Offline
Joined: 20th Apr 2004
Location: USA
Posted: 28th Mar 2006 21:56
If you can try a lighter normal map.

I`v seen a dif with lighter and darker maps.
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 28th Mar 2006 22:09
Get the parallax shader from the UST. It is truly wicked.


At least farting ferrets are better than stinky stoats.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 28th Mar 2006 22:15
Could you try my normal map to see if it's any better (attached)?

Attachments

Login to view attachments
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 28th Mar 2006 22:23
I adjusted the brightness on the normal map image in both directions. They both produce different results but neither of them desirable.

@GG your map didn't work either.


SCI_CO
20
Years of Service
User Offline
Joined: 20th Apr 2004
Location: USA
Posted: 28th Mar 2006 22:40
Hmmmm maybe try CONVERT OBJECT FVF ObjNum,274
I used 338 and had unwanted art-fx then I used 274
and it looked better.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 28th Mar 2006 22:41 Edited at: 28th Mar 2006 22:44
You could try a vertex shader as well. I've used Ninja Matt's code from the Ultimate Shader thread and changed Ninja's FX file to use your maps (well my version of them anyway). See what you think.

The DBP U6RC1 code is:



The FX file ("Parallax20SCRAGGLE.fx") is:



With luck the images are attached in a zip file.

[Edit: @Scraggle, I agree my earlier attempt didn't work too well - but I think the vertex shader route might.]

Attachments

Login to view attachments
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 29th Mar 2006 09:45
@SCI_CO FVF didn't work

@GG The fx file produced some bizzarre effects! The high mountains seemed to flex as I rotated the planet and then fill with water! Very odd indeed.

Even if these workarounds had worked, I think we have proved the initial problem is a bug ... SET BUMP MAPPING ON doesn't work. So, maybe this should be confirmed?


Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Mar 2006 09:59
@Scraggle

Yes, the vertex shader doesn't quite work right. I'm not surprised because I produced it quickly and didn't modify your heightmap (and the normal map, which was mine, might need adjusting too). Also, I just plugged the new textures and maps straight into Ninja Matt's .FX file. It's quite possible some of the parameters need tweaking. This is the sort of thing where an "advanced level" DBP manual would be nice.

I'm not convinced bump mapping doesn't work. My experiments always give the impression of a light reflecting on an uneven surface surface - hence the "white" bits. But the result is usually quite effective. I'll post one of my examples when I can find it and see what you think. It is not clear to me whether this is what "bump" mapping is supposed to do (it ain't clear from the Help files). The vertex shading approach seems to stop that.

The other problem is that there is an infinite variety of ways of doing the normal map and some are more successful than others.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Mar 2006 10:12
Here's my version of a normal map maker and bump mapping illustration. Try it first with the "oldwood.jpg" file I've attached (I think it's one that came with DBP, not sure now). Then try with an image of your own.

The code has several adjustable parameters, but for the moment I can't remember how many were actually implemented. One day I'll finish this project ...

It's examples like this which make me think bump mapping works - but the Helps could be clearer perhaps.

Attachments

Login to view attachments
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 29th Mar 2006 10:59
Thanks, your code seems to do the trick!

I modified it slightly so that it uses the greyscale image to create the normal map but the full colour image for the texture. Here is the result.


Here is the updated code:


So, yes it seems bump mapping works, but an adjustment to the help files as to how to use it would certainly be very welcome.

Thanks again


LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 29th Mar 2006 11:07
Added for U6 help:

SET BUMP MAPPING ON:

Be aware that you must provide a normal map texture for this command to work, and not a height map texture (greyscale). The bump mapping uses the normal map to generate pseudo-3D data which the light calculation can use to highlight areas of the object surface.

"Small, smart, and running around the legs of dinosaurs to find enough food to survive, bedroom programmers aren't extinct after all "
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Mar 2006 11:46
Good news all round! I'll try your code later, Scraggle - must go now.

Login to post a reply

Server time is: 2024-09-10 00:56:08
Your offset time is: 2024-09-10 00:56:08