DOT3 Bump (Normal)Mapping Example

Post: #1
Hi all i ported a normal mapping example from a pc demo. It is on my website + source code. It uses GL extensions ARB_texture_env_dot3, ARB_multitexture, ARB_texture_cube_map and ARB_texture_env_combine. I never used any of this before and don't have the faintest idea what they do. I just ported it, so don't ask me for advise.

I have problems with my website so i post two links (one with www and one without)

[Image: SimpleBump.jpg]
[Image: SimpleBump.jpg]

Source code and app:

To be complete I also add the text of the readme (since I am not the official author of the code)

Simple bump ReadMe:

A mac port of the simple bump example by Steven Verstoep. (10 april 2005)

(+ source code )

All the important OpenGL code is in BumpMapping.c. There you will also find some usefull links to some webpages.

This program is build and works correctly on a Powerbook 550Mhz. (Ati Rage M6 16mb video (I believe that, that is a Radeon 7000)).

It requires OpenGL extensions. I know nothing about it. I just used the same code as in the tutorial by Paul.

Known Issues:
the depth buffer is not initialised. (I should probably call my OpenGL init function with some request for an depth buffer)

This program can only launch if your desktop resolution is 32 bit.

Lighting does not work. (If you render the torus without a bump map nothing appears). Probably some matrix that is not properly initialised. Note that for bump map lighting you do the light calculations yourself so OpenGL does not do it for you.

There is no Specular lighting on a bump map. (This requires an additional texture pas. This is my first app that uses GL extensions so I have no idea how to do that. I have doubts about it being possible since specular lightning requires an exponential calculation)

Required OpenGL extensions:

/* Required extensions:

Steven Verstoep
Revaro Software

It works on a redeon 7000 ! Smile

Still I have some requests:
  1. Can Anyone Add code for Spectacular lighting? That would be real sweet.
  2. I have a lot of regular textures which I would like to have bump mapped. Is there any tool that has an algorithm for generating bump maps from a 2D texture? Note that converting it to grey values and using a height map to normal map converter doesn't work. A topdown view of a pyramid for example would in a height map just be 4 triangle planes of the same height. What you want is sloped plains with the brightest point in the center. Also such a tool needs to be able to ignore decals and surfacecolors. I know this is a pretty impossible task. The human eye can make up a 3D representation of a 2D image, but for a computer algorithm it is pretty complicated.
Quote this message in a reply
Posts: 1,234
Joined: 2002.10
Post: #2
a. Specular lighting.

b. analysis of 2D images to extract depth information is cutting edge research. I don't know of any simple tool to do it.
Quote this message in a reply
Post: #3
Works very nice in 32-bit. Crashes when monitor is set to 16-bit but tells you why it crashed so it's not too bad. Getting a bump-map from existing 2D textures isn't possible for most images. You'll have to use 3D models and render them three times with one light source placed on top, front and the side and save each grayscale image into the RGB channels of the normal texture.
Quote this message in a reply
Posts: 153
Joined: 2004.12
Post: #4

There was a long silence...
'I claim them all,' said the Savage at last.
Quote this message in a reply
Posts: 110
Joined: 2002.07
Post: #5
really nice demo
Quote this message in a reply
Post: #6
hangt5 Wrote:This might help you out:
Yeah, those tutorials require me to have 3D geometrical data. I haven't seen any tutorial that takes a 2D texture as a base starting point. My best bet is just to make greyscale images of the textures I have and use those as height maps which I can use to generate normal maps. For textures for which this is not possible I must manually create them in a paint program or recrete the geometry in a 3D program and then render it as a normal map.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Normal Mapping Precision on iOS OptimisticMonkey 6 50,889 Apr 13, 2011 11:35 PM
Last Post: OptimisticMonkey
  Getting the Normal for a polygon. Jaden 3 8,028 May 1, 2009 01:47 PM
Last Post: Nosredna
  Vector (Normal) Map blending operations? kelvin 10 10,733 Mar 16, 2007 04:31 PM
Last Post: OneSadCookie
  drawing or displaying vertex normal shru_ani 3 5,572 Oct 29, 2006 06:04 AM
Last Post: shru_ani
  Gouraud vs Normal maps for dinamic terrains sohta 6 7,003 Oct 11, 2006 12:55 AM
Last Post: sohta