Massive Java Parity Update - fileshredder

3D/Fancy Clouds have been ported over

Sky Rendering is now an option between Java and PE

Java Sky/Fog color option is now accurate using the original color ramp instead of PE's slightly lower one

Grass Sides are now tinted, and can be toggled in settings

Added stars, the sun, and the moon in the daylight cycle

Sunset color has been added, appears when the sun is rising or falling, buggy on PE's sky rendering option.

Fixed leaves being rendered bright green when foliage tinting was turned off.

Enabled Tall Grass generation code

Tall Grass is now tinted.

Other compile options have to be tested
This commit is contained in:
Shredder
2026-04-25 04:47:07 +05:00
parent d6a3e477c1
commit 31d80aedf8
23 changed files with 864 additions and 357 deletions

View File

@@ -272,17 +272,6 @@ void GameRenderer::renderLevel(float a) {
screenScissorArea.w, screenScissorArea.h);
}
if(mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)) {
setupFog(-1);
TIMER_POP_PUSH("sky");
glFogf(GL_FOG_START, renderDistance * 0.2f);
glFogf(GL_FOG_END, renderDistance *0.75);
levelRenderer->renderSky(a);
glFogf(GL_FOG_START, renderDistance * 0.6f);
glFogf(GL_FOG_END, renderDistance);
}
glEnable2(GL_FOG);
setupFog(1);
if (mc->options.getBooleanValue(OPTIONS_AMBIENT_OCCLUSION)) {
glShadeModel2(GL_SMOOTH);
@@ -295,10 +284,29 @@ void GameRenderer::renderLevel(float a) {
TIMER_POP_PUSH("culling");
mc->levelRenderer->cull(&frustum, a);
mc->levelRenderer->updateDirtyChunks(cameraEntity, false);
// this sky rendering code below was originally before the frustrum and culling stuff but sunset color breaks for some reason in that place, so i moved i after those two - shredder
if(mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)) {
setupFog(-1);
TIMER_POP_PUSH("sky");
// @TODO - EXTREME JANK BELOW, it works but i have to do heavy cleanup here, also to test if the glfogf commands even affect fog in anyway.
if(mc->options.getBooleanValue(OPTIONS_BETA_SKY) && (mc->options.getIntValue(OPTIONS_VIEW_DISTANCE) < 2)){
levelRenderer->renderSky(a); // how java renders the sky instead of how pe doing prepareandrenderclouds.
} else if (!mc->options.getBooleanValue(OPTIONS_BETA_SKY)){
glFogf(GL_FOG_START, renderDistance * 0.2f);
glFogf(GL_FOG_END, renderDistance *0.75);
glFogf(GL_FOG_START, renderDistance * 0.6f);
glFogf(GL_FOG_END, renderDistance);
}
}
glEnable2(GL_FOG);
setupFog(1);
// MCPE renders clouds using this, but this method breaks 3d clouds and also breaks 2d clouds transparency viewed from above, add as a Legacy Sky or Fast Sky option. - shredder
if(!mc->options.getBooleanValue(OPTIONS_BETA_SKY)){
if(mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)) {
prepareAndRenderClouds(levelRenderer, a);
}
}
setupFog(0);
glEnable2(GL_FOG);
@@ -306,7 +314,9 @@ void GameRenderer::renderLevel(float a) {
mc->textures->loadAndBindTexture("terrain.png");
Lighting::turnOff();
glDisable2(GL_ALPHA_TEST);
// glDisable2(GL_ALPHA_TEST); // vanilla pe disables alpha test here, i renable it so grass side textures dont become opaque - shredder
glEnable2(GL_ALPHA_TEST); //
glDisable2(GL_BLEND);
glEnable2(GL_CULL_FACE);
TIMER_POP_PUSH("terrain-0");
@@ -374,11 +384,14 @@ void GameRenderer::renderLevel(float a) {
}
glDisable2(GL_FOG);
//
// setupFog(0);
// glEnable2(GL_FOG);
//// levelRenderer->renderClouds(a);
// glDisable2(GL_FOG);
// Normally this is commented out, but this is how java does it and should fix both 2d/3d clouds, a
if(mc->options.getBooleanValue(OPTIONS_BETA_SKY)){
setupFog(0);
glEnable2(GL_FOG);
levelRenderer->renderClouds(a);
glDisable2(GL_FOG);
}
// SHREDDER END
setupFog(1);
if (zoom == 1 && !mc->options.getBooleanValue(OPTIONS_HIDEGUI)) {