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 / Bump Mapping... Ach!

Author
Message
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 29th Sep 2003 19:57
I've been trying to get bump mapping to work for a long while now to no avail.

All I want is a decent depth effect for my stone wall texture.

I've tried all sorts of things with it, all of them seem to result in odd effects.

I tried a bump map creation tutorial for Texture Maker; it worked, the resulting image was just like they said it should be. It applied an incredibly weird white-spiderweb effect to my walls that got worse the more distant it was.

A couple other tools just had similar weird effects. White spiderwebs, turning the wall solid white, etc... nothing seems to work right.

What kind of image do I need to use??

Thanks....

(DirectX 9.0b, Radeon 9500 Pro, Catalyst 3.7, I don't think it's a hardware issue)

--Mouse: Famous (Avatarless) Fighting Furball
Read It: http://www.angryflower.com/itsits.gif
Learn It: http://www.angryflower.com/bobsqu.gif
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 29th Sep 2003 20:38
Email me the texture you want to use and I'll send you a normals map for it and some code that works on my PC. If it still spider-webs on yours, well.. then we have a less-easily solved problem

Cheers,

Rich

The sky above the port was the colour of television, tuned to a dead channel.
Your brain's just like any other appliance: it works better if you plug it in...
Scraggle
Moderator
23
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 29th Sep 2003 20:43
Hello.

Normals map eh?

What's that all about then?
Unconnected
22
Years of Service
User Offline
Joined: 26th Jul 2003
Location:
Posted: 29th Sep 2003 21:13
hehe, it is the bump map

looks like black and white negative of the original texture..
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 30th Sep 2003 01:38


media:
diffmap >>


bumpmap >>


monomap >>


bump mapping isn't something you can really capture in a screenshot as it is really something designed to trick the eye of depth, and in dbp it doesn't seem to have much specular to it (even with it set to max)
so its more of a subtle environment trick than anything else

Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 1st Oct 2003 01:01
Rich, did you recieve my email? I'm beginning to think my mail server dosen't like sending to TGC, because a mail I sent a Lee a little while back got lost (also?)

--Mouse: Famous (Avatarless) Fighting Furball
Read It: http://www.angryflower.com/itsits.gif
Learn It: http://www.angryflower.com/bobsqu.gif
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Oct 2003 02:32
@Raven.

Cool. I'll try that out tomorrow

Tell me, how do you generate a normals map/bumpmap? And what is the point of the monomap?
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 1st Oct 2003 05:37
in the instructions it says

Your video card must have the ability to
create this hardware effect.

What command do I use to detect if it exists.

I cant see any texture on my crappy tnt2m64 (32meg)

http://www.lunarpixel.com
It's already tomorrow in Australia
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 1st Oct 2003 05:54
'Tell me, how do you generate a normals map/bumpmap?'

Hehe, exactly what I'm trying to get right

--Mouse: Famous (Avatarless) Fighting Furball
Read It: http://www.angryflower.com/itsits.gif
Learn It: http://www.angryflower.com/bobsqu.gif
ESC_
22
Years of Service
User Offline
Joined: 29th Aug 2003
Location: Mass.
Posted: 1st Oct 2003 06:09
There are several ways. If you own photoshop, there is a very nice plugin on the nvidia site that will convert an image into a normal map through photoshop. If you don't own photoshop, you can download a program from ati that lets you specify a .tga file and turns it into a dot3 bumpmap/normal map. It's oftentimes better to repaint your bumpmap from scratch using your old texture as a guide than to convert the original texture.

"That's not a bug, it's a feature!"
"Variables won't, constants aren't."
Dave J
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 1st Oct 2003 06:37 Edited at: 1st Oct 2003 06:38
It's not so easy to see the bump mapping in Raven's example because the sphere is so chunky it's easy to confuse the unsmooth surface of the sphere with the actual bump mapping effect. So you should probably use something like:



Which uses a 32*32 segment sphere. It makes it somewhat easier to see the effect made by bump mapping in that particular example.


"Computers are useless they can only give you answers."
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 1st Oct 2003 06:45
i dont see anything with both snippets. It must be my old card.

anyone know the detection method or command to see if it exists on your card before I even attempt to use it on a commercial project?

http://www.lunarpixel.com
It's already tomorrow in Australia
MushroomHead
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Oct 2003 13:31 Edited at: 1st Oct 2003 13:33
Have you tried running a D3DCaps utility? There's one supplied on DX9 SDK, run it for your card and check the list for TextureOpCaps. Here's the C++ code for checking if a card supports bump mapping or not (you're looking for D3DTEXOPCAPS_BUMPENVMAP or D3DTEXOPCAPS_BUMPENVMAPLUMINANCE) :-



Also, the card you have, try using smaller texture sizes 128x128 or 256x256 (old voodoo cards like this format). Newer cards (128MB ones) can take 512x512 ... if your card supports 2 blend stages there's no reason why it can't use 2 stage bump mapping. Most older cards support 2 blend stages, I'll try setting up something and test it on my old nvidia tnt2 ultra.
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 1st Oct 2003 13:58
well now theres two ways.

I asked lee and he gave me a snippet similar to this



http://www.lunarpixel.com
It's already tomorrow in Australia
Anvirol
23
Years of Service
User Offline
Joined: 22nd Jul 2003
Location:
Posted: 1st Oct 2003 14:57
Hopefully the bump mapping issue has been fixed for the next version of DBP because for example none of my team's coders has got the bump mapping working without the white spots. So it's basically not working for 90-95% of the people...

indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 1st Oct 2003 15:26
if the code i showed from lee above results in zero then that card cannot do bump mapping.

http://www.lunarpixel.com
It's already tomorrow in Australia
Darkflame
23
Years of Service
User Offline
Joined: 4th Jul 2003
Location:
Posted: 1st Oct 2003 15:29
"There are several ways. If you own photoshop, there is a very nice plugin on the nvidia site that will convert an image into a normal map through photoshop. If you don't own photoshop, you can download a program from ati that lets you specify a .tga file and turns it into a dot3 bumpmap/normal map. It's oftentimes better to repaint your bumpmap from scratch using your old texture as a guide than to convert the original texture."



How on earth can a plugin "know" the heights from the picture??
Surely bump maps always have to be done manualy..

"The man who says it cannot be done is generally interrupted by someone doing it." ~ Elbert Hubbard
MushroomHead
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Oct 2003 16:07 Edited at: 1st Oct 2003 16:08
Quote: "if the code i showed from lee above results in zero then that card cannot do bump mapping."


That code obviously will fail on GF2 MX cards, which *do* support bump mapping but don't have shader support (vertex shaders can be done on MX cards but they're run on the CPU). I guess what he is saying is DBP needs a card with vertex/pixel shaders to use bumpmapping?
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 1st Oct 2003 18:29
'How on earth can a plugin "know" the heights from the picture??'

The heights we percieve without the bump mapping are determined by the pixels, which can be read by the program, so it can basically detect heights. If it's a more complex image, it might do a poor job, but it works for most of them.

--Mouse: Famous (Avatarless) Fighting Furball
Read It: http://www.angryflower.com/itsits.gif
Learn It: http://www.angryflower.com/bobsqu.gif
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 1st Oct 2003 18:46
yeah, still isn't as prodominant as it should be unfortunately Exeat... may have to see about linking the DirectX DX6 Bumpmapping technique, slower but is alot better.

As for the point in the monochrome image, both the mono and normal maps will produce the exact same effect - the mono is a very simple thing to create, all you do is greyscale your image and then accentuate the curves so that there is more contrast between the light and dark
for a normal map there are several ways,

- ATi have a program call the Compressionator, this allows you to create Compressed textures S3TC compliant.
- ATi also have something called the NMF exporter for 3D Studio Max 4/5/6 which will export a normal map to a lower polygon model based on a high poly version. Infact this is something i use regularly as it is extremely useful, i have importers for NMF (Normal Mesh Format) and NMB (nVidia Mesh Binary) as soon as Lee sends me some documentation on something. Will give you far better support for normal/non-environment bump mapping.
- nVidia's Normal Exporter for Photoshop 6/7 - very good exporter too for creating all the different kinds of normal map, however confusing to use unless you understand a little about them first.
That said it has a 3Dviewer so you can test out your normal maps prior to export - works very well with the DDS exporter.
- Deep Exploration 3.0, they've contained a 2d normal mapper since 2.0 ... no options but creates normal maps easily and the demo give you exporting abilities for upto 30days.

there are a few more programs online which allow it 3rd party, i'll see about digging up the normalisation format later and posting the C++ of it for people to create thier own compilers

-------------

as for testing, i thought DBP had a Bump Mapping Available() function ... however if the current version is Pixel Shaded / Vertex Shaded i can very easily mock up a Shader after this weekend for it.

Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 1st Oct 2003 19:13
Bump Mapping in DBPro, unlike most 3D engines, requires shaders it seems. (It is possible to do Dot3 without, as cards post Matrix G400 generally have hardware bumpmapping built in)

Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 1st Oct 2003 19:44 Edited at: 1st Oct 2003 19:47
Photoshop, 3d studio max... ouch. I don't have either of those. Just PSP7 in the high-end field.

I'll try Deep Exploration. Thanks for the links Raven.

Edit-- not links... names.

I need more coffee.

--Mouse: Famous (Avatarless) Fighting Furball
Read It: http://www.angryflower.com/itsits.gif
Learn It: http://www.angryflower.com/bobsqu.gif
greenlig
22
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Melbourne
Posted: 2nd Oct 2003 12:47
The TNT2 cards were great, they ran ALL the mappings on my computer ALL of them!!

I got best and fairest for soccer WHOOHOOO!
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 3rd Oct 2003 02:34
IT doesnt run here, care to post your tnt2m64 secret>?

http://www.lunarpixel.com
It's already tomorrow in Australia
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 3rd Oct 2003 02:47
doesn't run on my GeForce2/2mx either and that has FixxedFunction Shaders it can use so would be interesting to know

Dreamora
23
Years of Service
User Offline
Joined: 20th Sep 2002
Location: Switzerland
Posted: 3rd Oct 2003 04:07 Edited at: 3rd Oct 2003 06:28
indi forget it, someone at TGC had the superstupid idea to move bumpmapping over to FX Shaders, so as long as you don't have Pixel Shader the bump mapping command is dead to you.
to rebuild the old bump map command use set blend mapping on obj,bumptex,24

the D3D constants are the following

D3DTOP_SELECTARG1 = 2,
D3DTOP_SELECTARG2 = 3,
D3DTOP_MODULATE = 4,
D3DTOP_MODULATE2X = 5,
D3DTOP_MODULATE4X = 6,
D3DTOP_ADD = 7,
D3DTOP_ADDSIGNED = 8,
D3DTOP_ADDSIGNED2X = 9,
D3DTOP_SUBTRACT = 10,
D3DTOP_ADDSMOOTH = 11,
D3DTOP_BLENDDIFFUSEALPHA = 12,
D3DTOP_BLENDTEXTUREALPHA = 13,
D3DTOP_BLENDFACTORALPHA = 14,
D3DTOP_BLENDTEXTUREALPHAPM = 15,
D3DTOP_BLENDCURRENTALPHA = 16,
D3DTOP_PREMODULATE = 17,
D3DTOP_MODULATEALPHA_ADDCOLOR = 18,
D3DTOP_MODULATECOLOR_ADDALPHA = 19,
D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
D3DTOP_BUMPENVMAP = 22,
D3DTOP_BUMPENVMAPLUMINANCE = 23,
D3DTOP_DOTPRODUCT3 = 24,
D3DTOP_MULTIPLYADD = 25,
D3DTOP_LERP = 26,
Dreamora
23
Years of Service
User Offline
Joined: 20th Sep 2002
Location: Switzerland
Posted: 3rd Oct 2003 06:30 Edited at: 3rd Oct 2003 06:52
Here is some attempt of getting the old bumpmapping effect back as DBP destroys completely blend mode 24

first i though i found a method using the blend mapping ... as you see only thought




-------- EDIT -------
set blend mapping on 1,2,24
set light mapping on 1,3

have to be replaced through
set light mapping on 1,2

and the bumpmap.jpg through this bumpmap file (created with Paintshop Pro flatrelief filter)

http://www.dreamflowers.org/bumpmap2.jpg
EddieRay
23
Years of Service
User Offline
Joined: 28th Feb 2003
Location: USA
Posted: 3rd Oct 2003 08:59 Edited at: 3rd Oct 2003 09:06
Dream: Thanks for posting the list of blend modes... excellent! I've been looking for that in the DX9 SDK docs and have been unsuccessful in finding it (do you know what section it is in?).

I'm not sure I'm following you though... are you saying that DBPro can't do blend mode 24 correctly and you have to use light mapping with a different special kind of "bump" texture file (and does it produce the "same" result)? I thought the BUMPENVMAP blend mode was 22... why didn't you try that one (is it not really a "bump-map" blend mode)? I'm lost...

Do any of the other "BLEND MAPPING" modes work correctly in DBPro or not correctly in DBPro? Which ones?

Also, do you have any explanations on the other vaguely described modes like "SET DETAIL MAPPING ON" and "SET ALPHA MAPPING ON" for us information hungry DBPro hacks...? I do have a little understanding about generally what the modes are supposed to be doing, but the DBPro docs should say a little more specifically what the operation really is... for example, the docs should list the available blend modes, and they should say what the operation is that is performed by "detail mapping", etc.

Side note: I still don't have much of a clue how to make an image file with an alpha channel either... I have Photoshop 5 "LE" and I think it can do this kind of thing by I have no idea how to do it, so I can't even begin to try the stuff in DBP that can use RGBA images and make transparent parts of texture-mapped objects, etc.

Thanks,

Ed

AMD900/256MB/Radeon 8500 64MB/Win98SE/DX9.0b
P3-850/384MB/GeForce2 Go 16MB/WinXP Pro/DX9.0b
Thade
22
Years of Service
User Offline
Joined: 20th Aug 2003
Location:
Posted: 3rd Oct 2003 22:48
All I see is a white sphere ...
In case the card doesn't support it - shouldn't there be at least a sphere with the world map on?
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 3rd Oct 2003 23:53
Thade-- not really, the bump mapping might just un-texture the object if your card dosen't support it.


Apparently bump mapping is royally screwed on my system along with me still not having found a decent tool to make normal maps, so...

--Mouse: Famous (Avatarless) Fighting Furball

A very nice %it, indeed.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 4th Oct 2003 06:08
nope thade... if thier bump map truely does use the pixel shader the all you'll get is it in white.
if its using the vertex shader then the object will appear black or disappear all together.

still need access to the object interfact before i could actually do bump mapping
you could always fake it by making a DOT3 function for it, my brains all fuzzy from rewriting mouse code ALL day - so just check the Dxsdk as it has a dot3 example in that.
not as fast but you can customise it more...

Dreamora
23
Years of Service
User Offline
Joined: 20th Sep 2002
Location: Switzerland
Posted: 6th Oct 2003 21:15
Raven: If blend mapping 24 would work as it is intended to, you would have Dot3 there because blend 24 is dot3bumpmapping

Dell Inspiron 8200,P4-M 1,7ghz, GF4 440go (45.23 - DX9b), 512mb RAM
DMXtra
23
Years of Service
User Offline
Joined: 28th Aug 2002
Location: United States
Posted: 7th Oct 2003 13:49
I have been working with bumpmapping and have a demo that I have completed. Just need to find some webspace to upload it to.

Dark Basic Pro - The Bedroom Coder's Language of choice for the 21st Century.

Login to post a reply

Server time is: 2026-07-25 09:59:23
Your offset time is: 2026-07-25 09:59:23