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: More tex units needed

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    25

    More tex units needed

    Hi,

    I am using a GeForce4 that supports 4 texture units. I have written a piece of code that is basically similar to the "Anisotropic Bump Mapping" that is part of the NVidia Effects Browser. The demo uses 4 texture units:

    TEX0: tangentmap (RGB)
    TEX1: texcoords are the L vector
    TEX2: texcoords are the H vector, texture is a phong lookup texture
    TEX3: the decal texture (RGBA)

    I am trying to expand this demo with depth-based shadow mapping that would consume yet another texture unit. Unfortunately, I am not that experienced, so I have no idea, how to effectively combine these two techniques. Does anyone has an idea, how I can achieve this, but by still using this bump mapping technique?

  2. #2
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: More tex units needed

    You can multipass it. First draw your bumpmapping as you already do. Then draw the shadowing pass on top of that and do multiplicative blending.

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    857

    Re: More tex units needed

    What Humus said. Except that it might be problematic if you have multiple lights. In that case, you could render the shadows into destination alpha, then draw the light using (GL_DST_ALPHA, GL_ONE) blending.

    -- Tom

  4. #4
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    25

    Re: More tex units needed

    Yes, I will try this, thanks for your 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
  •