PDA

View Full Version : 3d textures too dark



muhkuh
08-04-2002, 04:23 AM
Hi there,
I'm using a 3d texture without mip mapping to texture a landscape. The texture consists of 4 256x256 textures for the different height levels of the landscape( snow, debris, forests, desert).
Texturing is working in general but there are some strange display errors. Triangles with a third texture coordinate of zero (very low parts of the landscape) as well as those with a coordiate of 1.0 (high parts of the landscape) get rendered too dark.

Any thoughts ?



[This message has been edited by muhkuh (edited 08-04-2002).]

zeckensack
08-04-2002, 04:51 AM
Add a proper clamping mode to the third texture coordinate.
Suggestion:
glTexParameteri(GL_TEXTURE_WRAP_R,GL_CLAMP);

Or was it GL_CLAMP_TO_EDGE_EXT ... ?

[This message has been edited by zeckensack (edited 08-04-2002).]

muhkuh
08-04-2002, 05:09 AM
Cool man, it's working now. Had GL_CLAMP before. Is the GL_LINEAR filter with GL_CLAMP sampling black pixels from outside the texture map or what ?

[This message has been edited by muhkuh (edited 08-04-2002).]

[This message has been edited by muhkuh (edited 08-04-2002).]

ehart
08-04-2002, 05:32 AM
CLAMP filters in whatever the border is. Without a specified border, the border color is used, and the border color defaults to black.

-Evan