View Full Version : Fragment program: TXB and TXP?

06-28-2004, 02:52 PM
I ran into an interesting problem today that I was hoping you could help with.

I need to use a LOD bias on a projected texture within a fragment program. The TXP instruction looks up a projected texture, and the TXB instruction looks up a texture with bias, but there is no command to do both. Is there any way around this? I tried pre-dividing the xyz texture coordinates by w to simulate TXP, but it didn't work....why is that?

06-28-2004, 08:08 PM
You can use ...
glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT,GL_TEXTURE _LOD_BIAS_EXT,lod_bias);Please explain how "it didn't work" ;)

Christian Schüler
06-29-2004, 10:26 AM
TXB is meant to be used when you need a different bias each pixel.

06-29-2004, 02:23 PM
Please explain how "it didn't work" Well, I'm not sure what I was doing wrong yesterday, but I tried it again today and pre-dividing by texcoord.w and using TEX does work, so all is good now.

I needed a per-pixel bias, so setting the LOD bias of the texture environment would not have been adequate.

Thanks for the help :)