Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Fragment program: TXB and TXP?

Hybrid View

  1. #1
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    San Diego, CA, USA
    Posts
    769

    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?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,652

    Re: Fragment program: TXB and TXP?

    You can use ...
    Code :
    glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT,GL_TEXTURE_LOD_BIAS_EXT,lod_bias);
    Please explain how "it didn't work"

  3. #3
    Junior Member Regular Contributor
    Join Date
    Oct 2003
    Location
    Hamburg, Germany
    Posts
    118

    Re: Fragment program: TXB and TXP?

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

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    San Diego, CA, USA
    Posts
    769

    Re: Fragment program: TXB and TXP?

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •