Browse Source

Code cleanup. Removed obsolete light shader variations from the variation name list.
Clear the destination stencil in OpenGL deferred rendering.

Lasse Öörni 14 years ago
parent
commit
ea081bf526
3 changed files with 6 additions and 21 deletions
  1. 4 4
      Engine/Graphics/Batch.cpp
  2. 1 17
      Engine/Graphics/Renderer.cpp
  3. 1 0
      Engine/Graphics/View.cpp

+ 4 - 4
Engine/Graphics/Batch.cpp

@@ -218,15 +218,15 @@ void Batch::Prepare(Graphics* graphics, const HashMap<ShaderParameter, Vector4>&
         
         if (graphics->NeedParameterUpdate(PSP_LIGHTVECROT, light_))
         {
-            Matrix3x4 light_VecRot;
+            Matrix3x4 lightVecRot;
             // Use original light if available (split lights)
             Light* original = light_->GetOriginalLight();
             if (!original)
-                light_VecRot = Matrix3x4(Vector3::ZERO, light_->GetWorldRotation(), Vector3::UNITY);
+                lightVecRot = Matrix3x4(Vector3::ZERO, light_->GetWorldRotation(), Vector3::UNITY);
             else
-                light_VecRot = Matrix3x4(Vector3::ZERO, original->GetWorldRotation(), Vector3::UNITY);
+                lightVecRot = Matrix3x4(Vector3::ZERO, original->GetWorldRotation(), Vector3::UNITY);
             
-            graphics->SetShaderParameter(PSP_LIGHTVECROT, light_VecRot);
+            graphics->SetShaderParameter(PSP_LIGHTVECROT, lightVecRot);
         }
         
         if (graphics->NeedParameterUpdate(PSP_SPOTPROJ, light_))

+ 1 - 17
Engine/Graphics/Renderer.cpp

@@ -234,23 +234,7 @@ static const String lightPSVariations[] =
     "OrthoPointMask",
     "OrthoPointMaskSpec",
     "OrthoPointMaskShadow",
-    "OrthoPointMaskShadowSpec",
-    "LinearDir",
-    "LinearDirSpec",
-    "LinearDirShadow",
-    "LinearDirShadowSpec",
-    "LinearSpot",
-    "LinearSpotSpec",
-    "LinearSpotShadow",
-    "LinearSpotShadowSpec",
-    "LinearPoint",
-    "LinearPointSpec",
-    "LinearPointShadow",
-    "LinearPointShadowSpec",
-    "LinearPointMask",
-    "LinearPointMaskSpec",
-    "LinearPointMaskShadow",
-    "LinearPointMaskShadowSpec"
+    "OrthoPointMaskShadowSpec"
 };
 
 static const unsigned INSTANCING_BUFFER_MASK = MASK_INSTANCEMATRIX1 | MASK_INSTANCEMATRIX2 | MASK_INSTANCEMATRIX3;

+ 1 - 0
Engine/Graphics/View.cpp

@@ -943,6 +943,7 @@ void View::RenderBatchesDeferred()
         graphics_->ResetRenderTarget(2);
         #endif
         graphics_->SetDepthStencil(lightDepthStencil);
+        graphics_->Clear(CLEAR_STENCIL);
         graphics_->SetTexture(TU_DIFFBUFFER, diffBuffer);
         graphics_->SetTexture(TU_DEPTHBUFFER, depthBuffer);
         graphics_->SetViewport(screenRect_);