slightly faster bilinear interpolation #33
No files matched your search
+2
@@ -32,7 +32,9 @@ public class ChunkMeshBufferBuilder {
|
||||
}
|
||||
|
||||
public void push(ChunkVertexEncoder.Vertex[] vertices, Material material) {
|
||||
if (this.encoder.supportsBilinearCorrection()) {
|
||||
postprocessVertices(vertices);
|
||||
}
|
||||
|
||||
var vertexStart = this.count * this.stride;
|
||||
var vertexSize = vertices.length * this.stride;
|
||||
|
||||
+4
@@ -5,6 +5,10 @@ import org.embeddedt.embeddium.impl.render.chunk.terrain.material.Material;
|
||||
public interface ChunkVertexEncoder {
|
||||
long write(long ptr, Material material, Vertex vertex, int sectionIndex);
|
||||
|
||||
default boolean supportsBilinearCorrection() {
|
||||
return true;
|
||||
}
|
||||
|
||||
class Vertex {
|
||||
public float x;
|
||||
public float y;
|
||||
|
||||
+6
@@ -144,6 +144,11 @@ public class XHFPTerrainVertex implements ChunkVertexEncoder, ContextAwareChunkV
|
||||
this.ignoreMidBlock = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsBilinearCorrection() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long write(long ptr,
|
||||
Material material, Vertex vertex, int chunkId) {
|
||||
@@ -151,6 +156,7 @@ public class XHFPTerrainVertex implements ChunkVertexEncoder, ContextAwareChunkV
|
||||
vSum += vertex.v;
|
||||
vertexCount++;
|
||||
|
||||
vertex.rdhFactor = 0;
|
||||
this.baseEncoder.write(ptr, material, vertex, chunkId);
|
||||
|
||||
MemoryUtil.memPutShort(ptr + MC_ENTITY_OFFSET + 2, renderType);
|
||||
|
||||
Reference in new issue
Block a user