Jump to content

Recommended Posts

  • Premium

Hello devs!

I've a strange problem after a lot of refactors, I figured out it...

I can't see the shadow of my character. 

I can see all the shadows ONLY the one of myself isn't there.

 

Has it ever happened to you? Regards.

Link to comment
https://metin2.dev/topic/29698-strange-shadow-bug/
Share on other sites

  • 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
https://metin2.dev/topic/29698-strange-shadow-bug/#findComment-152448
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
https://metin2.dev/topic/29698-strange-shadow-bug/#findComment-152451
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.