コード例 #1
0
 /// <summary>
 /// Sets the shadow drawing states.
 /// </summary>
 /// <param name="faceGroup">The face group.</param>
 /// <param name="materialOverload">The material overload.</param>
 internal void SetShadowDrawingStates(FaceGroup faceGroup, TagGroupMaterialOverload materialOverload)
 {
     if (materialOverload.IsColorTint || materialOverload.Color == null)
     {
         DrawingManager.SetShadowMask(materialOverload.Mask.GetTarget() ?? faceGroup.Mask.GetTarget());
     }
     else
     {
         DrawingManager.SetShadowMask(null);
     }
 }
コード例 #2
0
        internal void SetDrawingStates(FaceGroup faceGroup, TagGroupMaterialOverload materialOverload)
        {
            var color = faceGroup.Material.Color;

            DrawingManager.SetColor((materialOverload.Color ?? color).ToDXColor4());
            DrawingManager.SetColorTintState(materialOverload.Color != null && materialOverload.IsColorTint);
            DrawingManager.SetOpacity(materialOverload.Opacity ?? faceGroup.Material.Opacity);
            DrawingManager.SetAmbient(faceGroup.Material.Ambient);
            DrawingManager.SetDiffuse(faceGroup.Material.Diffuse);
            DrawingManager.SetTextureAddressMode(faceGroup.Material.TextureAddressMode);

            if (materialOverload.IsColorTint || materialOverload.Color == null)
            {
                DrawingManager.SetTexture(materialOverload.Texture.GetTarget() ?? faceGroup.Texture.GetTarget());
                DrawingManager.SetMask(materialOverload.Mask.GetTarget() ?? faceGroup.Mask.GetTarget());
            }
            else
            {
                DrawingManager.SetTexture(null);
                DrawingManager.SetMask(null);
            }
        }