Hi all,
Can GL_CLAMP_TO_BORDER and bordered 3D texture work together?
It will freeze the program without any OpenGL error.
I tried the following combination:
CLAMP_TO_EDGE + bordered 3D texture -> OK
CLAMP_TO_BORDER + unbordered 3D tex -> OK
CLAMP_TO_BORDER + bordered 3D tex -> The window goes blank and program freezes
“bordered texture” means glTexImage3D() with a
(2^n + 2)^3 image, and set parameter “border” to 1.
I tried the program on GeForce4, QudroFX and Raedon 9700.
I need this feature to write a simple volume renderer. To drop fragments that falls outside [0,1], I use GL_CLAMP_TO_BORDER and set border color’s alpha value to zero. But such method will cause artifacts near the edge of the volume, because the linear filter will average the border color with the edge color. So I need to give the volume a border which RGB components are “borrowed” from adjacent volume data.
An alternative is to use GL_CLAMP_TO_EDGE and glClipPlane(.), but…I haven’t try them.