예제 #1
0
        private void UpdateMaterial(RenderMesh renderMesh, MaterialPass materialPass, ModelComponent modelComponent)
        {
            renderMesh.MaterialPass = materialPass;

            renderMesh.IsShadowCaster        = modelComponent.IsShadowCaster;
            renderMesh.TransparentWriteDepth = modelComponent.AlwaysDepthWrite;
        }
예제 #2
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;
            }
        }
예제 #3
0
        private void UpdateMaterial(RenderMesh renderMesh, MaterialPass materialPass, MaterialInstance modelMaterialInstance, ModelComponent modelComponent)
        {
            renderMesh.MaterialPass = materialPass;

            renderMesh.IsShadowCaster        = modelComponent.IsShadowCaster;
            renderMesh.TransparentWriteDepth = modelComponent.AlwaysDepthWrite;
            if (modelMaterialInstance != null)
            {
                renderMesh.IsShadowCaster = renderMesh.IsShadowCaster && modelMaterialInstance.IsShadowCaster;
            }
        }
예제 #4
0
        /// <summary>
        /// Returns a new clone of this material
        /// </summary>
        /// <returns></returns>
        public Material Clone()
        {
            Material clone = new Material();

            clone.Descriptor = Descriptor;
            for (int i = 0; i < Passes.Count; i++)
            {
                MaterialPass p    = Passes[i];
                MaterialPass newp = new MaterialPass();
                newp.BlendState         = p.BlendState;
                newp.CullMode           = p.CullMode;
                newp.HasTransparency    = p.HasTransparency;
                newp.IsLightDependent   = p.IsLightDependent;
                newp.PassIndex          = p.PassIndex;
                newp.TessellationMethod = p.TessellationMethod;
                newp.Parameters         = new ParameterCollection(p.Parameters);
                clone.Passes.Add(newp);
            }
            return(clone);
        }