Browse Source

Do not redirect final quad rendering to the backbuffer on OpenGL after rendertarget ping-ponging. Fixes #674.

Lasse Öörni 10 years ago
parent
commit
3feb6875fd
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Source/Urho3D/Graphics/View.cpp

+ 6 - 0
Source/Urho3D/Graphics/View.cpp

@@ -1483,7 +1483,13 @@ void View::ExecuteRenderPathCommands()
                 {
                     currentRenderTarget_ = viewportTextures_[1]->GetRenderSurface();
                     // If the render path ends into a quad, it can be redirected to the final render target
+                    // However, on OpenGL we can not reliably do this in case the final target is the backbuffer, and we want to
+                    // render depth buffer sensitive debug geometry afterward (backbuffer and textures can not share depth)
+                    #ifndef URHO3D_OPENGL
                     if (i == lastCommandIndex && command.type_ == CMD_QUAD)
+                    #else
+                    if (i == lastCommandIndex && command.type_ == CMD_QUAD && renderTarget_)
+                    #endif
                         currentRenderTarget_ = renderTarget_;
                 }
                 else