991060
07-22-2004, 05:23 PM
Hi all:
I'm using pbuffer as my rendertarget, and Cg for both vertex and fragment program. I found that alpha blending doesn't work properly in this situation. For example:
1. glBlendFunc(GL_ONE, GL_ZERO) gives correct result.
2. glBlendFunc(GL_ZERO, GL_ONE) gives black screen.
3. glBlendFunc(GL_ONE, GL_ONE) gives same result as 1.
4. glglBlendFunc(GL_DST_COLOR, GL_ZERO) gives black screen.
5. glBlendFunc(GL_ZERO, GL_SRC_COLOR) gives black screen.
It seems the content of the pbuffer is lost before alpha blending takes place, any idea why? Forgot to mention, I cleared the z-buffer after drawing the first pass, will this be a problem?
I'm using pbuffer as my rendertarget, and Cg for both vertex and fragment program. I found that alpha blending doesn't work properly in this situation. For example:
1. glBlendFunc(GL_ONE, GL_ZERO) gives correct result.
2. glBlendFunc(GL_ZERO, GL_ONE) gives black screen.
3. glBlendFunc(GL_ONE, GL_ONE) gives same result as 1.
4. glglBlendFunc(GL_DST_COLOR, GL_ZERO) gives black screen.
5. glBlendFunc(GL_ZERO, GL_SRC_COLOR) gives black screen.
It seems the content of the pbuffer is lost before alpha blending takes place, any idea why? Forgot to mention, I cleared the z-buffer after drawing the first pass, will this be a problem?