< 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:34
Line coverage:100% (18 of 18)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:2
Method coverage:100% (2 of 2)

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 DCL.Shaders;
 3using UnityEngine;
 4using UnityEngine.Rendering;
 5
 6namespace DCL.Helpers
 7{
 8    public static class MaterialUtils
 9    {
 10        public static void SetOpaque(Material material)
 11        {
 7612            material.SetInt(ShaderUtils.SrcBlend, (int)BlendMode.One);
 7613            material.SetInt(ShaderUtils.DstBlend, (int)BlendMode.Zero);
 7614            material.SetInt(ShaderUtils.Surface, 0);
 7615            material.SetFloat(ShaderUtils.ZWrite, 1);
 7616            material.EnableKeyword("_ALPHATEST_ON");
 7617            material.DisableKeyword("_ALPHABLEND_ON");
 7618            material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
 7619            material.SetOverrideTag("RenderType", "TransparentCutout");
 7620        }
 21
 22        public static void SetTransparent(Material material)
 23        {
 3224            material.SetInt(ShaderUtils.SrcBlend, (int)BlendMode.SrcAlpha);
 3225            material.SetInt(ShaderUtils.DstBlend, (int)BlendMode.OneMinusSrcAlpha);
 3226            material.SetInt(ShaderUtils.Surface, 1);
 3227            material.SetFloat(ShaderUtils.ZWrite, 0);
 3228            material.DisableKeyword("_ALPHATEST_ON");
 3229            material.EnableKeyword("_ALPHABLEND_ON");
 3230            material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
 3231            material.SetOverrideTag("RenderType", "Transparent");
 3232        }
 33    }
 34}