mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2025-01-01 16:53:01 +05:00
disable backface culling for detached car components
This commit is contained in:
parent
092a0deefd
commit
92952941f3
1 changed files with 11 additions and 0 deletions
|
@ -67,6 +67,14 @@ void CObject::Render()
|
||||||
SetEditableMaterialsCB(reinterpret_cast<RpAtomic*>(m_pRwObject), &pData);
|
SetEditableMaterialsCB(reinterpret_cast<RpAtomic*>(m_pRwObject), &pData);
|
||||||
pData->first = nullptr;
|
pData->first = nullptr;
|
||||||
|
|
||||||
|
// Disable backface culling for the part
|
||||||
|
#ifdef _DEBUG
|
||||||
|
RwCullMode oldCullMode;
|
||||||
|
RwRenderStateGet(rwRENDERSTATECULLMODE, &oldCullMode);
|
||||||
|
assert(oldCullMode == rwCULLMODECULLBACK);
|
||||||
|
#endif
|
||||||
|
RwRenderStateSet(rwRENDERSTATECULLMODE, reinterpret_cast<void*>(rwCULLMODECULLNONE));
|
||||||
|
|
||||||
bCallRestore = true;
|
bCallRestore = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -75,7 +83,10 @@ void CObject::Render()
|
||||||
CEntity::Render();
|
CEntity::Render();
|
||||||
|
|
||||||
if ( bCallRestore )
|
if ( bCallRestore )
|
||||||
|
{
|
||||||
ResetEditableMaterials(materialRestoreData);
|
ResetEditableMaterials(materialRestoreData);
|
||||||
|
RwRenderStateSet(rwRENDERSTATECULLMODE, reinterpret_cast<void*>(rwCULLMODECULLBACK));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RwCamera* CShadowCamera::Update(CEntity* pEntity)
|
RwCamera* CShadowCamera::Update(CEntity* pEntity)
|
||||||
|
|
Loading…
Reference in a new issue