isgoed
2005.04.10, 02:09 PM
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)
http://revaro.net/developer/images/SimpleBump.jpg
http://www.revaro.net/developer/images/SimpleBump.jpg
Source code and app:
http://revaro.net/developer/SimpleBump.zip
http://www.revaro.net/developer/SimpleBump.zip
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)
Credits:
(+ source code simplebump.zip )
http://www.paulsprojects.net/tutorials/simplebump/simplebump.html
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:
ARB_multitexture
ARB_texture_cube_map
ARB_texture_env_combine
ARB_texture_env_dot3
*/
Steven Verstoep
Revaro Software
www.revaro.net
It works on a redeon 7000 ! :)
Still I have some requests:
Can Anyone Add code for Spectacular lighting? That would be real sweet.
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.
I have problems with my website so i post two links (one with www and one without)
http://revaro.net/developer/images/SimpleBump.jpg
http://www.revaro.net/developer/images/SimpleBump.jpg
Source code and app:
http://revaro.net/developer/SimpleBump.zip
http://www.revaro.net/developer/SimpleBump.zip
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)
Credits:
(+ source code simplebump.zip )
http://www.paulsprojects.net/tutorials/simplebump/simplebump.html
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:
ARB_multitexture
ARB_texture_cube_map
ARB_texture_env_combine
ARB_texture_env_dot3
*/
Steven Verstoep
Revaro Software
www.revaro.net
It works on a redeon 7000 ! :)
Still I have some requests:
Can Anyone Add code for Spectacular lighting? That would be real sweet.
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.