A game about forced loneliness, made by TACStudios
at master 56 lines 1.8 kB view raw
1using System; 2using System.Collections.Generic; 3using UnityEditor; 4using UnityEditor.ShaderGraph; 5using UnityEditor.ShaderGraph.Legacy; 6 7namespace UnityEditor.Rendering.CustomRenderTexture.ShaderGraph 8{ 9 sealed class CustomTextureSubTarget : SubTarget<CustomRenderTextureTarget> 10 { 11 const string kAssetGuid = "5b2d4724a38a5485ba5e7dc2f7d86f1a"; // CustomTextureSubTarget.cs 12 13 internal static FieldDescriptor colorField = new FieldDescriptor(String.Empty, "Color", string.Empty); 14 15 public CustomTextureSubTarget() 16 { 17 isHidden = false; 18 displayName = "Custom Render Texture"; 19 } 20 21 public override bool IsActive() => true; 22 23 public override void Setup(ref TargetSetupContext context) 24 { 25 context.AddAssetDependency(new GUID(kAssetGuid), AssetCollection.Flags.SourceDependency); 26 context.AddSubShader(SubShaders.CustomRenderTexture); 27 } 28 29 public override void GetFields(ref TargetFieldContext context) 30 { 31 context.AddField(colorField, true); 32 } 33 34 public override void GetActiveBlocks(ref TargetActiveBlockContext context) 35 { 36 context.AddBlock(BlockFields.SurfaceDescription.BaseColor); 37 context.AddBlock(BlockFields.SurfaceDescription.Alpha); 38 } 39 40 public override void GetPropertiesGUI(ref TargetPropertyGUIContext context, Action onChange, Action<String> registerUndo) 41 { 42 } 43 44 static class SubShaders 45 { 46 public static SubShaderDescriptor CustomRenderTexture = new SubShaderDescriptor() 47 { 48 generatesPreview = true, 49 passes = new PassCollection 50 { 51 { FullscreePasses.CustomRenderTexture }, 52 }, 53 }; 54 } 55 } 56}