Jump to content

Strange shadow bug


Recommended Posts

  • Contributor

Maybe you messed something up around these?

PythonBackground.cpp

void CPythonBackground::RenderCharacterShadowToTexture()
{
	extern bool GRAPHICS_CAPS_CAN_NOT_DRAW_SHADOW;
	if (GRAPHICS_CAPS_CAN_NOT_DRAW_SHADOW)
		return;

	if (!IsMapReady())
		return;

	CMapOutdoor& rkMap = GetMapOutdoorRef();
	uint32_t t1 = ELTimer_GetMSec();

	if (m_eShadowLevel == SHADOW_ALL ||
		m_eShadowLevel == SHADOW_ALL_HIGH ||
		m_eShadowLevel == SHADOW_ALL_MAX ||
		m_eShadowLevel == SHADOW_GROUND_AND_SOLO)
	{
		D3DXMATRIX matWorld;
		STATEMANAGER.GetTransform(D3DTS_WORLD, &matWorld);

		bool canRender = rkMap.BeginRenderCharacterShadowToTexture();
		if (canRender)
		{
			CPythonCharacterManager& rkChrMgr = CPythonCharacterManager::Instance();

			if (m_eShadowLevel == SHADOW_GROUND_AND_SOLO)
				rkChrMgr.RenderShadowMainInstance();
			else
				rkChrMgr.RenderShadowAllInstances();
		}
		rkMap.EndRenderCharacterShadowToTexture();

		STATEMANAGER.SetTransform(D3DTS_WORLD, &matWorld);
	}

	uint32_t t2 = ELTimer_GetMSec();

	m_dwRenderShadowTime = t2 - t1;
}

PythonCharacterManager.cpp

void CPythonCharacterManager::RenderShadowMainInstance()
{
	CInstanceBase* pkInstMain = GetMainInstancePtr();
	if (pkInstMain)
		pkInstMain->RenderToShadowMap();
}

 

Have you tried only rendering your shadow and nothing else?

Edited by Amun
  • Love 1
Link to comment
Share on other sites

  • Premium
1 hour ago, Amun said:

Maybe you messed something up around these?

PythonBackground.cpp

void CPythonBackground::RenderCharacterShadowToTexture()
{
	extern bool GRAPHICS_CAPS_CAN_NOT_DRAW_SHADOW;
	if (GRAPHICS_CAPS_CAN_NOT_DRAW_SHADOW)
		return;

	if (!IsMapReady())
		return;

	CMapOutdoor& rkMap = GetMapOutdoorRef();
	uint32_t t1 = ELTimer_GetMSec();

	if (m_eShadowLevel == SHADOW_ALL ||
		m_eShadowLevel == SHADOW_ALL_HIGH ||
		m_eShadowLevel == SHADOW_ALL_MAX ||
		m_eShadowLevel == SHADOW_GROUND_AND_SOLO)
	{
		D3DXMATRIX matWorld;
		STATEMANAGER.GetTransform(D3DTS_WORLD, &matWorld);

		bool canRender = rkMap.BeginRenderCharacterShadowToTexture();
		if (canRender)
		{
			CPythonCharacterManager& rkChrMgr = CPythonCharacterManager::Instance();

			if (m_eShadowLevel == SHADOW_GROUND_AND_SOLO)
				rkChrMgr.RenderShadowMainInstance();
			else
				rkChrMgr.RenderShadowAllInstances();
		}
		rkMap.EndRenderCharacterShadowToTexture();

		STATEMANAGER.SetTransform(D3DTS_WORLD, &matWorld);
	}

	uint32_t t2 = ELTimer_GetMSec();

	m_dwRenderShadowTime = t2 - t1;
}

PythonCharacterManager.cpp

void CPythonCharacterManager::RenderShadowMainInstance()
{
	CInstanceBase* pkInstMain = GetMainInstancePtr();
	if (pkInstMain)
		pkInstMain->RenderToShadowMap();
}

 

Have you tried only rendering your shadow and nothing else?

Thanks very much for care in reply. Unfortunately it's not the problem.

I checked everything! I opened this thread hoping someone had this problem in past. I'll do more debug when have time and if solve will tell here.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.