PoseStack was replaced with Matrix4fStack in Blaze3D / 1.20.6 Porting Attempt
gaberust opened this issue ยท 2 comments
I was attempting to port this over to 1.20.5/1.20.6, and noticed that RenderSystem.getModelViewStack() now returns a Matrix4fStack object instead of PoseStack. In fact, I think PoseStack has been removed from Blaze3D completely. I attempted to rewrite some of the transformation code in the RenderOutlines class:
Matrix4fStack matrixStack = RenderSystem.getModelViewStack();
matrixStack.pushMatrix();
if (canvasLoaded == 1) {
float f = (camera.getXRot()) * 0.017453292F;
matrixStack.rotateX(f);
f = (camera.getYRot() + 180f) * 0.017453292F;
matrixStack.rotateY(f);
}
RenderSystem.setShader(GameRenderer::getPositionColorShader);
RenderSystem.applyModelViewMatrix();
RenderSystem.depthFunc(GL11.GL_ALWAYS);
context.projectionMatrix().lookAt(cameraPos.toVector3f(), cameraPos.toVector3f().add(camera.getLookVector()), camera.getUpVector());
vertexBuffer.bind();
vertexBuffer.drawWithShader(matrixStack, new Matrix4f(context.projectionMatrix()), RenderSystem.getShader());
VertexBuffer.unbind();
RenderSystem.depthFunc(GL11.GL_LEQUAL);
matrixStack.popMatrix();
RenderSystem.applyModelViewMatrix();
Mathematically, this should be exactly the same as the PoseStack/Quaternion implementation, but for some reason the rotation is still off. (Lines do not render on target blocks and move when camera does)
Any luck with this/ similar results?