Initial commit

This commit is contained in:
2026-03-03 00:39:30 +05:00
commit fc01f07d9b
29933 changed files with 5353098 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
using UnityEditor.Graphing;
using UnityEditor.Rendering.UITK.ShaderGraph;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Input", "UI", "Element Layout UV")]
[SubTargetFilter(typeof(IUISubTarget))]
class ElementLayoutUV : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireUITK
{
public const int LayoutUVSlotId = 0;
private const string kLayoutUVSlotName = "Layout UV";
public override bool hasPreview { get { return false; } }
public ElementLayoutUV()
{
name = "Element Layout UV";
synonyms = new string[] {};
UpdateNodeAfterDeserialization();
}
public override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector2MaterialSlot(LayoutUVSlotId, kLayoutUVSlotName, kLayoutUVSlotName, SlotType.Output, Vector2.zero));
RemoveSlotsNameNotMatching(new[] { LayoutUVSlotId });
}
public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode)
{
if (GetInputNodeFromSlot(LayoutUVSlotId) != null) sb.AppendLine(string.Format("$precision2 {0} = IN.layoutUV.xy;", GetVariableNameForSlot(LayoutUVSlotId)));
}
public bool RequiresUITK(ShaderStageCapability stageCapability)
{
return true;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1c399b7101e358243b51be6c8482c892

View File

@@ -0,0 +1,62 @@
using UnityEditor.Graphing;
using UnityEditor.Rendering.UITK.ShaderGraph;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Input", "UI", "Element Texture Size")]
[SubTargetFilter(typeof(IUISubTarget))]
class ElementTextureUVSize : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireUITK
{
public const int TextureWidthSlotId = 0;
public const int TextureHeightSlotId = 1;
public const int TexelWidthSlotId = 2;
public const int TexelHeightSlotId = 3;
private const string kTextureWidthName = "Width";
private const string kTextureHeightName = "Height";
private const string kTexelWidthName = "Texel Width";
private const string kTexelHeightName = "Texel Height";
public override bool hasPreview { get { return false; } }
public ElementTextureUVSize()
{
name = "Element Texture Size";
synonyms = new string[] {};
UpdateNodeAfterDeserialization();
}
public override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector1MaterialSlot(TextureWidthSlotId, kTextureWidthName, kTextureWidthName, SlotType.Output, 0.0f));
AddSlot(new Vector1MaterialSlot(TextureHeightSlotId, kTextureHeightName, kTextureHeightName, SlotType.Output, 0.0f));
AddSlot(new Vector1MaterialSlot(TexelWidthSlotId, kTexelWidthName, kTexelWidthName, SlotType.Output, 0.0f));
AddSlot(new Vector1MaterialSlot(TexelHeightSlotId, kTexelHeightName, kTexelHeightName, SlotType.Output, 0.0f));
RemoveSlotsNameNotMatching(new[] { TextureWidthSlotId, TextureHeightSlotId, TexelWidthSlotId, TexelHeightSlotId });
}
public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode)
{
if ((GetInputNodeFromSlot(TextureWidthSlotId) != null) ||
(GetInputNodeFromSlot(TextureHeightSlotId) != null) ||
(GetInputNodeFromSlot(TexelWidthSlotId) != null) ||
(GetInputNodeFromSlot(TexelHeightSlotId) != null))
{
string variableName = string.Format("TextureInfo_{0}", objectId.ToString());
sb.AppendLine(string.Format("TextureInfo {0} = GetTextureInfo(IN.typeTexSettings.y);", variableName));
if (GetInputNodeFromSlot(TextureWidthSlotId) != null) sb.AppendLine(string.Format("$precision1 {0} = {1}.textureSize.x;", GetVariableNameForSlot(TextureWidthSlotId), variableName));
if (GetInputNodeFromSlot(TextureHeightSlotId) != null) sb.AppendLine(string.Format("$precision1 {0} = {1}.textureSize.y;", GetVariableNameForSlot(TextureHeightSlotId), variableName));
if (GetInputNodeFromSlot(TexelWidthSlotId) != null) sb.AppendLine(string.Format("$precision1 {0} = {1}.texelSize.x;", GetVariableNameForSlot(TexelWidthSlotId), variableName));
if (GetInputNodeFromSlot(TexelHeightSlotId) != null) sb.AppendLine(string.Format("$precision1 {0} = {1}.texelSize.y;", GetVariableNameForSlot(TexelHeightSlotId), variableName));
}
}
public bool RequiresUITK(ShaderStageCapability stageCapability)
{
return true;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2065162ee28baee4dbc14fccf4a6c3fd

View File

@@ -0,0 +1,40 @@
using UnityEditor.Graphing;
using UnityEditor.Rendering.UITK.ShaderGraph;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Input", "UI", "Element Texture UV")]
[SubTargetFilter(typeof(IUISubTarget))]
class ElementTextureUVNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireUITK
{
public const int TextureUVSlotId = 0;
private const string kTextureUVSlotName = "Texture UV";
public override bool hasPreview { get { return false; } }
public ElementTextureUVNode()
{
name = "Element Texture UV";
synonyms = new string[] {};
UpdateNodeAfterDeserialization();
}
public override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector2MaterialSlot(TextureUVSlotId, kTextureUVSlotName, kTextureUVSlotName, SlotType.Output, Vector2.zero));
RemoveSlotsNameNotMatching(new[] { TextureUVSlotId });
}
public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode)
{
if (GetInputNodeFromSlot(TextureUVSlotId) != null) sb.AppendLine(string.Format("$precision2 {0} = IN.uvClip.xy;", GetVariableNameForSlot(TextureUVSlotId)));
}
public bool RequiresUITK(ShaderStageCapability stageCapability)
{
return true;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 917ad6055d0c59f4aa7fe4ffa65b272a