Browse Source

Code cleanup.

Lasse Öörni 13 years ago
parent
commit
52bf1bbd37
1 changed files with 8 additions and 8 deletions
  1. 8 8
      Engine/Graphics/View.cpp

+ 8 - 8
Engine/Graphics/View.cpp

@@ -456,17 +456,17 @@ void View::Render()
         graphics_->SetTexture(TU_INDIRECTION, renderer_->GetIndirectionCubeMap());
     }
     
-    // Set "view texture" to prevent destination texture sampling in case we do not render to the destination directly
-    // ie. when using deferred rendering and/or doing post-processing
+    // Set "view texture" to prevent destination texture sampling during all renderpasses
     if (renderTarget_)
+    {
         graphics_->SetViewTexture(renderTarget_->GetParentTexture());
-    
-    // On OpenGL, flip the projection if rendering to a texture so that the texture can be addressed in the same way
-    // as a render texture produced on Direct3D9
-    #ifdef USE_OPENGL
-    if (renderTarget_)
+        
+        // On OpenGL, flip the projection if rendering to a texture so that the texture can be addressed in the same way
+        // as a render texture produced on Direct3D9
+        #ifdef USE_OPENGL
         camera_->SetFlipVertical(true);
-    #endif
+        #endif
+    }
     
     // Render
     ExecuteRenderPathCommands();