raster fixes + cheap opts #40
No files matched your search
+1
-1
@@ -202,7 +202,7 @@ public final class RasterOccluder extends BoxOccluder {
|
|||||||
return SectionVisibility.VISIBLE;
|
return SectionVisibility.VISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tests are dilated by a pixel inside the rasterizer, so no world-space fuzz is needed
|
// no world-space fuzz: RenderableBounds already carries the model extent
|
||||||
if (isBoxVisible(bounds, 0)) {
|
if (isBoxVisible(bounds, 0)) {
|
||||||
return SectionVisibility.VISIBLE;
|
return SectionVisibility.VISIBLE;
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-2
@@ -24,7 +24,10 @@ final class RenderableBounds {
|
|||||||
return PackedBox.FULL_BOX;
|
return PackedBox.FULL_BOX;
|
||||||
}
|
}
|
||||||
|
|
||||||
return PackedBox.pack(this.minX, this.minY, this.minZ,
|
return PackedBox.pack(
|
||||||
this.maxX + 1, this.maxY + 1, this.maxZ + 1, PackedBox.RANGE_EXTREME);
|
Math.max(0, this.minX - 1), Math.max(0, this.minY - 1), Math.max(0, this.minZ - 1),
|
||||||
|
Math.min(16, this.maxX + 2), Math.min(16, this.maxY + 2), Math.min(16, this.maxZ + 2),
|
||||||
|
PackedBox.RANGE_EXTREME
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+5
@@ -71,6 +71,11 @@ public class SectionVisibilityBuilder {
|
|||||||
this.renderableBounds.mark(x & 15, y & 15, z & 15);
|
this.renderableBounds.mark(x & 15, y & 15, z & 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void markSectionRenderable() {
|
||||||
|
this.renderableBounds.mark(0, 0, 0);
|
||||||
|
this.renderableBounds.mark(SECTION_AXIS_MASK, SECTION_AXIS_MASK, SECTION_AXIS_MASK);
|
||||||
|
}
|
||||||
|
|
||||||
public int @Nullable [] computeOccluderBoxes() {
|
public int @Nullable [] computeOccluderBoxes() {
|
||||||
return dataFrom(this.blocks, this.renderableBounds);
|
return dataFrom(this.blocks, this.renderableBounds);
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-1
@@ -233,7 +233,13 @@ public class ChunkBuilderMeshingTask extends ChunkBuilderTask<ChunkBuildOutput>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MeshAppenderRenderer.renderMeshAppenders(renderContext.getMeshAppenders(), context.localSlice(), renderContext.getOrigin(), buffers);
|
var meshAppenders = renderContext.getMeshAppenders();
|
||||||
|
|
||||||
|
if (this.rasterOcclusion && !meshAppenders.isEmpty()) {
|
||||||
|
occluder.markSectionRenderable();
|
||||||
|
}
|
||||||
|
|
||||||
|
MeshAppenderRenderer.renderMeshAppenders(meshAppenders, context.localSlice(), renderContext.getOrigin(), buffers);
|
||||||
} catch (ReportedException ex) {
|
} catch (ReportedException ex) {
|
||||||
// Propagate existing crashes (add context)
|
// Propagate existing crashes (add context)
|
||||||
throw fillCrashInfo(ex.getReport(), slice, blockPos);
|
throw fillCrashInfo(ex.getReport(), slice, blockPos);
|
||||||
|
|||||||
Reference in new issue
Block a user