Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / 3D Theory & Graphics / Blending question Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

May 31, 2005, 04:08 PM


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 :

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 :

  2. void main(in float2 tex : TEXCOORD0,
  3.                   out half4 color0 : COLOR,
  4.                   const uniform samplerRECT normTex)
  5. {
  6.         float4 texel = texRECT(normTex, tex);
  7. = / texel.w;
  8. }

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

This thread contains 1 message.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.