You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
1.1 KiB

using UnityEditor.Rendering.HighDefinition;
using static UnityEngine.Rendering.HighDefinition.HDMaterialProperties;
namespace UnityEngine.Rendering.HighDefinition
{
internal static class SixWayAPI
{
// All Validate functions must be static. It allows to automatically update the shaders with a script if code changes
internal static void ValidateMaterial(Material material)
{
BaseLitAPI.SetupBaseLitKeywords(material);
BaseLitAPI.SetupBaseLitMaterialPass(material);
BaseLitAPI.SetupStencil(material, receivesLighting: true, false, false);
if (material.HasProperty(kReceiveShadows))
{
bool receiveShadows = material.GetFloat(kReceiveShadows) > 0.0f;
CoreUtils.SetKeyword(material, "_RECEIVE_SHADOWS_OFF", !receiveShadows);
}
if (material.HasProperty(kUseColorAbsorption))
{
bool useColorAbsorption = material.GetFloat(kUseColorAbsorption) > 0.0f;
CoreUtils.SetKeyword(material, "_SIX_WAY_COLOR_ABSORPTION", useColorAbsorption);
}
}
}
}