mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-03 21:29:06 +01:00
Make the BatchingEngine not jittery
- Stop having threads compete for a single BufferBuilder - ...by skirting around minecraft's BufferSource - Begin work on making vertex writing sane
This commit is contained in:
parent
5f46560fb2
commit
aa96a28f0b
3 changed files with 7 additions and 15 deletions
|
@ -4,9 +4,7 @@ import com.jozufozu.flywheel.api.Instancer;
|
|||
import com.jozufozu.flywheel.api.MaterialGroup;
|
||||
import com.jozufozu.flywheel.api.MaterialManager;
|
||||
import com.jozufozu.flywheel.api.instance.ITickableInstance;
|
||||
import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat;
|
||||
import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance;
|
||||
import com.jozufozu.flywheel.core.Formats;
|
||||
import com.jozufozu.flywheel.core.Materials;
|
||||
import com.jozufozu.flywheel.core.instancing.ConditionalInstance;
|
||||
import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
|
||||
|
@ -103,7 +101,6 @@ public class GlueInstance extends EntityInstance<SuperGlueEntity> implements ITi
|
|||
return "glue";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buffer(VertexConsumer buffer) {
|
||||
Vec3 diff = Vec3.atLowerCornerOf(Direction.SOUTH.getNormal());
|
||||
Vec3 extension = diff.normalize()
|
||||
|
@ -162,11 +159,6 @@ public class GlueInstance extends EntityInstance<SuperGlueEntity> implements ITi
|
|||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VertexFormat format() {
|
||||
return Formats.UNLIT_MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelReader getReader() {
|
||||
return this;
|
||||
|
|
|
@ -62,7 +62,7 @@ public class FlwContraptionManager extends ContraptionRenderManager<RenderedCont
|
|||
RenderLayer renderLayer = event.getLayer();
|
||||
if (renderLayer != null) {
|
||||
for (RenderedContraption renderer : visible) {
|
||||
renderer.engine.render(event, event.buffers.bufferSource());
|
||||
renderer.engine.render(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package com.simibubi.create.foundation.render;
|
||||
|
||||
import com.jozufozu.flywheel.util.BufferBuilderReader;
|
||||
import com.jozufozu.flywheel.util.BlockFormatReader;
|
||||
import com.jozufozu.flywheel.util.ModelReader;
|
||||
import com.jozufozu.flywheel.util.RenderMath;
|
||||
import com.jozufozu.flywheel.util.transform.Rotate;
|
||||
import com.jozufozu.flywheel.util.transform.Scale;
|
||||
import com.jozufozu.flywheel.util.transform.TStack;
|
||||
|
@ -63,12 +62,9 @@ public class SuperByteBuffer implements Scale<SuperByteBuffer>, Translate<SuperB
|
|||
|
||||
// Temporary
|
||||
private static final Long2IntMap WORLD_LIGHT_CACHE = new Long2IntOpenHashMap();
|
||||
private final Vector4f pos = new Vector4f();
|
||||
private final Vector3f normal = new Vector3f();
|
||||
private final Vector4f lightPos = new Vector4f();
|
||||
|
||||
public SuperByteBuffer(BufferBuilder buf) {
|
||||
template = new BufferBuilderReader(buf);
|
||||
template = new BlockFormatReader(buf);
|
||||
transforms = new PoseStack();
|
||||
transforms.pushPose();
|
||||
}
|
||||
|
@ -107,6 +103,10 @@ public class SuperByteBuffer implements Scale<SuperByteBuffer>, Translate<SuperB
|
|||
WORLD_LIGHT_CACHE.clear();
|
||||
}
|
||||
|
||||
final Vector4f pos = new Vector4f();
|
||||
final Vector3f normal = new Vector3f();
|
||||
final Vector4f lightPos = new Vector4f();
|
||||
|
||||
float f = .5f;
|
||||
int vertexCount = template.getVertexCount();
|
||||
for (int i = 0; i < vertexCount; i++) {
|
||||
|
|
Loading…
Reference in a new issue