Jump to content

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)


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)



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



Hope you like it and will be useful! ;)

Edited by Distraught
  • Metin2 Dev 1
  • Love 14

C++ programmer at Gameloft

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.