Example #1
0
 /// <summary>
 /// Adds the specified material (for collection Initializers).
 /// </summary>
 /// <param name="material">The mesh.</param>
 public void Add(MaterialInstance material)
 {
     Materials.Add(material);
 }
Example #2
0
        private void UpdateMaterial(RenderMesh renderMesh, Material materialOverride, MaterialInstance modelMaterialInstance, ModelComponent modelComponent)
        {
            renderMesh.Material = materialOverride ?? modelMaterialInstance?.Material ?? fallbackMaterial;

            renderMesh.IsShadowCaster   = modelComponent.IsShadowCaster;
            renderMesh.IsShadowReceiver = modelComponent.IsShadowReceiver;
            if (modelMaterialInstance != null)
            {
                renderMesh.IsShadowCaster   = renderMesh.IsShadowCaster && modelMaterialInstance.IsShadowCaster;
                renderMesh.IsShadowReceiver = renderMesh.IsShadowReceiver && modelMaterialInstance.IsShadowReceiver;
            }
        }
Example #3
0
 private Material FindMaterial(Material materialOverride, MaterialInstance modelMaterialInstance)
 {
     return(materialOverride ?? modelMaterialInstance?.Material ?? fallbackMaterial);
 }
Example #4
0
File: Model.cs Project: cg123/xenko
 /// <summary>
 /// Adds the specified material (for collection Initializers).
 /// </summary>
 /// <param name="material">The mesh.</param>
 public void Add(MaterialInstance material)
 {
     Materials.Add(material);
 }
Example #5
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;
            }
        }