PDA

View Full Version : Shading+blending 3d texture



Tomy
03-24-2005, 06:52 AM
hi,

I am using this simple shader to color a 3d texture using a 1d texture as a color palette.

uniform sampler3D oTexture;
uniform sampler1D oPalette;
void main()
{
gl_FragColor = texture1D(oPalette, texture3D(oTexture, gl_TexCoord[0].xyz));
}';

When I enable blending using:

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

the appearance of the texture becomes so dimmed.. hardly visible... colored though.. any ideas?

Thanks :)

Humus
03-24-2005, 04:14 PM
Well, the obvious solution would be to boost the alpha a bit in your lookup table.

Tomy
03-25-2005, 11:37 PM
The alpha lookup table I am using is linear against the color index with slope=1. I boosted the alpha values.. but there was no change in the output :confused: