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.
32 lines
1.2 KiB
32 lines
1.2 KiB
2 years ago
|
using System;
|
||
|
using UnityEditor.ShaderGraph;
|
||
|
using UnityEngine.Rendering;
|
||
|
|
||
|
namespace UnityEditor.Rendering.Universal.ShaderGraph
|
||
|
{
|
||
|
static class CreateLitShaderGraph
|
||
|
{
|
||
|
[MenuItem("Assets/Create/Shader Graph/URP/Lit Shader Graph", priority = CoreUtils.Priorities.assetsCreateShaderMenuPriority)]
|
||
|
public static void CreateLitGraph()
|
||
|
{
|
||
|
var target = (UniversalTarget)Activator.CreateInstance(typeof(UniversalTarget));
|
||
|
target.TrySetActiveSubTarget(typeof(UniversalLitSubTarget));
|
||
|
|
||
|
var blockDescriptors = new[]
|
||
|
{
|
||
|
BlockFields.VertexDescription.Position,
|
||
|
BlockFields.VertexDescription.Normal,
|
||
|
BlockFields.VertexDescription.Tangent,
|
||
|
BlockFields.SurfaceDescription.BaseColor,
|
||
|
BlockFields.SurfaceDescription.NormalTS,
|
||
|
BlockFields.SurfaceDescription.Metallic,
|
||
|
BlockFields.SurfaceDescription.Smoothness,
|
||
|
BlockFields.SurfaceDescription.Emission,
|
||
|
BlockFields.SurfaceDescription.Occlusion,
|
||
|
};
|
||
|
|
||
|
GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors);
|
||
|
}
|
||
|
}
|
||
|
}
|