Parallax Mapping / Normal Map and Bump Map generation

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
nestumkiller
Posts: 3
Joined: Fri Nov 17, 2006 11:38 am

Parallax Mapping / Normal Map and Bump Map generation

Post by nestumkiller »

Hi guys!

I'm implementing parallax mapping and I've been seeing the Irrlicht's tutorial. However, I'm not achieving the same results because I don't have a clue how you generate the bump map (height map) from the original texture - rockwall.bmp. It seems that the texture has been smoothed out and some threshold has been applied to it so it can really relief the black/grey parts.
Furthermore I'm using ATI's Normal Map Generator, which, doesn't generate any useful Normal Map when I input it with rockwall_height.tga (got from Irrlicht and converted to TGA) - just noise :S
Do you have any tips regarding the generation of such a nice bump map and furthermore a generation of normal map?

Thanks
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

The demo takes a height map and calls a function to make it into a normal map. Your tool may already be producing the normal map, so to use it in the demo you would not call makeNormalMapTexture().

In crude terms a heightmap looks like a black-and-white texture and a normal map looks a smooth multicoloured gradient.
nestumkiller
Posts: 3
Joined: Fri Nov 17, 2006 11:38 am

Generating the bump map in Irrlicht

Post by nestumkiller »

sio2 wrote:The demo takes a height map and calls a function to make it into a normal map. Your tool may already be producing the normal map, so to use it in the demo you would not call makeNormalMapTexture().

In crude terms a heightmap looks like a black-and-white texture and a normal map looks a smooth multicoloured gradient.
Hi!

Well, I know what Irrlicht is doing and precisely what I have, as well as the definitions of bump/height map and normal map. My question is, how was that bump map generated? It's a very smooth picture (regarding the bricks roughness) and at the same time there is a big difference between the bricks and spaces between them.
I've seen Irrlicht's code, but that doesn't help me. I just would like to know how to generate such a smooth height map from a simple texture.
Thankx
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

you can create one in gimp if you're artisticly inclined, or using photographs, or from a high poly model using melody
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
nestumkiller
Posts: 3
Joined: Fri Nov 17, 2006 11:38 am

How the bump map was created (Per-Pixel Lighting example)

Post by nestumkiller »

Hi again!

Sorry to insist once again, and thanks for replies, but do any of you have an idea of how that image (rockwall_height.tga). I'm using photoshop and aplying some Gaussian Blur and finally aplying the Photocopy filter. The strange part is that the example texture that is used in Irrlicht is really smooth on the bricks surfaces and there is such a big difference on spaces between (I'm repeating myself, like an old man :P).
Do any of you have a clue of HOW WAS IT REALLY DONE?

The pictures:

Irrlicht original texture:

http://www.student.itn.liu.se/~joajo939 ... ckwall.bmp

Irrlicht height map:
http://www.student.itn.liu.se/~joajo939 ... height.bmp

Our height map, using Gaussian blur and Photocopy Filters:
http://www.student.itn.liu.se/~joajo939 ... height.jpg

So, our height map has too much noise on the bricks, which leads to very deep bumps on the bricks surfaces.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

I think the heightmap in question was made by the person who wrote the whitepaper on the implementation of the bump and parallax mapping irrlicht uses.
so this is really an image/art question, I guess when making them by hand, the artist who makes the textures has to make the heightmap and the diffuse map at the same time..
i'm no artist, but here's how i'd do it in gimp-

1) make a shaky mortar outline in white with a transparent background, use seamless filter to make it into a seamless reapeating texture, then tidy up all the blurring by hand

2) make a new image of the same size starting from a free rock or brick texture, apply layers of noise in different channels for colouring effects, add some other layers of blurred scribble and whatever else looks nice, flatten it to one layer, use the seamless map filter to make it a repeating texture, then copy the mortar texture into a new layer, colour it, add/burn/whatever it with a degree of transparency to give different coloured mortar

3) do the same for the heightmap.. start with a grey background, add the bricks over the top as a stencil, then paint new shades of grey over each brick, possibly smooth it, then use the seamless filter again to remove artifacts.. then merge it all together and use the two images.

I didn't try this, but I would assume the main trick is in using the same layer for the mortar depth and height. you aren't gonna get a good repeating texture from someone elses image without more work than would take creating from scratch
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
xtheagonyscenex
Posts: 131
Joined: Fri Jun 03, 2005 7:26 pm

Post by xtheagonyscenex »

there a tool by ati its called TGA TO DOT3 you can get it on their website it takes a 32 bit tga and makes a normal map
"Held in Your arms but too far from my heart." "These thoughts will carry me through the darkest nights...while your eyes rest in mine."
"How quickly I forget that this is meaningless."
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

xtheagonyscenex wrote:there a tool by ati its called TGA TO DOT3 you can get it on their website it takes a 32 bit tga and makes a normal map
Again: This is not about normal maps. ;)
TheC
Posts: 93
Joined: Fri May 05, 2006 7:50 am

Post by TheC »

nestumkiller,

The height file contains a range of grey colours from 0 (black) to 255 (white)

the intensity determines how high that pixel is.

For example, fill the entire texture with black. then in white text write "Hello", then load up the parallax example. You'll see that the while text sticks out of the wall.

To generate one of these for any textures, the best method is to do it by hand. For the most part, just guess, roughly, since it'll never be perfectly acurate.

I hope that works for you :)
Last edited by TheC on Wed Nov 22, 2006 2:50 pm, edited 1 time in total.
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

I know how parallax mapping works. Thank you very much. ;)
Post Reply