示例#1
0
	void SkyLight::SetCastShadow(const bool& bCast)
	{
		Light::SetCastShadow(bCast);

		if(m_pMaterial)
		{
			m_pMaterial->SetCurrentTech(bCast ? "with_shadow" : "with_no_shadow");
		}
		
		if(bCast && m_pShadowMap == nullptr)
		{
			ResizeShadowMap();
		}

		if(bCast == false && m_pShadowMap != nullptr)
		{
			m_pShadowMap->Release();
			m_pShadowMap.reset();
		}
	}
示例#2
0
	bool SkyLight::Create(RenderManagerPtr pRenderManager)
	{
		m_pRenderManager = pRenderManager;

		m_pMaterial = pRenderManager->CreateMaterialFromFile("./assets/standard/material/dr_render_sky_light.material");
		
		if(m_pMaterial == nullptr)
		{
			return false;
		}

		//m_bCastShadow = true;
		
		if(false == m_pMaterial->SetCurrentTech(m_bCastShadow ? "with_shadow" : "with_no_shadow"))
		{
			return false;
		}

		if(m_bCastShadow)
		{
			ResizeShadowMap();
		}
		return true;
	}
示例#3
0
文件: Light.cpp 项目: johndragon/ld3d
	void Light::SetShadowMapSize(uint32 w, uint32 h)
	{
		m_shadowMapWidth = w;
		m_shadowMapHeight = h;
		ResizeShadowMap();
	}