PDA

View Full Version : Strange Color Swizzle needed



henniman
03-07-2011, 01:42 AM
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


vec4 col_now = texture2D(live_texture, texCoord);

has to be swizzled now:


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

ZbuffeR
03-07-2011, 02:45 AM
Big- versus little-endian ? (Shooting in the dark here).

malexander
03-07-2011, 10:28 AM
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?

henniman
03-09-2011, 02:54 AM
'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