Procházet zdrojové kódy

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

Lasse Öörni před 14 roky
rodič
revize
ea081bf526

+ 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_))
         if (graphics->NeedParameterUpdate(PSP_LIGHTVECROT, light_))
         {
         {
-            Matrix3x4 light_VecRot;
+            Matrix3x4 lightVecRot;
             // Use original light if available (split lights)
             // Use original light if available (split lights)
             Light* original = light_->GetOriginalLight();
             Light* original = light_->GetOriginalLight();
             if (!original)
             if (!original)
-                light_VecRot = Matrix3x4(Vector3::ZERO, light_->GetWorldRotation(), Vector3::UNITY);
+                lightVecRot = Matrix3x4(Vector3::ZERO, light_->GetWorldRotation(), Vector3::UNITY);
             else
             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_))
         if (graphics->NeedParameterUpdate(PSP_SPOTPROJ, light_))

+ 1 - 17
Engine/Graphics/Renderer.cpp

@@ -234,23 +234,7 @@ static const String lightPSVariations[] =
     "OrthoPointMask",
     "OrthoPointMask",
     "OrthoPointMaskSpec",
     "OrthoPointMaskSpec",
     "OrthoPointMaskShadow",
     "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;
 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);
         graphics_->ResetRenderTarget(2);
         #endif
         #endif
         graphics_->SetDepthStencil(lightDepthStencil);
         graphics_->SetDepthStencil(lightDepthStencil);
+        graphics_->Clear(CLEAR_STENCIL);
         graphics_->SetTexture(TU_DIFFBUFFER, diffBuffer);
         graphics_->SetTexture(TU_DIFFBUFFER, diffBuffer);
         graphics_->SetTexture(TU_DEPTHBUFFER, depthBuffer);
         graphics_->SetTexture(TU_DEPTHBUFFER, depthBuffer);
         graphics_->SetViewport(screenRect_);
         graphics_->SetViewport(screenRect_);