|
|
Hi!!!!
My objective is to do a normalisation pass so that the bright spot in the middle of this screenshot has the same color as the rest of the two others splats : http://img232.echo.cx/img232/6840/blendquestion4ni.jpg
I want to do this by doing 2 rendering passes: one renderpass and a normalisationpass. After the first one is done, the screen contents are copied to a texture (using GL_TEXTURE_RECTANGLE_NV). The texture is then rendered using a quad that fills the whole screen (and covers what was already rendered). A simple fragment shader does the normalisation during the rendering of this quad :
void main(in float2 tex : TEXCOORD0,
out half4 color0 : COLOR,
const uniform samplerRECT normTex)
{
float4 texel = texRECT(normTex, tex);
color0.xyz = texel.xyz / texel.w;
}
|
For this to work, I have to use the glBlendFuncSeparateEXT-function during the first pass. Unfortunately, I can't get it to work. I know that during the first pass, all the RGB values should be multiplied by the alpha-value, so that the normalisation works. Does anyone know how to do this with glBlendFuncSeparateEXT?
greetings, Cygnus
|