jos_t_tarigan
01-14-2011, 02:14 PM
hi,
im trying to do a two pass renderer. so the first pass, the shaders send the texture coordinate (u and v) and two other values. both represented by float value. the second pass will process the rest of the action, not that important.
now since the fist pass will pass the coordinate, i would like it to have more than an 8 bit value like in standard color value passed by shaders.
i already set my texture to be a 32 bit texture like this:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, width, height, 0, GL_RGBA, GL_FLOAT, NULL);
and after the first pass, i save the buffer to texture by using this command:
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, width, height);
now my question is is it possible to do that? how can I pass 4 32 bit value with RGBA and save it in a texture?
thanks in advance
im trying to do a two pass renderer. so the first pass, the shaders send the texture coordinate (u and v) and two other values. both represented by float value. the second pass will process the rest of the action, not that important.
now since the fist pass will pass the coordinate, i would like it to have more than an 8 bit value like in standard color value passed by shaders.
i already set my texture to be a 32 bit texture like this:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, width, height, 0, GL_RGBA, GL_FLOAT, NULL);
and after the first pass, i save the buffer to texture by using this command:
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, width, height);
now my question is is it possible to do that? how can I pass 4 32 bit value with RGBA and save it in a texture?
thanks in advance