Original Post
Hi everyone,
i'm a bit confused about how i can read textures of specific formats in opengl. Normally, you would use texture2D or texelFetch or something like that, and get a vec4 as a result. It's possible to declare output variables like
out vec2 data;
and write to it. Now i wonder how you can read some vec2 value. Can one just use the same function and only use vec4.xy? If that's the case, what will be vec4.zw? Will they be zero because of some "pipeline-magic", or are they just filled with the data of the next texel?
I'd be glad if someone could point me to some source where i can read what happens there and how i can access such vec2-textures.
I didn't post code because it's not a code-related problem, it's more like that i don't find these things explained in the docs.
greetings,
weeska
i'm a bit confused about how i can read textures of specific formats in opengl. Normally, you would use texture2D or texelFetch or something like that, and get a vec4 as a result. It's possible to declare output variables like
out vec2 data;
and write to it. Now i wonder how you can read some vec2 value. Can one just use the same function and only use vec4.xy? If that's the case, what will be vec4.zw? Will they be zero because of some "pipeline-magic", or are they just filled with the data of the next texel?
I'd be glad if someone could point me to some source where i can read what happens there and how i can access such vec2-textures.
I didn't post code because it's not a code-related problem, it's more like that i don't find these things explained in the docs.
greetings,
weeska