The bug
The Overworld sky previously rendered on both the top and the bottom of the world, with the lower portion having a much more pronounced color. This lower half no longer appears to render at all.
Testing reveals that it stopped rendering in version 1.10-pre1. Reading archived changelogs for this version do not appear to list it among the changes, making its "removal" potentially accidental.
How to reproduce
Create a superflat world using "The Void" preset
Observe
Expected results
There would be an upper sky and a lower sky.
Actual results
There is only an upper sky in versions 1.10pre1 onwards.
Linked issues
is duplicated by 1
Attachments
Comments 7
I had to change it a bit because in 1.13/1.14 the code was still using old non-vbo code, so I figured out how to update it to use modern vbos
NOTE: I updated this comment with my new updated code for 1.21.2
heres my code snipped (Using YARN, Fabric 1.20.5)
// Depth is the camera pos vec y minus the world horizon height
// skyColor is from world.getSkyColor
if (depth >= 0.0) {
ShaderProgram shaderProgram = RenderSystem.setShader(ShaderProgramKeys.POSITION);
Vector3f skyColorVec = ColorHelper.toVector(skyColor);
if (this.world.getDimensionEffects().isAlternateSkyColor()) {
RenderSystem.setShaderColor(skyColorVec.x * 0.2F + 0.04F, skyColorVec.y * 0.2F + 0.04F, skyColorVec.z * 0.6F + 0.1F, 1.0F);
} else {
RenderSystem.setShaderColor(skyColorVec.x, skyColorVec.y, skyColorVec.z, 1.0F);
}
matrixStack.push();
matrixStack.multiplyPositionMatrix(RenderSystem.getModelViewMatrix());
matrixStack.translate(0.0F, -((float) (depth - 16.0)), 0.0F);
this.skyRendering.darkSkyBuffer.bind();
this.skyRendering.darkSkyBuffer.draw(matrixStack.peek().getPositionMatrix(), RenderSystem.getProjectionMatrix(), shaderProgram);
VertexBuffer.unbind();
matrixStack.pop();
}
Also to note for affected versions, it would affect every version 1.14/1.15+
This is because in 1.13 and below, there was a toggle known as "VBOs" which you could disable/enable in Video Settings. This sky would only show if VBOs were turned off, because that was how it was coded unfortunately.
Ever since 1.14 though, that setting was removed and starting with 1.15 (the massive render update), the concept of VBOs being OFF was removed in all of the code, making VBOs be forced always ON and be the default.
The code I have put below would return this sky, it would function exactly how it did back then. This is just to note tho on how it worked and what happend.
Here is the updated code for 1.21.4+ (using Mojmap mappings)
Depth is:
int depth = this.minecraft.player.getEyePosition(tickDelta).y - this.level.getLevelData().getHorizonHeight(this.level)
Sky Color Integer is:
int skyColor = this.level.getSkyColor(this.minecraft.gameRenderer.getMainCamera().getPosition(), f);
Vector3f skyColorVec = ARGB.vector3fFromRGB24(skyColor);
if (this.level.effects().hasGround()) {
RenderSystem.setShaderColor(skyColorVec.x * 0.2F + 0.04F, skyColorVec.y * 0.2F + 0.04F, skyColorVec.z * 0.6F + 0.1F, 1.0F);
} else {
RenderSystem.setShaderColor(skyColorVec.x, skyColorVec.y, skyColorVec.z, 1.0F);
}
Matrix4fStack modelViewStack = RenderSystem.getModelViewStack();
modelViewStack.pushMatrix();
modelViewStack.translate(0.0F, -((float) (depth - 16.0)), 0.0F);
this.bottomSkyBuffer.drawWithRenderType(RenderType.sky());
modelViewStack.popMatrix();
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
NOTE: This should be called/happen at the end after SkyRenderer#renderDarkDisc in LevelRenderer#renderSky
You can still get this sky in 1.13 by disabling VBOs, ever since 1.14, VBOs have been on by default & the toggle was removed, and in 1.15 the option/code to disable VBOs was removed making VBOs being on a permanent thing. But I have found the code that renders/shows the bottom portion of the sky and have gotten it to work in 1.20 with VBOs.