private void UpdateMaterial(RenderMesh renderMesh, MaterialPass materialPass, MaterialInstance modelMaterialInstance, ModelComponent modelComponent) { renderMesh.MaterialPass = materialPass; renderMesh.IsShadowCaster = modelComponent.IsShadowCaster; if (modelMaterialInstance != null) { renderMesh.IsShadowCaster = renderMesh.IsShadowCaster && modelMaterialInstance.IsShadowCaster; } }
private void UpdateMaterial(RenderMesh renderMesh, MaterialPass materialPass, MaterialInstance modelMaterialInstance, ModelComponent modelComponent) { renderMesh.MaterialPass = materialPass; var isShadowCaster = modelComponent.IsShadowCaster; if (modelMaterialInstance != null) { isShadowCaster &= modelMaterialInstance.IsShadowCaster; } if (isShadowCaster != renderMesh.IsShadowCaster) { renderMesh.IsShadowCaster = isShadowCaster; VisibilityGroup.NeedActiveRenderStageReevaluation = true; } }