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 3 of 3

Thread: Sanity check regarding normalization with cube maps

  1. #1
    Junior Member Regular Contributor
    Join Date
    Jun 2003
    Location
    Virginia
    Posts
    215

    Sanity check regarding normalization with cube maps

    Given that
    fragment.texcoord[3] contains a vector multiplied by the inverse transpose of the modelview matrix.
    ( and is not already normalized )

    texture[1] contains a normalizing cube map.

    These two ARBfp snippets should be pretty much the same, right?

    Code :
    # normalize with math
    DP3		normal.w, fragment.texcoord[3], fragment.texcoord[3];
    RSQ		normal.w, normal.w;
    MUL		normal.xyz, fragment.texcoord[3], normal.w;
    # normalize via cube maps
    #TEX		normal.xyz, fragment.texcoord[3], texture[1], 3D;
    #MAD		normal.xyz, normal, two, neg_one;

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

    Re: Sanity check regarding normalization with cube maps

    TEX normal.xyz, fragment.texcoord[3], texture[1], CUBE;

    -- Tom

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jun 2003
    Location
    Virginia
    Posts
    215

    Re: Sanity check regarding normalization with cube maps

    Thanks Tom. *Hangs head in shame*

Posting Permissions

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