bump mapping...


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:

the man is kinda black, and the bump mapping isn’t very believable…

Here is the most important code:
Normalisation Cube Map.cpp
Normalisation Cube Map.h

Thank you really, really a lot

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

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.

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).


Afinal ainda nao conseguiste por isso a funcionar…
Mas estás a utilizar o código que eu te dei… Modificas-te alguma coisa?

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

exacto… como já disse no gamedev-pt, ainda não consegui

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

did it already!!

but now… there is another problem… the model doesn’t look very smooth:



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

Because it’s bump mapped?!

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