Used by MeshRenderFeature to render a Rendering.Mesh.
Inheritance: Stride.Rendering.RenderObject
コード例 #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;
            }
        }
コード例 #2
0
        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;
            }
        }