diff options
| author | yum <yum.food.vr@gmail.com> | 2026-02-16 16:32:00 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-02-16 16:36:24 -0800 |
| commit | 864c2ba12dc864d9cb55cb797ba8919bee5b5913 (patch) | |
| tree | aa6cd98a71e4ef05d23f762127d3759a4a3e3e21 /Scripts/Fold/Editor/FoldPipelineBuilder.cs | |
| parent | 6504b2c4631bab477838548167b88c1052eac263 (diff) | |
Add instancing distance culling, scale deformation
* GPU instance distance culling now takes a min/max range
* Fold recovers ops from material, allowing state to persist across
editor restarts
* Add scale node to vertex deformation framework
* Remove fold presets - dumb LLM idea, unused
* Drop more "undeform" code; unused, was for ray marching, which does
not work well
* Fix reflection energy compensation; was using cloth math, which makes
things too bright
Diffstat (limited to 'Scripts/Fold/Editor/FoldPipelineBuilder.cs')
| -rwxr-xr-x | Scripts/Fold/Editor/FoldPipelineBuilder.cs | 58 |
1 files changed, 12 insertions, 46 deletions
diff --git a/Scripts/Fold/Editor/FoldPipelineBuilder.cs b/Scripts/Fold/Editor/FoldPipelineBuilder.cs index 3731cf8..85a7a4f 100755 --- a/Scripts/Fold/Editor/FoldPipelineBuilder.cs +++ b/Scripts/Fold/Editor/FoldPipelineBuilder.cs @@ -58,6 +58,7 @@ public class FoldPipelineBuilder public const int FBM = 8; public const int PlaneToHemiOctahedron = 9; public const int HemiOctahedronToPlane = 10; + public const int Scale = 11; } FoldPipelineBuilder() { } @@ -109,6 +110,17 @@ public class FoldPipelineBuilder return this; } + public FoldPipelineBuilder Scale(Vector3 k, float t) + { + slots.Add(new FoldSlot + { + opcode = Opcodes.Scale, + vec0 = k, + float0 = t + }); + return this; + } + public FoldPipelineBuilder HemiOctahedronToPlane(Vector3 p, Vector3 r, Vector3 s, float t) { slots.Add(new FoldSlot @@ -236,49 +248,3 @@ public class FoldPipelineBuilder public int Count => slots.Count; } - -public static class FoldPresets -{ - public static void TubeToPlaneFull(Material mat) => - FoldPipelineBuilder.Create() - .For(mat) - .TubeToPlane(Vector3.zero, Vector3.right, Vector3.forward, 1f) - .Apply(); - - public static void PlaneToTubeFull(Material mat) => - FoldPipelineBuilder.Create() - .For(mat) - .PlaneToTube(Vector3.zero, Vector3.right, Vector3.forward, 1f) - .Apply(); - - public static void PlaneToHemiOctahedronFull(Material mat) => - FoldPipelineBuilder.Create() - .For(mat) - .PlaneToHemiOctahedron(Vector3.zero, Vector3.right, Vector3.forward, 1f) - .Apply(); - - public static void TubeToPlaneThenNormConv(Material mat) => - FoldPipelineBuilder.Create() - .For(mat) - .TubeToPlane(Vector3.zero, Vector3.right, Vector3.forward, 1f) - .NormConversion(2f, 1f, 1f) - .Apply(); - - public static void NormConvL1ToL2(Material mat) => - FoldPipelineBuilder.Create() - .For(mat) - .NormConversion(1f, 2f, 1f) - .Apply(); - - public static void NormConvL2ToL1(Material mat) => - FoldPipelineBuilder.Create() - .For(mat) - .NormConversion(2f, 1f, 1f) - .Apply(); - - public static void NormConvL2ToLinf(Material mat) => - FoldPipelineBuilder.Create() - .For(mat) - .NormConversion(2f, float.PositiveInfinity, 1f) - .Apply(); -} |
