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.
33 lines
1.3 KiB
33 lines
1.3 KiB
using System;
|
|
using UnityEditor.ShaderGraph;
|
|
using UnityEngine.Rendering;
|
|
|
|
namespace UnityEditor.Rendering.HighDefinition.ShaderGraph
|
|
{
|
|
static class CreateFabricShaderGraph
|
|
{
|
|
[MenuItem("Assets/Create/Shader Graph/HDRP/Fabric Shader Graph", priority = CoreUtils.Priorities.assetsCreateShaderMenuPriority + 2)]
|
|
public static void CreateFabricGraph()
|
|
{
|
|
var target = (HDTarget)Activator.CreateInstance(typeof(HDTarget));
|
|
target.TrySetActiveSubTarget(typeof(FabricSubTarget));
|
|
|
|
var blockDescriptors = new[]
|
|
{
|
|
BlockFields.VertexDescription.Position,
|
|
BlockFields.VertexDescription.Normal,
|
|
BlockFields.VertexDescription.Tangent,
|
|
BlockFields.SurfaceDescription.BaseColor,
|
|
BlockFields.SurfaceDescription.NormalTS,
|
|
HDBlockFields.SurfaceDescription.BentNormal,
|
|
BlockFields.SurfaceDescription.Smoothness,
|
|
BlockFields.SurfaceDescription.Occlusion,
|
|
BlockFields.SurfaceDescription.Specular,
|
|
BlockFields.SurfaceDescription.Emission,
|
|
BlockFields.SurfaceDescription.Alpha,
|
|
};
|
|
|
|
GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors);
|
|
}
|
|
}
|
|
}
|