Просмотр исходного кода

Bugfix: Shadows will now render properly when having multiple shadow casting lights in the scene

BearishSun 8 лет назад
Родитель
Сommit
b228c4d6ac

BIN
Data/Engine/Shaders/ShadowDepthCube.bsl.asset


BIN
Data/Engine/Shaders/ShadowDepthDirectional.bsl.asset


BIN
Data/Engine/Shaders/ShadowDepthNormal.bsl.asset


BIN
Data/Engine/Shaders/ShadowProjectOmni.bsl.asset


+ 3 - 17
Source/RenderBeast/BsShadowRendering.cpp

@@ -318,11 +318,6 @@ namespace bs { namespace ct
 			POOLED_RENDER_TEXTURE_DESC::create2D(SHADOW_MAP_FORMAT, size, size, TU_DEPTHSTENCIL));
 	}
 
-	ShadowMapAtlas::~ShadowMapAtlas()
-	{
-		GpuResourcePool::instance().release(mAtlas);
-	}
-
 	bool ShadowMapAtlas::addMap(UINT32 size, Rect2I& area, UINT32 border)
 	{
 		UINT32 sizeWithBorder = size + border * 2;
@@ -376,11 +371,6 @@ namespace bs { namespace ct
 			POOLED_RENDER_TEXTURE_DESC::createCube(SHADOW_MAP_FORMAT, size, size, TU_DEPTHSTENCIL));
 	}
 
-	ShadowCubemap::~ShadowCubemap()
-	{
-		GpuResourcePool::instance().release(mShadowMap);
-	}
-
 	SPtr<RenderTexture> ShadowCubemap::getTarget() const
 	{
 		return mShadowMap->renderTexture;
@@ -403,19 +393,15 @@ namespace bs { namespace ct
 		}
 	}
 
-	ShadowCascadedMap::~ShadowCascadedMap()
-	{
-		GpuResourcePool::instance().release(mShadowMap);
-	}
-
 	SPtr<RenderTexture> ShadowCascadedMap::getTarget(UINT32 cascadeIdx) const
 	{
 		return mTargets[cascadeIdx];
 	}
 
 	/** 
-	 * Provides a common for all types of shadow depth rendering to render the relevant objects into the depth map. Iterates
-	 * over all relevant objects in the scene, binds the relevant materials and renders the objects into the depth map.
+	 * Provides a common way for all types of shadow depth rendering to render the relevant objects into the depth map. 
+	 * Iterates over all relevant objects in the scene, binds the relevant materials and renders the objects into the depth
+	 * map.
 	 */
 	class ShadowRenderQueue
 	{

+ 0 - 3
Source/RenderBeast/BsShadowRendering.h

@@ -369,7 +369,6 @@ namespace bs { namespace ct
 	{
 	public:
 		ShadowMapAtlas(UINT32 size);
-		~ShadowMapAtlas();
 
 		/** 
 		 * Registers a new map in the shadow map atlas. Returns true if the map fits in the atlas, or false otherwise.
@@ -443,7 +442,6 @@ namespace bs { namespace ct
 	{
 	public:
 		ShadowCubemap(UINT32 size);
-		~ShadowCubemap();
 
 		/** Returns a render target encompassing all six faces of the shadow cubemap. */
 		SPtr<RenderTexture> getTarget() const;
@@ -454,7 +452,6 @@ namespace bs { namespace ct
 	{
 	public:
 		ShadowCascadedMap(UINT32 size);
-		~ShadowCascadedMap();
 
 		/** Returns a render target that allows rendering into a specific cascade of the cascaded shadow map. */
 		SPtr<RenderTexture> getTarget(UINT32 cascadeIdx) const;