Skip to content

Commit ddd09a1

Browse files
authored
Change tabs to spaces in some hlsl string literals so the trunk formatter will stop complaining (#2741)
1 parent 8fe9772 commit ddd09a1

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalBlendNode.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public NormalBlendNode()
2020
name = "Normal Blend";
2121
}
2222

23-
2423
[SerializeField]
2524
private NormalBlendMode m_BlendMode = NormalBlendMode.Default;
2625

@@ -70,11 +69,11 @@ static string Unity_NormalBlend_Reoriented(
7069
{
7170
Out = Vector3.one;
7271
return
73-
@"
72+
@"
7473
{
75-
$precision3 t = A.xyz + $precision3(0.0, 0.0, 1.0);
76-
$precision3 u = B.xyz * $precision3(-1.0, -1.0, 1.0);
77-
Out = (t / t.z) * dot(t, u) - u;
74+
$precision3 t = A.xyz + $precision3(0.0, 0.0, 1.0);
75+
$precision3 u = B.xyz * $precision3(-1.0, -1.0, 1.0);
76+
Out = (t / t.z) * dot(t, u) - u;
7877
}
7978
";
8079
}

com.unity.shadergraph/Editor/Data/Nodes/Input/Gradient/BlackbodyNode.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using UnityEngine;
33

44
namespace UnityEditor.ShaderGraph
@@ -27,17 +27,17 @@ static string Unity_Blackbody(
2727
{
2828
Out = Vector3.zero;
2929
return
30-
@"
30+
@"
3131
{
3232
//based on data by Mitchell Charity http://www.vendian.org/mncharity/dir3/blackbody/
3333
$precision3 color = $precision3(255.0, 255.0, 255.0);
3434
color.x = 56100000. * pow(Temperature,(-3.0 / 2.0)) + 148.0;
3535
color.y = 100.04 * log(Temperature) - 623.6;
3636
if (Temperature > 6500.0) color.y = 35200000.0 * pow(Temperature,(-3.0 / 2.0)) + 184.0;
37-
color.z = 194.18 * log(Temperature) - 1448.6;
38-
color = clamp(color, 0.0, 255.0)/255.0;
37+
color.z = 194.18 * log(Temperature) - 1448.6;
38+
color = clamp(color, 0.0, 255.0)/255.0;
3939
if (Temperature < 1000.0) color *= Temperature/1000.0;
40-
Out = color;
40+
Out = color;
4141
}
4242
";
4343
}

com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/SphereMaskNode.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using UnityEngine;
33

44
namespace UnityEditor.ShaderGraph
@@ -11,7 +11,6 @@ public SphereMaskNode()
1111
name = "Sphere Mask";
1212
}
1313

14-
1514
protected override MethodInfo GetFunctionToConvert()
1615
{
1716
return GetType().GetMethod("SphereMask", BindingFlags.Static | BindingFlags.NonPublic);
@@ -25,9 +24,9 @@ static string SphereMask(
2524
[Slot(4, Binding.None)] out DynamicDimensionVector Out)
2625
{
2726
return
28-
@"
27+
@"
2928
{
30-
Out = 1 - saturate((distance(Coords, Center) - Radius) / (1 - Hardness));
29+
Out = 1 - saturate((distance(Coords, Center) - Radius) / (1 - Hardness));
3130
}
3231
";
3332
}

com.unity.shadergraph/Editor/Data/Nodes/Procedural/Shape/RoundedPolygonNode.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ static string RoundedPolygon_Func(
2525
[Slot(5, Binding.None)] out Vector1 Out)
2626
{
2727
return
28-
@"
28+
@"
2929
{
30-
UV = UV * 2. + $precision2(-1.,-1.);
30+
UV = UV * 2. + $precision2(-1.,-1.);
3131
$precision epsilon = 1e-6;
3232
UV.x = UV.x / ( Width + (Width==0)*epsilon);
3333
UV.y = UV.y / ( Height + (Height==0)*epsilon);
@@ -77,10 +77,10 @@ static string RoundedPolygon_Func(
7777
Out = UV.x;
7878
float chamferZone = ( halfAngle - polaruv.x ) < chamferAngle;
7979
Out = lerp( UV.x, polaruv.y / distC, chamferZone );
80-
// Output this to have the shape mask instead of the distance field
81-
Out = saturate((1 - Out) / fwidth(Out));
80+
// Output this to have the shape mask instead of the distance field
81+
Out = saturate((1 - Out) / fwidth(Out));
8282
}
8383
";
8484
}
8585
}
86-
}
86+
}

0 commit comments

Comments
 (0)