导读:
本文转自
http://www.gamedev.net/community/forums/topic.asp?topic_id=463719
FBO and blending issue | |
djamelha Member since: 5/7/2007 | ||||
| ||||
Hi, Im trying to render my scene into a texture using a frame buffer object but the output doesnt seem to be getting blended properly. This is what the texture should look like (rendered without using the FBO): Normal_Rendering However when I try to render the scene using a FBO this is what I get: FBO_Rendering This is how I set up my FBO // Setup our FBO The particles are blended additively so I disable the depth test (which makes wonder if I even need to attach the depth buffer to the FBO). This is part of the code which draws the stars glBindTexture(GL_TEXTURE_2D, 0); If I increase the opacity of each particle to about 0.5 then way more particles are visible in the final image: FBO_with_more_opacity So I think the problem maybe is that a lot of particles are getting clamped to zero or something. Im realy stuck with this problem so any tips or help would be realy appreciated thanks. | ||||
|
dmatter Member since: 3/11/2004 From: Kettering, United Kingdom | ||||
| ||||
Have you remembered to disable blending when you render the final texture? Or made sure you render the textured quad with no alpha? | ||||
|
djamelha Member since: 5/7/2007 | |||
| |||
Wow, disabling blending works! Thanks a lot. But now I have another problem because my actually goal is to render the scene into multiple textures and then to blend these textured quads. So my next question is what settings do I need to blend the textured quads? The code I use at the moment to display one textured quad is: glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); and Im using glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); Again many thanks. | |||
|
本文转自
http://www.gamedev.net/community/forums/topic.asp?topic_id=463719