Use separate buffers for R G B A

Started by
3 comments, last by Majestik666 18 years, 9 months ago
Hi, again another question about texturing, after getting the R,G or B display as luminance, I came up with some more trouble for some other features of my app... so my new question is , is there a way to use separate buffers for R G B and A and display is as a normal texture ? or maybe a simpler way to do it , have a bug buffer with all the components inside, but stored as RRRRRRGGGGGGBBBBBBAAAAA ? Thanks a lot ! Francois
Advertisement
Why can't you store the values in the "correct" RGBA positions? Even if you get all the green ones first, something like buffer[idx] |= green & 0x00ff0000;
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
the thing is I may need to invert R and G for example
so using separate buffer I could just swap pointers
instead of swapping all the values ...

Actually just think it the way Shake does it,
in its Reorder node, swapping channels instantly,
if you see what I mean ?

Cheers
Francois
You can just do that in your pixel shader, using swizzling (for simple channel switching) or a color transformation matrix (for arbitrary linear blending of channels).
yeah I was looking at the color transformation matrix,
seems to be the way to go !

This topic is closed to new replies.

Advertisement