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.
24 lines
909 B
24 lines
909 B
using System;
|
|
using UnityEditor.ShaderGraph;
|
|
using UnityEngine.Rendering;
|
|
|
|
namespace UnityEditor.Rendering.CustomRenderTexture.ShaderGraph
|
|
{
|
|
public static class CustomTextureShaderGraphMenu
|
|
{
|
|
[MenuItem("Assets/Create/Shader Graph/Custom Render Texture", priority = CoreUtils.Sections.section3 + CoreUtils.Priorities.assetsCreateShaderMenuPriority)]
|
|
public static void CreateCustomTextureShaderGraph()
|
|
{
|
|
var target = (CustomRenderTextureTarget)Activator.CreateInstance(typeof(CustomRenderTextureTarget));
|
|
target.TrySetActiveSubTarget(typeof(CustomTextureSubTarget));
|
|
|
|
var blockDescriptors = new[]
|
|
{
|
|
BlockFields.SurfaceDescription.BaseColor,
|
|
BlockFields.SurfaceDescription.Alpha,
|
|
};
|
|
|
|
GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors);
|
|
}
|
|
}
|
|
}
|