Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "Dependencies/CustomAssetMetadata"]
path = Dependencies/CustomAssetMetadata
url = https://github.com/LogicalError/CustomAssetMetadata.git
[submodule "Dependencies/BurstTriangulator"]
path = Dependencies/BurstTriangulator
url = https://github.com/RadicalCSG/BurstTriangulator.git
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Chisel is a Unity package. To work on it, put it in a Unity project as an embedd
`git submodule update --init` in it.
3. Open the project in Unity. The first time takes a while, because Burst compiles a lot of code.

The package's dependencies, BurstTriangulator and CustomAssetMetadata, are git submodules in `Dependencies`.
The package's dependency, CustomAssetMetadata, is a git submodule in `Dependencies`.

## Where things are

Expand Down
8 changes: 2 additions & 6 deletions Components/Managers/ChiselModelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -848,9 +848,8 @@ public static Hash128 GetComponentInputHash(ChiselModelComponent model)

/// <summary>
/// What both hashes have to cover and neither can see in the model: the version of the code that builds the
/// meshes, which of its two CSG algorithms builds them, and the helper materials <c>FinishMeshUpdates</c> hands
/// out, which no surface names. Without the code version a saved scene would keep meshes built by code that has
/// since changed, and without the algorithm meshes built by the other one.
/// meshes, and the helper materials <c>FinishMeshUpdates</c> hands out, which no surface names. Without the code
/// version a saved scene would keep meshes built by code that has since changed.
/// </summary>
static void AppendEnvironment(ref Hash128 hash)
{
Expand All @@ -861,9 +860,6 @@ static void AppendEnvironment(ref Hash128 hash)
}
hash.Append(ref s_CodeVersion);

int algorithm = CompactHierarchyManager.TreeUpdate.kExactCSG ? 1 : 0;
hash.Append(ref algorithm);

AppendMaterialIdentity(ref hash, ChiselProjectSettings.ForceShadowOnlySurfacesMaterial);
AppendMaterialIdentity(ref hash, ChiselProjectSettings.CollisionSurfacesMaterial);
var debugVisualizationMaterials = ChiselProjectSettings.DebugVisualizationMaterials;
Expand Down
4 changes: 2 additions & 2 deletions Core/2.Processing/CSGMath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public static float3 EdgePlaneCrossing(float3 v0, float3 v1, float d0, float d1)
public static double3 PlaneIntersection(double4 plane0, double4 plane1, double4 plane2)
=> PlaneExtensions.Intersection(plane0, plane1, plane2);

// One vertex-pair term of Newell's polygon-normal accumulation, in double. Matches
// CalculatePlaneNormal in PerformCSGJob. Accumulate over consecutive (prev,curr) verts, normalize.
// One vertex-pair term of Newell's polygon-normal accumulation, in double. Accumulate over consecutive
// (prev,curr) verts, normalize.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3 NewellTerm(float3 prev, float3 curr)
{
Expand Down
23 changes: 1 addition & 22 deletions Core/2.Processing/Cache/ChiselLookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ public class Data
public NativeList<MinMaxAABB> brushTreeSpaceBoundCache;
public NativeList<BlobAssetReference<BrushTreeSpacePlanes>> brushTreeSpacePlaneCache;
public NativeList<BlobAssetReference<BrushesTouchedByBrush>> brushesTouchedByBrushCache;
public NativeList<UnsafeList<float3>> loopVerticesCache;
// Each brush as the exact CSG sees it (ExactBrush: exact planes, corners, bounds), rebuilt when the brush
// changes (ExactInputJob). Only kept up to date while the tree is built exactly (builtExact).
// changes (ExactInputJob).
public NativeList<BlobAssetReference<ExactBrush>> exactBrushCache;

public NativeList<ChiselDecalInstance> decalInstances;
Expand All @@ -44,9 +43,6 @@ public class Data

public NativeParallelHashMap<CompactNodeID, BlobAssetReference<ChiselBrushRenderBuffer>> brushRenderBufferLookup;

// Whether the tree's output was last built by the exact CSG (TreeUpdate.kExactCSG). An update by the other
// algorithm rebuilds every brush of the tree, so the two never mix in one tree's output.
public bool builtExact;
// What each hotspot layout was at the last update (ChiselHotspotStore.LayoutHashes, by id - 1)
public NativeList<uint> hotspotLayoutHashes;
// Where the weld's last step moved the corners it moved at the last update (from, to; OutputModelWeld)
Expand Down Expand Up @@ -79,7 +75,6 @@ internal void Initialize()
brushTreeSpacePlaneCache = new NativeList<BlobAssetReference<BrushTreeSpacePlanes>>(1000, Allocator.Persistent); // Confirmed to get disposed
brushesTouchedByBrushCache = new NativeList<BlobAssetReference<BrushesTouchedByBrush>>(1000, Allocator.Persistent); // Confirmed to get disposed
brushRenderBufferCache = new NativeList<BlobAssetReference<ChiselBrushRenderBuffer>>(1000, Allocator.Persistent); // Confirmed to get disposed
loopVerticesCache = new NativeList<UnsafeList<float3>>(1000, Allocator.Persistent); // Confirmed to get disposed
exactBrushCache = new NativeList<BlobAssetReference<ExactBrush>>(1000, Allocator.Persistent);

decalInstances = new NativeList<ChiselDecalInstance>(16, Allocator.Persistent);
Expand Down Expand Up @@ -132,9 +127,6 @@ internal void EnsureCapacity(int brushCount)
if (brushRenderBufferCache.Capacity < brushCount)
brushRenderBufferCache.Capacity = brushCount;

if (loopVerticesCache.Capacity < brushCount)
loopVerticesCache.Capacity = brushCount;

if (exactBrushCache.Capacity < brushCount)
exactBrushCache.Capacity = brushCount;
}
Expand Down Expand Up @@ -235,18 +227,6 @@ internal void Dispose()
brushRenderBufferCache.Dispose();
}
brushRenderBufferCache = default;
if (loopVerticesCache.IsCreated)
{
for (int i = 0; i < loopVerticesCache.Length; i++)
{
if (loopVerticesCache[i].IsCreated)
loopVerticesCache[i].Dispose();
loopVerticesCache[i] = default;
}
loopVerticesCache.Clear();
loopVerticesCache.Dispose();
}
loopVerticesCache = default;
if (exactBrushCache.IsCreated)
{
for (int i = 0; i < exactBrushCache.Length; i++)
Expand Down Expand Up @@ -307,7 +287,6 @@ internal void Dispose()
if (brushRenderBufferLookup.IsCreated)
brushRenderBufferLookup.Dispose();
brushRenderBufferLookup = default;
builtExact = false;
}
}

Expand Down
242 changes: 0 additions & 242 deletions Core/2.Processing/Containers/InternedPlanes.cs

This file was deleted.

2 changes: 0 additions & 2 deletions Core/2.Processing/Containers/InternedPlanes.cs.meta

This file was deleted.

2 changes: 1 addition & 1 deletion Core/2.Processing/Exact/ExactFace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ int Route(ref ExactList<byte> inside, ref ExactList<ushort> routingRows, ref Exa
int row = lookupStart[k] + input;
if (row < lookupStart[k] || row >= lookupEnd[k])
{
// the same as PerformCSGJob: a lookup without a row for this input leaves the input as it is
// a lookup without a row for this input leaves the input as it is
routingErrors++;
continue;
}
Expand Down
Loading
Loading