Texture R then G then B ?
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)
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?
one in the correct RGBRGBRGB and one in the RRRGGGBBB?
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.
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.
thats simple to get around, just provide the function with the memory address to render to and a stride to increment the pointer by
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement