浏览代码

reordering and sorting of procedural nodes, created temp make shadergraph category and added nodes that should become shader graphs there. Fixed broken procedural nodes, added useful inputs, unified stylization

/main
Natalie Burke 7 年前
当前提交
f9118863
共有 35 个文件被更改,包括 254 次插入240 次删除
  1. 4
      MaterialGraphProject/Assets/NewNodes/Editor/Kill/AACheckerBoard3dNode.cs
  2. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/NoiseNode.cs
  3. 32
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/VoronoiNoise.cs
  4. 2
      MaterialGraphProject/Assets/NewNodes/Editor/Kill/CheckerboardNode.cs
  5. 2
      MaterialGraphProject/Assets/NewNodes/Editor/Kill/GradientRampNode.cs
  6. 4
      MaterialGraphProject/Assets/NewNodes/Editor/Kill/LineNode.cs
  7. 2
      MaterialGraphProject/Assets/NewNodes/Editor/Kill/PulseNode.cs
  8. 41
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/AACheckerBoardNode.cs
  9. 8
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph.meta
  10. 34
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/BoxNode.cs
  11. 41
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/FractalNode.cs
  12. 34
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/HexNode.cs
  13. 34
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/ParticleNode.cs
  14. 34
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/RepeatingDotNode.cs
  15. 38
      MaterialGraphProject/Assets/NewNodes/Editor/Kill/AACheckerBoardNode.cs
  16. 41
      MaterialGraphProject/Assets/NewNodes/Editor/FractalNode.cs
  17. 34
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/BoxNode.cs
  18. 34
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/HexNode.cs
  19. 33
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/ParticleNode.cs
  20. 33
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/RepeatingDotNode.cs
  21. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/AACheckerBoardNode.cs.meta
  22. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/FractalNode.cs.meta
  23. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/ParticleNode.cs.meta
  24. 0
      /MaterialGraphProject/Assets/NewNodes/Editor/Kill/LineNode.cs.meta
  25. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/HexNode.cs.meta
  26. 0
      /MaterialGraphProject/Assets/NewNodes/Editor/Kill/GradientRampNode.cs.meta
  27. 0
      /MaterialGraphProject/Assets/NewNodes/Editor/Kill/CheckerboardNode.cs.meta
  28. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/RepeatingDotNode.cs.meta
  29. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/BoxNode.cs.meta
  30. 0
      /MaterialGraphProject/Assets/NewNodes/Editor/Kill/PulseNode.cs.meta
  31. 0
      /MaterialGraphProject/Assets/NewNodes/Editor/Kill/CheckerboardNode.cs
  32. 0
      /MaterialGraphProject/Assets/NewNodes/Editor/Kill/GradientRampNode.cs
  33. 0
      /MaterialGraphProject/Assets/NewNodes/Editor/Kill/LineNode.cs
  34. 0
      /MaterialGraphProject/Assets/NewNodes/Editor/Kill/PulseNode.cs

4
MaterialGraphProject/Assets/NewNodes/Editor/Kill/AACheckerBoard3dNode.cs


namespace UnityEditor.ShaderGraph
{
[Title("Procedural/AACheckerboard3d")]
[Title("OLD/AACheckerboard3d")]
public class AACheckerboard3dNode : CodeFunctionNode
{
protected override MethodInfo GetFunctionToConvert()

float3 blend_out = saturate((scale - aaTweak.zzz) / (aaTweak.yyy - aaTweak.zzz));
float3 vectorAlpha = clamp(distance3 * scale.xyz * blend_out.xyz, -1.0f, 1.0f);
float alpha = saturate(0.5f + 0.5f * vectorAlpha.x * vectorAlpha.y * vectorAlpha.z);
result= lerp(colorA, colorB, alpha.xxxx);;
result= lerp(colorA, colorB, alpha.xxxx);
}";
}
}

9
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/NoiseNode.cs


}
static string Unity_Noise(
[Slot(0, Binding.MeshUV0)] Vector2 uv,
[Slot(1, Binding.None)] out Vector1 noise)
[Slot(0, Binding.MeshUV0)] Vector2 UV,
[Slot(1, Binding.None,500f,500f,500f,500f)] Vector1 Scale,
[Slot(2, Binding.None)] out Vector1 Out)
{
return
@"

{
float freq = pow(2.0, float(i));
float amp = pow(0.5, float(3-i));
t += unity_valueNoise(float2(uv.x/freq, uv.y/freq))*amp;
t += unity_valueNoise(float2(UV.x*Scale/freq, UV.y*Scale/freq))*amp;
noise = t;
Out = t;
}
";
}

32
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/VoronoiNoise.cs


namespace UnityEditor.ShaderGraph
{
[Title("Procedural/Voronoi Noise")]
[Title("Procedural/Voronoi")]
name = "VoronoiNoise";
name = "Voronoi";
}
protected override MethodInfo GetFunctionToConvert()

static string Unity_VoronoiNoise(
[Slot(0, Binding.MeshUV0)] Vector2 uv,
[Slot(1, Binding.None, 2.0f, 0, 0, 0)] Vector1 angleOffset,
[Slot(2, Binding.None)] out Vector1 n1,
[Slot(2, Binding.None)] out Vector1 n2,
[Slot(2, Binding.None)] out Vector1 n3)
[Slot(0, Binding.MeshUV0)] Vector2 UV,
[Slot(1, Binding.None, 2.0f, 0, 0, 0)] Vector1 AngleOffset,
[Slot(2, Binding.None,5.0f,5.0f,5.0f,5.0f)] Vector1 CellDensity,
[Slot(3, Binding.None)] out Vector1 Out,
[Slot(4, Binding.None)] out Vector1 Cells)
float2 g = floor(uv);
float2 f = frac(uv);
float2 g = floor(UV * CellDensity);
float2 f = frac(UV * CellDensity);
float t = 8.0;
float3 res = float3(8.0, 0.0, 0.0);

{
float2 lattice = float2(x,y);
float2 offset = unity_voronoi_noise_randomVector(lattice + g, angleOffset);
float2 offset = unity_voronoi_noise_randomVector(lattice + g, AngleOffset);
float d = distance(lattice + offset, f);
if(d < res.x)

n1 = res.x;
n2 = res.y;
n3 = 1.0 - res.x;
Out = res.x;
Cells = res.y;
}
";
}

var preamble = @"
inline float2 unity_voronoi_noise_randomVector (float2 uv, float offset)
inline float2 unity_voronoi_noise_randomVector (float2 UV, float offset)
uv = frac(sin(mul(uv, m)) * 46839.32);
return float2(sin(uv.y*+offset)*0.5+0.5, cos(uv.x*offset)*0.5+0.5);
UV = frac(sin(mul(UV, m)) * 46839.32);
return float2(sin(UV.y*+offset)*0.5+0.5, cos(UV.x*offset)*0.5+0.5);
}
";
visitor.AddShaderChunk(preamble, true);

2
MaterialGraphProject/Assets/NewNodes/Editor/Kill/CheckerboardNode.cs


namespace UnityEditor.ShaderGraph
{
[Title("Procedural/Checkerboard")]
[Title("OLD/Checkerboard")]
public class CheckerboardNode : CodeFunctionNode
{
public CheckerboardNode()

2
MaterialGraphProject/Assets/NewNodes/Editor/Kill/GradientRampNode.cs


namespace UnityEditor.ShaderGraph
{
[Title("Procedural/Gradient Ramp")]
[Title("OLD/Gradient Ramp")]
public class GradientRampNode : CodeFunctionNode
{
public GradientRampNode()

4
MaterialGraphProject/Assets/NewNodes/Editor/Kill/LineNode.cs


namespace UnityEditor.ShaderGraph
{
[Title("Procedural/Line")]
[Title("OLD/Line")]
public class LineNode : CodeFunctionNode
{
public LineNode()

{precision} t = dot(aTop, aTob) / dot(aTob, aTob);
t = clamp(t, 0.0, 1.0);
{precision} d = 1.0 / length(uv - (startPoint + aTob * t));
return clamp(d, 0.0, 1.0);
result = clamp(d, 0.0, 1.0);
}";
}
}

2
MaterialGraphProject/Assets/NewNodes/Editor/Kill/PulseNode.cs


namespace UnityEditor.ShaderGraph
{
[Title("Procedural/Pulse")]
[Title("OLD/Pulse")]
public class PulseNode : CodeFunctionNode
{
public PulseNode()

41
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/AACheckerBoardNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Procedural/Checkerboard")]
public class AACheckerboardNode : CodeFunctionNode
{
public AACheckerboardNode()
{
name = "Checkerboard";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_AACheckerboard", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_AACheckerboard(
[Slot(0, Binding.MeshUV0)] Vector2 UV,
[Slot(1, Binding.None, 0.2f, 0.2f, 0.2f, 0.2f)] Vector4 ColorA,
[Slot(2, Binding.None, 0.7f, 0.7f, 0.7f, 0.7f)] Vector4 ColorB,
[Slot(3, Binding.None, 1f, 1f, 1f, 1f)] Vector2 Frequency,
[Slot(4, Binding.None)] out Vector4 Out)
{
Out = Vector2.zero;
return
@"
{
float4 derivatives = float4(ddx(UV), ddy(UV));
float2 duv_length = sqrt(float2(dot(derivatives.xz, derivatives.xz), dot(derivatives.yw, derivatives.yw)));
float width = 0.5f;
float2 distance3 = 2.0f * abs(frac(UV.xy * Frequency) - 0.5f) - width;
float2 scale = 0.5 / duv_length.xy;
float2 blend_out = saturate(scale / 3);
float2 vector_alpha = clamp(distance3 * scale.xy * blend_out.xy, -1.0f, 1.0f);
float alpha = saturate(0.5f + 0.5f * vector_alpha.x * vector_alpha.y);
Out= lerp(ColorA, ColorB, alpha.xxxx);
}";
}
}
}

8
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph.meta


fileFormatVersion: 2
guid: 3323173d928867f4b901d95f61b2f490
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

34
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/BoxNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Procedural/MakeSubgraph/Square")]
public class BoxNode : CodeFunctionNode
{
public BoxNode()
{
name = "Square";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Boxnode", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Boxnode(
[Slot(0, Binding.MeshUV0)] Vector2 UV,
[Slot(1, Binding.None, 0.2f, 0.8f, 0, 0)] Vector2 XMinAndMax,
[Slot(2, Binding.None, 0.2f, 0.8f, 0, 0)] Vector2 YMinAndMax,
[Slot(3, Binding.None)] out Vector1 Out)
{
return
@"
{
{precision} x = step( XMinAndMax.x, UV.x ) - step( XMinAndMax.y, UV.x );
{precision} y = step( YMinAndMax.x, UV.y ) - step( YMinAndMax.y, UV.y );
Out = x * y;
}";
}
}
}

41
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/FractalNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Procedural/MakeSubgraph/Fractal")]
public class FractalNode : CodeFunctionNode
{
public FractalNode()
{
name = "Fractal";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Fractal", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Fractal(
[Slot(0, Binding.MeshUV0)] Vector2 UV,
[Slot(1, Binding.None, 0.5f, 0, 0, 0)] Vector2 Pan,
[Slot(2, Binding.None, 3, 0, 0, 0)] Vector1 Zoom,
[Slot(3, Binding.None, 0.9f, 0, 0, 0)] Vector1 Aspect,
[Slot(4, Binding.None)] out Vector1 Out)
{
return
@"
{
const int Iterations = 128;
float2 c = (UV - 0.5) * Zoom * float2(1, Aspect) - Pan;
float2 v = 0;
for (int n = 0; n < Iterations && dot(v,v) < 4; n++)
{
v = float2(v.x * v.x - v.y * v.y, v.x * v.y * 2) + c;
}
Out = (dot(v, v) > 4) ? (float)n / (float)Iterations : 0;
}
";
}
}
}

34
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/HexNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Procedural/MakeSubgraph/Hexagon")]
public class HexNode : CodeFunctionNode
{
public HexNode()
{
name = "Hexagon";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Hex", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Hex(
[Slot(0, Binding.MeshUV0)] Vector2 UV,
[Slot(1, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] Vector1 Scale,
[Slot(2, Binding.None)] out Vector1 Out)
{
return
@"
{
UV.y += fmod(floor(UV.x), 2.0) * 0.5;
UV = abs(frac(UV) - 0.5);
Out = step(1-Scale,abs(max(UV.x * 1.5 + UV.y, UV.y * 2.0) - 1.0));
}
";
}
}
}

34
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/ParticleNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Procedural/MakeSubgraph/Particle")]
public class ParticleNode : CodeFunctionNode
{
public ParticleNode()
{
name = "Particle";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Particle", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Particle(
[Slot(0, Binding.MeshUV0)] Vector2 UV,
[Slot(1, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] Vector2 Center,
[Slot(2, Binding.None, 100f, 100f, 100f, 100f)] Vector1 Sharpness,
[Slot(4, Binding.None)] out Vector1 Out)
{
return
@"
{
UV *= 2.0 - 1.0;
Out = abs(1.0/length((UV-Center) * Sharpness));
}
";
}
}
}

34
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/RepeatingDotNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Procedural/MakeSubgraph/Repeating Dot")]
public class RepeatingDotNode : CodeFunctionNode
{
public RepeatingDotNode()
{
name = "Repeating Dot";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Repreatingdot", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Repreatingdot(
[Slot(0, Binding.MeshUV0)] Vector2 UV,
[Slot(1, Binding.None, 4.0f, 4.0f, 4.0f, 4.0f)] Vector1 Count,
[Slot(2, Binding.None, 0.5f,0.5f,0.5f,0.5f)] Vector1 Radius,
[Slot(4, Binding.None)] out Vector1 Out)
{
return
@"
{
UV *= 2.0 - 1.0;
UV = fmod(UV * Count, 1.0) * 2.0 - 1.0;
Out = step(length(UV),Radius);
}";
}
}
}

38
MaterialGraphProject/Assets/NewNodes/Editor/Kill/AACheckerBoardNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Procedural/AACheckerboard")]
public class AACheckerboardNode : CodeFunctionNode
{
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_AACheckerboard", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_AACheckerboard(
[Slot(0, Binding.MeshUV0)] Vector2 uv,
[Slot(1, Binding.None, 0.2f, 0.2f, 0.2f, 0.2f)] Vector4 colorA,
[Slot(2, Binding.None, 0.7f, 0.7f, 0.7f, 0.7f)] Vector4 colorB,
[Slot(3, Binding.None, 0.5f, 3f, 0f, 0f)] Vector3 aaTweak,
[Slot(4, Binding.None, 1f, 1f, 1f, 1f)] Vector2 frequency,
[Slot(5, Binding.None)] out Vector4 result)
{
result = Vector2.zero;
return
@"
{
float4 derivatives = float4(ddx(uv), ddy(uv));
float2 duv_length = sqrt(float2(dot(derivatives.xz, derivatives.xz), dot(derivatives.yw, derivatives.yw)));
float width = 0.5f;
float2 distance3 = 2.0f * abs(frac(uv.xy * frequency) - 0.5f) - width;
float2 scale = aaTweak.x / duv_length.xy;
float2 blend_out = saturate((scale - aaTweak.zz) / (aaTweak.yy - aaTweak.zz));
float2 vector_alpha = clamp(distance3 * scale.xy * blend_out.xy, -1.0f, 1.0f);
float alpha = saturate(0.5f + 0.5f * vector_alpha.x * vector_alpha.y);
result= lerp(colorA, colorB, alpha.xxxx);
}";
}
}
}

41
MaterialGraphProject/Assets/NewNodes/Editor/FractalNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Procedural/Fractal")]
public class FractalNode : CodeFunctionNode
{
public FractalNode()
{
name = "Fractal";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Fractal", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Fractal(
[Slot(0, Binding.MeshUV0)] Vector2 uv,
[Slot(1, Binding.None, 0.5f, 0, 0, 0)] Vector2 pan,
[Slot(2, Binding.None, 3, 0, 0, 0)] Vector1 zoom,
[Slot(3, Binding.None, 0.9f, 0, 0, 0)] Vector1 aspect,
[Slot(4, Binding.None)] out Vector1 result)
{
return
@"
{
const int Iterations = 128;
float2 c = (uv - 0.5) * zoom * float2(1, aspect) - pan;
float2 v = 0;
for (int n = 0; n < Iterations && dot(v,v) < 4; n++)
{
v = float2(v.x * v.x - v.y * v.y, v.x * v.y * 2) + c;
}
result = (dot(v, v) > 4) ? (float)n / (float)Iterations : 0;
}
";
}
}
}

34
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/BoxNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Procedural/Box")]
public class BoxNode : CodeFunctionNode
{
public BoxNode()
{
name = "Box";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Boxnode", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Boxnode(
[Slot(0, Binding.None)] Vector2 xy,
[Slot(1, Binding.None)] Vector2 xMinAndMax,
[Slot(2, Binding.None)] Vector2 yMinAndMax,
[Slot(3, Binding.None)] out Vector1 result)
{
return
@"
{
{precision} x = step( xMinAndMax.x, xy.x ) - step( xMinAndMax.y, xy.x );
{precision} y = step( yMinAndMax.x, xy.y ) - step( yMinAndMax.y, xy.y );
result = x * y;
}";
}
}
}

34
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/HexNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Procedural/Hex")]
public class HexNode : CodeFunctionNode
{
public HexNode()
{
name = "Hex";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Hex", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Hex(
[Slot(0, Binding.MeshUV0)] Vector2 uv,
[Slot(1, Binding.None)] Vector1 thickness,
[Slot(2, Binding.None)] out Vector1 result)
{
return
@"
{
uv.y += fmod(floor(uv.x), 2.0) * 0.5;
uv = abs(frac(uv) - 0.5);
result = step(thickness, abs(max(uv.x * 1.5 + uv.y, uv.y * 2.0) - 1.0));
}
";
}
}
}

33
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/ParticleNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Procedural/Particle")]
public class ParticleNode : CodeFunctionNode
{
public ParticleNode()
{
name = "Particle";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Particle", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Particle(
[Slot(0, Binding.None)] Vector2 uv,
[Slot(1, Binding.None)] Vector1 scaleFactor,
[Slot(2, Binding.None)] out Vector1 result)
{
return
@"
{
uv = uv * 2.0 - 1.0;;
result = abs(1.0/length(uv * scaleFactor));
}
";
}
}
}

33
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/RepeatingDotNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Procedural/Repeating Dot")]
public class RepeatingDotNode : CodeFunctionNode
{
public RepeatingDotNode()
{
name = "RepeatingDot";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Repreatingdot", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Repreatingdot(
[Slot(0, Binding.None)] Vector2 uv,
[Slot(1, Binding.None)] Vector1 count,
[Slot(2, Binding.None)] out Vector1 result)
{
return
@"
{
uv *= 2.0 - 1.0;
uv = fmod(uv * count, 1.0) * 2.0 - 1.0;
result = length(uv);
}";
}
}
}

/MaterialGraphProject/Assets/NewNodes/Editor/Kill/AACheckerBoardNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/AACheckerBoardNode.cs.meta

/MaterialGraphProject/Assets/NewNodes/Editor/FractalNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/FractalNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/ParticleNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/ParticleNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/LineNode.cs.meta → /MaterialGraphProject/Assets/NewNodes/Editor/Kill/LineNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/HexNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/HexNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/GradientRampNode.cs.meta → /MaterialGraphProject/Assets/NewNodes/Editor/Kill/GradientRampNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/CheckerboardNode.cs.meta → /MaterialGraphProject/Assets/NewNodes/Editor/Kill/CheckerboardNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/RepeatingDotNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/RepeatingDotNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/BoxNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/MakeSubgraph/BoxNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/PulseNode.cs.meta → /MaterialGraphProject/Assets/NewNodes/Editor/Kill/PulseNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/CheckerboardNode.cs → /MaterialGraphProject/Assets/NewNodes/Editor/Kill/CheckerboardNode.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/GradientRampNode.cs → /MaterialGraphProject/Assets/NewNodes/Editor/Kill/GradientRampNode.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/LineNode.cs → /MaterialGraphProject/Assets/NewNodes/Editor/Kill/LineNode.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Procedural/PulseNode.cs → /MaterialGraphProject/Assets/NewNodes/Editor/Kill/PulseNode.cs

正在加载...
取消
保存