disable backface culling for detached car components

This commit is contained in:
Silent 2014-10-31 14:29:39 +01:00
parent 092a0deefd
commit 92952941f3

View file

@ -67,6 +67,14 @@ void CObject::Render()
SetEditableMaterialsCB(reinterpret_cast<RpAtomic*>(m_pRwObject), &pData);
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;
}
else
@ -75,7 +83,10 @@ void CObject::Render()
CEntity::Render();
if ( bCallRestore )
{
ResetEditableMaterials(materialRestoreData);
RwRenderStateSet(rwRENDERSTATECULLMODE, reinterpret_cast<void*>(rwCULLMODECULLBACK));
}
}
RwCamera* CShadowCamera::Update(CEntity* pEntity)