Texture R then G then B ?

Started by
5 comments, last by jmaupay 18 years, 7 months ago
I would like to use RGB textures as an array of R values then G values then B values. I mean not standard organization by pixel, but by component: standard: R0 G0 B0 R1 G1 B1 R2 G2 B2 ... Ri Gi Bi wanted: R0 R1 R2 ... Ri G0 G1 G2 ... Gi B0 B1 B2 ... Bi Is it possible ? I tried to find in PixelStorei but nothing seems to do that ? Is there an extension or something ? (should be very nice especially for procedural textures)
jma
Advertisement
Not possible to upload data to OpenGL in that format. However, maybe you could use some render to texture technique, and render the three channels individually to combine the final texture that way?
You must combine the channels yourself and if such a format was possible it would have a poor efficiency.
why do you need to use this format? you could just have two arrays/textures
one in the correct RGBRGBRGB and one in the RRRGGGBBB?
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website
Ok Thanks all.

It's only for convenience: I have 3 functions that writes 3 separate arrays of float. I send them to fragment program on 1 RGB texture. And I'm not happy in my function to take into account the number of channels in the merged texture (somedays I could decide to send it in a RGBA texture or only a luminance texture !).

Thanks again.

J.


jma
thats simple to get around, just provide the function with the memory address to render to and a stride to increment the pointer by
Yes, that's what I'm doing, and what I call "to take into account the number of channels".

I was just checking if I didn't miss a trick in PixelStorei and others OpenGL texture parameters.
jma

This topic is closed to new replies.

Advertisement