Multiplying a fragment against values in the alpha channel

Posts: 1,199
Joined: 2004.10
Post: #1
I'm curious how I'd go about causing pixels being drawn in a quad to be blended by alpha values already in the color buffer.

To clarify, say I've written out a mask of sorts into the alpha channel of the color buffer. Then I'm drawing a billboarded quad over the scene and I want the alpha value of each fragment of that quad to be multiplied by the alpha of the corresponding fragment in the color buffer.

Is this possible through the fixed function pipeline, or barring that, can a fragment program read from the color buffer ( specifically from the corresponding value in the color buffer )?

Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2
glBlendFunc(..... GL_DST_ALPHA .....);
Quote this message in a reply
Posts: 1,199
Joined: 2004.10
Post: #3
I'll be damned. I've wondered what GL_DST_ALPHA actually referred to, now I know. Thanks,
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL Alpha Channel Problem Moganza 1 5,067 Jan 19, 2013 08:25 AM
Last Post: sealfin
  passing values from vertex to fragment shader Sumaleth 6 14,604 Feb 18, 2011 01:54 AM
Last Post: Holmes
  Changing Pixel Values using CG LIPH700 1 5,523 Nov 25, 2010 03:17 PM
Last Post: SethWillits
  GLSL fragment program limits on GMA950 (MacBook) memon 12 12,091 Oct 26, 2007 05:18 PM
Last Post: arekkusu
  Reading texture colors values Leroy 6 5,881 Jul 24, 2007 10:06 PM
Last Post: Leroy