An editor-only ShaderGraph node that declares an output providing the render target size as a Vector2. It sets a custom title, category, icon, and node header color, and exposes a static NodeResult.Func returning a Vector2 named g_vRenderTargetSize.
namespace ShaderGraphPlus.Nodes;
/// <summary>
///
/// </summary>
[Title( "Render Target Size" ), Category( "Variables" ), Icon( "texture" )]
public sealed class RenderTargetSizeNode : ShaderNodePlus
{
[JsonIgnore, Hide, Browsable( false )]
public override Color NodeTitleColor => ShaderGraphPlusTheme.NodeHeaderColors.GlobalVariableNode;
[Output( typeof( Vector2 ) ), Title( "Render Target Size" )]
[Hide]
public static NodeResult.Func RenderTargetSize => ( GraphCompiler compiler ) => new( ResultType.Vector2, "g_vRenderTargetSize" );
}