Fragment program: TXB and TXP?

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?

You can use …

glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT,GL_TEXTURE_LOD_BIAS_EXT,lod_bias);

Please explain how “it didn’t work” :wink:

TXB is meant to be used when you need a different bias each pixel.

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 :slight_smile: