< Summary

Class:DCL.Helpers.MaterialUtils
Assembly:AvatarMeshCombiner
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/Avatar/AvatarMeshCombiner/MaterialUtils.cs
Covered lines:18
Uncovered lines:0
Coverable lines:18
Total lines:33
Line coverage:100% (18 of 18)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetOpaque(...)0%110100%
SetTransparent(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/Avatar/AvatarMeshCombiner/MaterialUtils.cs

#LineLine coverage
 1using DCL.Helpers;
 2using UnityEngine;
 3using UnityEngine.Rendering;
 4
 5namespace DCL.Helpers
 6{
 7    public static class MaterialUtils
 8    {
 9        public static void SetOpaque(Material material)
 10        {
 7811            material.SetInt(ShaderUtils.SrcBlend, (int)BlendMode.One);
 7812            material.SetInt(ShaderUtils.DstBlend, (int)BlendMode.Zero);
 7813            material.SetInt(ShaderUtils.Surface, 0);
 7814            material.SetFloat(ShaderUtils.ZWrite, 1);
 7815            material.EnableKeyword("_ALPHATEST_ON");
 7816            material.DisableKeyword("_ALPHABLEND_ON");
 7817            material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
 7818            material.SetOverrideTag("RenderType", "TransparentCutout");
 7819        }
 20
 21        public static void SetTransparent(Material material)
 22        {
 3123            material.SetInt(ShaderUtils.SrcBlend, (int)BlendMode.SrcAlpha);
 3124            material.SetInt(ShaderUtils.DstBlend, (int)BlendMode.OneMinusSrcAlpha);
 3125            material.SetInt(ShaderUtils.Surface, 1);
 3126            material.SetFloat(ShaderUtils.ZWrite, 0);
 3127            material.DisableKeyword("_ALPHATEST_ON");
 3128            material.EnableKeyword("_ALPHABLEND_ON");
 3129            material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
 3130            material.SetOverrideTag("RenderType", "Transparent");
 3131        }
 32    }
 33}