framebuffer copying with alpha?

Started by
2 comments, last by Rasmadrak 18 years, 8 months ago
Yeapp, the problem is as follows: I draw something to a separate buffer I "render to a texture" i.e copying the rendered buffer into a texture. problem: Its fully opaque... right now I mask the terrain using the stencil buffer, and draw the rendered texture, then draw the terrain again... it seems like a silly solution... :/ so... is it possible to draw shadows or reflections in a separate buffer and then draw it ontop of the terrain, and with the correct depth of the scene...?
"Game Maker For Life, probably never professional thou." =)
Advertisement
ok...

forget I posted...


Hopefully somebody will send me an angel carrying help... :D


are the auxilary buffers simply RGB buffers without alpha??
"Game Maker For Life, probably never professional thou." =)
I don't seew why do you render terrain twice. If you don't do complex lighting calculations based on if fragment is in shadow or not, then it is possible to render gray polygon over entire screen(you just use identity as modelview matrix) and modulate colors.

If you don't,then maybe shadow mapping would be more effective.

But back to you question. AUX buffers are legacy, they aren't widely supported either. If you want to render to texture,you should seiously consider implementing FBO (which is quite efficient)
Ok.. :)

the reason I'm doing a second "pass" is that I render reflections to an auxilary buffer, and then edit the texture coords for fake refraction...

But for some weird reason I can draw it after I've drawn the terrain, since it contains no alpha it overdraws everything.... so the reflection frame is from the previous frame... which isn't exactly what I want, because if the fps gets low enough, things look really ugly. :D
"Game Maker For Life, probably never professional thou." =)

This topic is closed to new replies.

Advertisement