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: Strange Color Swizzle needed

  1. #1
    Intern Contributor
    Join Date
    Oct 2005
    Location
    germany
    Posts
    71

    Strange Color Swizzle needed

    Hi all,

    i am writing a shader that does a sort-of-lightwriting.
    It writes to two render targets, one being the output,
    the other being a difference image for future lookups.
    The shader runs fine under windows, but under osx
    ( nv hardware, all on the same machine ) i have to do a
    strange color swizzle.

    A simple texture lookup, that generally looks like this

    Code :
    vec4 col_now = texture2D(live_texture, texCoord);

    has to be swizzled now:

    Code :
    vec4 col_now = texture2D(live_texture, texCoord).grab;


    I am somewhat disturbed by the swizzle pattern,
    i would understand 'rgba', 'argb' 'bgra' .. all known
    and common, but 'grab' ??
    does anyone know what happened to my data to require this?
    I cant even imagine a texture format that does this
    swizzling. The shader uses gl_FragData, is this somehow
    related?

    Best
    Henniman

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Strange Color Swizzle needed

    Big- versus little-endian ? (Shooting in the dark here).

  3. #3
    Junior Member Regular Contributor malexander's Avatar
    Join Date
    Aug 2009
    Location
    Ontario
    Posts
    246

    Re: Strange Color Swizzle needed

    What texture format are you using? If you switch that format to a common format like RGBA8, does the issue go away? 'grab' almost looks like the texels are in bgra format, but offset by a single component (which sounds like a bug).

    Which version of OSX are you running?

  4. #4
    Intern Contributor
    Join Date
    Oct 2005
    Location
    germany
    Posts
    71

    Re: Strange Color Swizzle needed

    Quote Originally Posted by malexander
    'grab' almost looks like the texels are in bgra format, but offset by a single component
    ... indeed ...

    i am using 10.6.6 on a MacBookPro 6,2 NVIDIA GeForce GT 330M


Posting Permissions

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