Removed multiline variable declarations
このコミットが含まれているのは:
1 親
6fa7464f84
コミット
ee0d3a7b68
31ファイル変更
+182
-194
検索条件に一致するファイルはありません
@@ -31,7 +31,8 @@ internal readonly partial struct ExtrudedTruchetPattern : IComputeShader
|
||||
// Standard 2D rotation formula.
|
||||
private static float2x2 Rotate2x2(float a)
|
||||
{
|
||||
float c = Hlsl.Cos(a), s = Hlsl.Sin(a);
|
||||
float c = Hlsl.Cos(a);
|
||||
float s = Hlsl.Sin(a);
|
||||
|
||||
return new(c, -s, s, c);
|
||||
}
|
||||
@@ -153,12 +154,14 @@ internal readonly partial struct ExtrudedTruchetPattern : IComputeShader
|
||||
// Anyway, I like this one. I'm assuHlsl.Ming it's based on IQ's original.
|
||||
private float CalculateAO(in float3 p, in float3 n)
|
||||
{
|
||||
float sca = 2.0f, occ = 0.0f;
|
||||
float sca = 2.0f;
|
||||
float occ = 0.0f;
|
||||
|
||||
for (int i = (int)Hlsl.Min(time, 0f); i < 5; i++)
|
||||
{
|
||||
float hr = (i + 1f) * 0.15f / 5.0f;
|
||||
float d = M(p + n * hr);
|
||||
|
||||
occ += (hr - d) * sca;
|
||||
sca *= 0.7f;
|
||||
|
||||
@@ -184,16 +187,17 @@ internal readonly partial struct ExtrudedTruchetPattern : IComputeShader
|
||||
{
|
||||
int2 coords = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y);
|
||||
float2 u = (coords - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y;
|
||||
float3
|
||||
r = Hlsl.Normalize(new float3(u, 1)),
|
||||
o = new(0, time / 2.0f, -3),
|
||||
l = o + new float3(0.25f, 0.25f, 2.0f);
|
||||
float3 r = Hlsl.Normalize(new float3(u, 1));
|
||||
float3 o = new(0, time / 2.0f, -3);
|
||||
float3 l = o + new float3(0.25f, 0.25f, 2.0f);
|
||||
|
||||
r.YZ = Hlsl.Mul(Rotate2x2(0.15f), r.YZ);
|
||||
r.XZ = Hlsl.Mul(Rotate2x2(-Hlsl.Cos(time * 3.14159f / 32.0f) / 8.0f), r.XZ);
|
||||
r.XY = Hlsl.Mul(Rotate2x2(Hlsl.Sin(time * 3.14159f / 32.0f) / 8.0f), r.XY);
|
||||
|
||||
float d, t = Hash21(r.XY * 57.0f + Hlsl.Frac(time)) * 0.5f, glow = 0;
|
||||
float d;
|
||||
float t = Hash21(r.XY * 57.0f + Hlsl.Frac(time)) * 0.5f;
|
||||
float glow = 0;
|
||||
|
||||
for (int i = 0; i < 96; i++)
|
||||
{
|
||||
@@ -206,7 +210,8 @@ internal readonly partial struct ExtrudedTruchetPattern : IComputeShader
|
||||
}
|
||||
|
||||
int gObjID = objID;
|
||||
float3 p = o + r * t, n = Normal(p);
|
||||
float3 p = o + r * t;
|
||||
float3 n = Normal(p);
|
||||
float2 uv = p.XY;
|
||||
float sc = 0.5f;
|
||||
float2 iuv = Hlsl.Floor(uv / sc) + 0.5f;
|
||||
|
||||
@@ -20,7 +20,8 @@ internal readonly partial struct Octagrams : IComputeShader
|
||||
|
||||
private static float2x2 Rotate(float a)
|
||||
{
|
||||
float c = Hlsl.Cos(a), s = Hlsl.Sin(a);
|
||||
float c = Hlsl.Cos(a);
|
||||
float s = Hlsl.Sin(a);
|
||||
|
||||
return new(c, s, -s, c);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ internal readonly partial struct ProteanClouds : IComputeShader
|
||||
|
||||
private static float2x2 Rotate(in float a)
|
||||
{
|
||||
float c = Hlsl.Cos(a), s = Hlsl.Sin(a);
|
||||
float c = Hlsl.Cos(a);
|
||||
float s = Hlsl.Sin(a);
|
||||
|
||||
return new(c, s, -s, c);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ internal readonly partial struct PyramidPattern : IComputeShader
|
||||
// Standard 2D rotation formula.
|
||||
private static float2x2 Rotate2x2(in float a)
|
||||
{
|
||||
float c = Hlsl.Cos(a), s = Hlsl.Sin(a);
|
||||
float c = Hlsl.Cos(a);
|
||||
float s = Hlsl.Sin(a);
|
||||
|
||||
return new(c, -s, s, c);
|
||||
}
|
||||
@@ -146,9 +147,8 @@ internal readonly partial struct PyramidPattern : IComputeShader
|
||||
float2 oP = p;
|
||||
float m = BMap(p);
|
||||
float3 n = new(0, 0, -1);
|
||||
float
|
||||
edge = 0.0f,
|
||||
bumpFactor = 0.25f;
|
||||
float edge = 0.0f;
|
||||
float bumpFactor = 0.25f;
|
||||
|
||||
n = DoBumpMap(p, n, bumpFactor, ref edge);
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@ internal readonly partial struct TriangleGridContouring : IComputeShader
|
||||
// Standard 2D rotation formula.
|
||||
private static float2x2 Rotate2x2(in float a)
|
||||
{
|
||||
float c = Hlsl.Cos(a), s = Hlsl.Sin(a);
|
||||
float c = Hlsl.Cos(a);
|
||||
float s = Hlsl.Sin(a);
|
||||
|
||||
return new(c, -s, s, c);
|
||||
}
|
||||
@@ -162,12 +163,11 @@ internal readonly partial struct TriangleGridContouring : IComputeShader
|
||||
p -= s - (s.X + s.Y) * 0.211324865f;
|
||||
|
||||
float i = p.X < p.Y ? 1.0f : 0.0f;
|
||||
float2
|
||||
ioffs = new(1.0f - i, i),
|
||||
ip0 = 0,
|
||||
ip1 = ioffs - 0.2113248654f,
|
||||
ip2 = 0.577350269f,
|
||||
ctr = (ip0 + ip1 + ip2) / 3.0f;
|
||||
float2 ioffs = new(1.0f - i, i);
|
||||
float2 ip0 = 0;
|
||||
float2 ip1 = ioffs - 0.2113248654f;
|
||||
float2 ip2 = 0.577350269f;
|
||||
float2 ctr = (ip0 + ip1 + ip2) / 3.0f;
|
||||
|
||||
ip0 -= ctr;
|
||||
ip1 -= ctr;
|
||||
@@ -180,15 +180,14 @@ internal readonly partial struct TriangleGridContouring : IComputeShader
|
||||
n3.Y = IsoFunction(s + ioffs);
|
||||
n3.Z = IsoFunction(s + 1.0f);
|
||||
|
||||
float
|
||||
d = 1e5f,
|
||||
d2 = 1e5f,
|
||||
d3 = 1e5f,
|
||||
d4 = 1e5f,
|
||||
d5 = 1e5f;
|
||||
|
||||
float d = 1e5f;
|
||||
float d2 = 1e5f;
|
||||
float d3 = 1e5f;
|
||||
float d4 = 1e5f;
|
||||
float d5 = 1e5f;
|
||||
float isovalue = 0;
|
||||
float2 p0 = default, p1 = default;
|
||||
float2 p0 = default;
|
||||
float2 p1 = default;
|
||||
int iTh = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1);
|
||||
|
||||
d = Hlsl.Min(d, distEdge(p - p0, p - p1));
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする