PDA

View Full Version : Bump mapping using Ray tracing

Stan
07-22-2003, 05:20 AM
Hi guys, I'm a very begginer in computer graphics programming. Quite familiar with visual c++ but never even once write an opengl code. Now I have a school project to make an opengl program which implement bump mapping using ray tracing on mathemathical 3D object. I try to explain the problem as clear as possible with my limited English.

A few years ago someone in my shool has already made it using classic height field bump mapping method - if you already knew it, just pass to next paragraph. This method calculates normal vectors of object's surface as new height field. Then this new surface's normal is used to calculate diffuse and specular lightning. This calculation is implemented on every pixel on the object's surface.

But this method has a serious weakness. If the 3D object is maped on 2D surface, the effect doesn't work at the edge of the object at all (it's still perfectly smooth, since it's a mathemathical one). This is caused the method only change the normal vectors, and the bump effect is completely an eye illusion.

The project objection is to make bump mapping method that totally eliminates that weakness.

Is there anyone here has a concept how the algorythm will work? Or perhaps there's already a reference for this method?

Thx.

errno
07-22-2003, 05:40 AM
bump mapping just modify the normal of the surface. the geometry is not moved so the edge of the object are still flat.
the effect you want is called displacement mapping.
it work with an height field too but modify the normals and the fragments position.

if you use ray tracing, you have to implement an intersection method which take care of the displacement... not very easy http://www.opengl.org/discussion_boards/ubb/biggrin.gif

Relic
07-22-2003, 05:45 AM
Bumpmapping is only perturbing normal vectors. The geometry doesn't change, if it's flat, it remains flat.
Sounds like you need to implement displacement mapping.
The simplest method is to generate a heavily refined geometry using the base geometry displaced by the height informations on the texture.
Raytrace the result and you're done.
OpenGL is not involved, except if you want a fast preview of the mesh.

edit: Perfect double post. http://www.opengl.org/discussion_boards/ubb/smile.gif

[This message has been edited by Relic (edited 07-22-2003).]

Stan
07-23-2003, 09:44 PM
Wow, I never thought that it'll be that complicated. http://www.opengl.org/discussion_boards/ubb/frown.gif *sigh*
Anyway, thanks a lot for your help guys. I really really appreciate it. http://www.opengl.org/discussion_boards/ubb/smile.gif