Used by MeshRenderFeature to render a Rendering.Mesh.
Inheritance: Stride.Rendering.RenderObject
Beispiel #1
0
        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;
            }
        }