Firstborn/Library/PackageCache/com.unity.render-pipelines..../Editor/Decal/CreateDecalShaderGraph.cs

31 lines
1.2 KiB
C#
Raw Normal View History

2023-03-28 13:24:16 -04:00
using System;
using UnityEditor.ShaderGraph;
using UnityEngine.Rendering;
namespace UnityEditor.Rendering.Universal.ShaderGraph
{
internal static class CreateDecalShaderGraph
{
[MenuItem("Assets/Create/Shader Graph/URP/Decal Shader Graph", priority = CoreUtils.Sections.section4 + CoreUtils.Priorities.assetsCreateShaderMenuPriority + 1)]
public static void CreateLitGraph()
{
var target = (UniversalTarget)Activator.CreateInstance(typeof(UniversalTarget));
target.TrySetActiveSubTarget(typeof(UniversalDecalSubTarget));
var blockDescriptors = new[]
{
BlockFields.SurfaceDescription.BaseColor,
BlockFields.SurfaceDescription.Alpha,
BlockFields.SurfaceDescription.NormalTS,
UniversalBlockFields.SurfaceDescription.NormalAlpha,
BlockFields.SurfaceDescription.Metallic,
BlockFields.SurfaceDescription.Occlusion,
BlockFields.SurfaceDescription.Smoothness,
UniversalBlockFields.SurfaceDescription.MAOSAlpha,
};
GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors);
}
}
}