Archived

This topic is now archived and is closed to further replies.

MessageBox

Problem with bumpmapping

Recommended Posts

MessageBox    109
I've bumpmapped a sphere with a normalisation cube map but I seem to be getting a weird effect where the lightvector is perpendicular to the normal. Could someone take tell me why I'm getting this effect in the following pics? http://homepage.eircom.net/~Sharpshooter/Sphere_1.jpg http://homepage.eircom.net/~Sharpshooter/Sphere_2.jpg http://homepage.eircom.net/~Sharpshooter/Sphere_3.jpg http://homepage.eircom.net/~Sharpshooter/Sphere_4.jpg Edit: And how do you post a link in these forums?? [edited by - MessageBox on October 9, 2003 3:06:46 PM]

Share this post


Link to post
Share on other sites
blueknight    122
It looks like you''re not saturating your N.L. If using a pixel shader do:
dp3_sat r0, t0_bx2, t1_bx2

assuming that t0 = BM and t1 = light direction.

If you don''t saturate, the value can wrap which is what it looks like is happening.

Share this post


Link to post
Share on other sites
MessageBox    109
I think you could be right about the wrapping but I''m not using a pixlel shader:

glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);

I have used GL_CLAMP_TO_EDGE to stop the wrapping but it doesn''t seem to have an effect

Share this post


Link to post
Share on other sites
blue_knight    194
I''m refering to the wrapping of your dot product. Since the dot product is a signed operation, if its less then 0 it will wrap. So you need to clamp your dot product operation to the [0,1] range. I''m not sure how to do this with OpenGL combiners (is that what you''re using?) but look for a CLAMP or SATURATE parameter for your DOTPRODUCT3 (or equiv.) operation.

Share this post


Link to post
Share on other sites