Jump to content
×
×
  • Create New...

Fix - Effect rendering bug on models with opacity when the effect is inside the model


Recommended Posts

There's a bug in the game if you have like an NPC and you set its opacity to less then 1.0 and attach effects to it and the effects are inside the model. The effect will not be rendered because the effect rendering is after character rendering so when it's stenciling it, it won't know what should be seen behind the model.

 

To fix this we just have to pre-render the effects in this case.

To achieve this add this code to the beginning of CActorInstance::OnRender

if (GetAlphaValue() < 1.0f)
{
	for (auto it = m_AttachingEffectList.begin(); it != m_AttachingEffectList.end(); ++it)
	{
		CEffectManager::Instance().SelectEffectInstance(it->dwEffectIndex);
		CEffectManager::Instance().RenderEffect();
	}
}

 

and add a new method to CEffectManager in EffectLib/EffectManager.h:

void RenderEffect();

and for sure define it in EffectManager.cpp

void CEffectManager::RenderEffect()
{
	if (!m_pSelectedEffectInstance)
		return;

	m_pSelectedEffectInstance->Render();
}

 

Now you can create eg. mounts with effects like this:

iv0e0zA.png

 

Hope you like it and will be useful! ;)

Edited by Distraught
  • Metin2 Dev 1
  • Love 14

WRnRW3H.gif

Link to comment
Share on other sites

  • 1 year later...
  • Moon

@ Distraught Thanks for the release, but it will make a visual bug in character select. You can see the select target on characters.

Screenshot:

Spoiler
https://ctrlv.cz/shots/2022/01/03/IF3w.png

 

 

I'll be always helpful! 👊 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 36

      Destroy Item System

    2. 1

      Brillances

    3. 0

      Fusion.org is Looking for Staff Members

    4. 1

      Brillances

    5. 3

      ELONIA2 | PVM-MEDIUM | 11 LANGUAGES | INTERNATIONAL | A NEW STORY

    6. 4

      Spider Queen not spawining in spider dungeon v1

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.