diff --git a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/TranslucentGeometryCollector.java b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/TranslucentGeometryCollector.java index 64641fe513..ff10b90e8a 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/TranslucentGeometryCollector.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/TranslucentGeometryCollector.java @@ -161,10 +161,6 @@ public void appendQuad(ModelQuadView quadView, ChunkVertexEncoder.Vertex[] verti // POS_X, POS_Y, POS_Z, NEG_X, NEG_Y, NEG_Z float[] extents = new float[] { posXExtent, posYExtent, posZExtent, negXExtent, negYExtent, negZExtent }; - // TODO: does it make a difference if we compute the center as the average of - // the unique vertices or as the center of the extents? (the latter would be - // less work) - // TODO: some of these things should probably only be computed on demand, and an // allocation of a Quad object should be avoided AccumulationGroup accGroup; diff --git a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/bsp_tree/InnerPartitionBSPNode.java b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/bsp_tree/InnerPartitionBSPNode.java index d3b410ef61..8c3d10d52e 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/bsp_tree/InnerPartitionBSPNode.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/bsp_tree/InnerPartitionBSPNode.java @@ -11,19 +11,6 @@ import me.jellysquid.mods.sodium.client.model.quad.properties.ModelQuadFacing; /** - * TODO: - * - make partition finding more sophisticated by using distancesByNormal - * and other information. - * - pass partition information to child nodes instead of discarding if - * partition didn't work - * - detect many coplanar quads and avoid partitioning sorting alltogether. Try - * to partition so that large groups of coplanar quads are kept together and - * then not sorted at all. - * - sort the quads inside a node using the same heuristics as in the global - * level: convex hulls (like cuboids where the faces point outwards) don't need - * to be sorted. This could be used to optimize the inside of honey blocks, and - * other blocks. - * * Implementation note: * - Presorting the points in block-sized buckets doesn't help. It seems the * sort algorithm is just fast enough to handle this. @@ -78,9 +65,6 @@ record NodeReuseData(float[][] quadExtents, int[] indexes, int indexCount, int m static NodeReuseData prepareNodeReuse(BSPWorkspace workspace, IntArrayList indexes, int depth) { // if node reuse is enabled, only enable on the first level of children (not the // root node and not anything deeper than its children) - // TODO: more sophisticated reuse scheduling (make uset configurable, and only - // do once the section has been modified at least once already to avoid making - // this data on terrain sections that are never touched) if (workspace.prepareNodeReuse && depth == 1 && indexes.size() > NODE_REUSE_THRESHOLD) { // collect the extents of the indexed quads and hash them var quadExtents = new float[indexes.size()][]; @@ -325,7 +309,6 @@ static BSPNode build(BSPWorkspace workspace, IntArrayList indexes, int depth, BS // check a different axis if everything is in one quadsBefore, // which means there are no gaps if (quadsBefore != null && quadsBefore.size() == indexes.size()) { - // TODO: reuse the sorted point array for child nodes (add to workspace) continue; } @@ -356,14 +339,11 @@ static BSPNode build(BSPWorkspace workspace, IntArrayList indexes, int depth, BS partitions, axis, endsWithPlane); } - // TODO: attempt unaligned partitioning, convex decomposition, etc. - // test if the geometry intersects with itself // if there is self-intersection, return a multi leaf node to just give up // sorting this geometry. intersecting geometry is rare but when it does happen, // it should simply be accepted and rendered as-is. Whatever artifacts this // causes are considered "ok". - // TODO: also do this test with unaligned quads int testsRemaining = 10000; for (int quadAIndex = 0; quadAIndex < indexes.size(); quadAIndex++) { var quadA = workspace.quads[indexes.getInt(quadAIndex)]; diff --git a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/data/BSPDynamicData.java b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/data/BSPDynamicData.java index 093a9205d0..2e62d4ec66 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/data/BSPDynamicData.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/data/BSPDynamicData.java @@ -57,7 +57,6 @@ public static BSPDynamicData fromMesh(BuiltSectionMeshParts translucentMesh, dynamicData.sort(cameraPos); // prepare accumulation groups for integration into GFNI triggering - // TODO: combine this and the similar code in TopoSortDynamicData var aligned = result.getAlignedDistances(); if (aligned != null) { for (var accGroup : aligned) { diff --git a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/data/TopoSortDynamicData.java b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/data/TopoSortDynamicData.java index ac6cd80f13..4f7a990f95 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/data/TopoSortDynamicData.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/translucent_sorting/data/TopoSortDynamicData.java @@ -219,8 +219,7 @@ public static TopoSortDynamicData fromMesh(BuiltSectionMeshParts translucentMesh var distancesByNormal = new Object2ReferenceOpenHashMap(size); if (collector.getAlignedDistances() != null) { - for (int direction = 0; direction < ModelQuadFacing.DIRECTIONS; direction++) { - var accGroup = collector.getAlignedDistances()[direction]; + for (var accGroup : collector.getAlignedDistances()) { if (accGroup != null) { accGroup.prepareAndInsert(distancesByNormal); } @@ -228,7 +227,6 @@ public static TopoSortDynamicData fromMesh(BuiltSectionMeshParts translucentMesh } if (collector.getUnalignedDistanceCount() > 0) { for (var accGroup : collector.getUnalignedDistances()) { - // TODO: get rid of collector key and just use the normal vector's hash code accGroup.prepareAndInsert(distancesByNormal); } }