mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-08-30 18:25:36 +00:00
Changes to rendering logic, incl water surface flicker fix, plus other fixes.
This commit changes a bunch of internal rendering logic to use FBOs in a way that doesn't violate the GL spec. The water surface FBO's output texture was bound for reading while at the same time rendering the water surface back into the same FBO! Depending on the card/driver/load/zoom factor/moon phase, this could lead to water surface flickering, chessboard effects, and other visual glitches. In order to fix this an extra FBO is needed. In theory this is a simple fix but in practice this is the Aquaria codebase and everything is more complicated than it has any right to be. Couple other things: - FBOs no longer have a depth renderbuffer. Aquaria never uses the depth buffer for anything, so this can go to save some memory. Also remove renderbuffer GL function pointers. - Make FBOs multi-"paged". This is supposedly more efficient on desktop GL, if glDrawBuffer() supports GL_COLOR_ATTACHMENTn. This is currently checked via the presence of glDrawBuffersARB(). - Main core FBO now has 2 pages becaus it's needed for the water surface. The same 2 pages are later used by the after effect manager to ping-pong postprocessing shaders. Remove private after effect FBO. TODO: - There's still a bug in the one-fbo-multiple-binding-points code path. -> for now glDrawBuffersARB must be NULL to work properly.
This commit is contained in:
parent
dd7ab0448f
commit
09edbf49fd
19 changed files with 608 additions and 390 deletions
|
@ -81,11 +81,12 @@ void ScreenTransition::reloadDevice()
|
|||
void ScreenTransition::capture()
|
||||
{
|
||||
assert(screen_texture);
|
||||
core->render();
|
||||
core->renderExternal();
|
||||
|
||||
if (screen_texture)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D,screen_texture);
|
||||
glReadBuffer(GL_BACK);
|
||||
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, windowWidth, windowHeight);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue