mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-21 12:52:19 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99a81369f0 | ||
|
|
e2ee822948 | ||
|
|
9fe7e800f6 | ||
|
|
debfcdfda0 | ||
|
|
df662188f4 |
No files matched your search
@@ -371,9 +371,7 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
|
||||
private void reset() {
|
||||
if(!AngelicaConfig.enableIris || !ShadowRenderingState.areShadowsCurrentlyBeingRendered()) this.rebuildQueue.clear();
|
||||
if(!AngelicaConfig.enableIris || !ShadowRenderingState.areShadowsCurrentlyBeingRendered()) this.importantRebuildQueue.clear();
|
||||
|
||||
|
||||
this.sortQueue.clear();
|
||||
if(!AngelicaConfig.enableIris || !ShadowRenderingState.areShadowsCurrentlyBeingRendered()) this.sortQueue.clear();
|
||||
|
||||
this.visibleTileEntities.clear();
|
||||
|
||||
|
||||
+2
-13
@@ -5,6 +5,7 @@ import it.unimi.dsi.fastutil.ints.IntArrays;
|
||||
import me.jellysquid.mods.sodium.client.model.vertex.type.ChunkVertexType;
|
||||
import me.jellysquid.mods.sodium.client.render.chunk.format.hfp.HFPModelVertexType;
|
||||
import me.jellysquid.mods.sodium.client.render.chunk.format.sfp.SFPModelVertexType;
|
||||
import net.coderbot.iris.sodium.vertex_format.terrain_xhfp.XHFPModelVertexType;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
@@ -14,22 +15,10 @@ import java.util.BitSet;
|
||||
|
||||
public class ChunkBufferSorter {
|
||||
|
||||
private static final Class<?> OCULUS_VERTEX_TYPE;
|
||||
|
||||
static {
|
||||
Class<?> clz;
|
||||
try {
|
||||
clz = Class.forName("net.coderbot.iris.compat.sodium.impl.vertex_format.terrain_xhfp.XHFPModelVertexType");
|
||||
} catch(Throwable e) {
|
||||
clz = null;
|
||||
}
|
||||
OCULUS_VERTEX_TYPE = clz;
|
||||
}
|
||||
|
||||
public static void sortStandardFormat(ChunkVertexType vertexType, ByteBuffer buffer, int bufferLen, float x, float y, float z) {
|
||||
boolean isCompact;
|
||||
|
||||
if(vertexType.getClass() == HFPModelVertexType.class || vertexType.getClass() == OCULUS_VERTEX_TYPE) {
|
||||
if(vertexType.getClass() == HFPModelVertexType.class || vertexType.getClass() == XHFPModelVertexType.class) {
|
||||
isCompact = true;
|
||||
} else if(vertexType.getClass() == SFPModelVertexType.class) {
|
||||
isCompact = false;
|
||||
|
||||
+2
@@ -142,6 +142,8 @@ public class ChunkBuildBuffers implements ChunkBuildBuffersExt {
|
||||
|
||||
if (sortTranslucent && pass.isTranslucent()) {
|
||||
ChunkBufferSorter.sortStandardFormat(vertexType, buffer, bufferLen, x, y, z);
|
||||
meshData.clearSlices();
|
||||
meshData.setModelSlice(ModelQuadFacing.UNASSIGNED, new BufferSlice(0, bufferLen));
|
||||
}
|
||||
|
||||
meshData.setVertexData(new VertexData(buffer, this.vertexType.getCustomVertexFormat()));
|
||||
|
||||
@@ -17,6 +17,10 @@ public class ChunkMeshData {
|
||||
this.vertexData = vertexData;
|
||||
}
|
||||
|
||||
public void clearSlices() {
|
||||
this.parts.clear();
|
||||
}
|
||||
|
||||
public void setModelSlice(ModelQuadFacing facing, BufferSlice slice) {
|
||||
this.parts.put(facing, slice);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockRenderer {
|
||||
private static final BlockPos POS_ZERO = new BlockPos(0, 0, 0);
|
||||
|
||||
private final Random random = new XoRoShiRoRandom();
|
||||
|
||||
@@ -97,9 +98,10 @@ public class BlockRenderer {
|
||||
TessellatorManager.startCapturing();
|
||||
final CapturingTessellator tess = (CapturingTessellator) TessellatorManager.get();
|
||||
tess.startDrawingQuads();
|
||||
// RenderBlocks adds the subchunk-relative coordinates as the offset, cancel it out here
|
||||
|
||||
tess.setOffset(pos);
|
||||
// Use setTranslation rather than setOffset so that the float data written to the internal buffer
|
||||
// is done in subchunk-relative coordinates
|
||||
tess.setOffset(POS_ZERO);
|
||||
tess.setTranslation(-pos.x, -pos.y, -pos.z);
|
||||
renderBlocks.renderBlockByRenderType(block, pos.x, pos.y, pos.z);
|
||||
final List<QuadView> quads = TessellatorManager.stopCapturingToPooledQuads();
|
||||
tess.resetOffset();
|
||||
|
||||
Reference in new issue
Block a user