PDA

View Full Version : bump mapping...



pedrosl
07-08-2003, 03:43 AM
Hi,

I thought I had solved this problem already, but no... I'm trying to implement bump mapping on a model, but look at the result:
http://pwp.netcabo.pt/0233155401/sc01.jpg

the man is kinda black, and the bump mapping isn't very believable...

Here is the most important code:
MainWnd.cpp (http://pwp.netcabo.pt/0233155401/mainwnd.cpp)
Normalisation Cube Map.cpp (http://pwp.netcabo.pt/0233155401/normCubeMap.cpp)
Normalisation Cube Map.h (http://pwp.netcabo.pt/0233155401/normCubeMap.h)

Thank you really, really a lot

[This message has been edited by pedrosl (edited 07-08-2003).]

dorbie
07-08-2003, 03:53 AM
It may or may not be correct, off had I'd say your tangent space basis may screwed up w.r.t. your color triplets or the light source is inside the model. You gotta make sure your normal triplets in the image are compatible with the coordinate frame used for transform [normal, tangent & binormal] & your derivitives of s & t on the model, it's all gotta be on the same page. On the whole though it looks like a lot of it is at least partly correct.

Jan
07-08-2003, 06:42 AM
Well, i already wrote you something on flipcode about it, but here is another guess:

Maybe you forgot to clamp the tangent/binormal to [0,1] range? If you don´t do it, it sometimes looks ok, if the normals point in the right direction, but if they point in a slightly different direction, the result gets messy (especially on complex objects like models).

Jan.

KRONOS
07-08-2003, 06:44 AM
Afinal ainda nao conseguiste por isso a funcionar.... http://www.opengl.org/discussion_boards/ubb/wink.gif
Mas estás a utilizar o código que eu te dei... http://www.opengl.org/discussion_boards/ubb/smile.gif Modificas-te alguma coisa?

[This message has been edited by KRONOS (edited 07-08-2003).]

pedrosl
07-08-2003, 06:56 AM
exacto... como já disse no gamedev-pt, ainda não consegui http://www.opengl.org/discussion_boards/ubb/frown.gif ...

não modifiquei muita coisa... mas consegues ver algum problema no código?

pedrosl
07-09-2003, 02:22 AM
did it already!! http://www.opengl.org/discussion_boards/ubb/smile.gif

but now... there is another problem... the model doesn't look very smooth:

http://pwp.netcabo.pt/0233155401/sc05.jpg

why?

[This message has been edited by pedrosl (edited 07-09-2003).]

Nutty
07-09-2003, 02:49 AM
Because it's bump mapped?! http://www.opengl.org/discussion_boards/ubb/biggrin.gif

Looks like your normals aren't smoothed. i.e. you're using face normals.