Fixed sky rendering
This commit is contained in:
parent
c623da26ed
commit
93ca944472
2 changed files with 440 additions and 441 deletions
|
@ -36,7 +36,7 @@ import ru.betterend.client.ClientOptions;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@Mixin(LevelRenderer.class)
|
@Mixin(LevelRenderer.class)
|
||||||
public class WorldRendererMixin {
|
public class LevelRendererMixin {
|
||||||
private static final ResourceLocation NEBULA_1 = BetterEnd.makeID("textures/sky/nebula_2.png");
|
private static final ResourceLocation NEBULA_1 = BetterEnd.makeID("textures/sky/nebula_2.png");
|
||||||
private static final ResourceLocation NEBULA_2 = BetterEnd.makeID("textures/sky/nebula_3.png");
|
private static final ResourceLocation NEBULA_2 = BetterEnd.makeID("textures/sky/nebula_3.png");
|
||||||
private static final ResourceLocation HORIZON = BetterEnd.makeID("textures/sky/nebula_1.png");
|
private static final ResourceLocation HORIZON = BetterEnd.makeID("textures/sky/nebula_1.png");
|
||||||
|
@ -95,6 +95,8 @@ public class WorldRendererMixin {
|
||||||
@Inject(method = "renderSky", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderSky", at = @At("HEAD"), cancellable = true)
|
||||||
private void be_renderBetterEndSky(PoseStack matrices, Matrix4f matrix4f, float tickDelta, Runnable runnable, CallbackInfo info) {
|
private void be_renderBetterEndSky(PoseStack matrices, Matrix4f matrix4f, float tickDelta, Runnable runnable, CallbackInfo info) {
|
||||||
if (ClientOptions.isCustomSky() && minecraft.level.effects().skyType() == DimensionSpecialEffects.SkyType.END) {
|
if (ClientOptions.isCustomSky() && minecraft.level.effects().skyType() == DimensionSpecialEffects.SkyType.END) {
|
||||||
|
runnable.run();
|
||||||
|
|
||||||
time = (ticks % 360000) * 0.000017453292F;
|
time = (ticks % 360000) * 0.000017453292F;
|
||||||
time2 = time * 2;
|
time2 = time * 2;
|
||||||
time3 = time * 3;
|
time3 = time * 3;
|
||||||
|
@ -109,9 +111,6 @@ public class WorldRendererMixin {
|
||||||
RenderSystem.depthMask(false);
|
RenderSystem.depthMask(false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//TODO: Removed in 1.17
|
|
||||||
//RenderSystem.enableAlphaTest();
|
|
||||||
//RenderSystem.alphaFunc(516, 0.0F);
|
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
|
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||||
}
|
}
|
||||||
|
@ -184,12 +183,12 @@ public class WorldRendererMixin {
|
||||||
|
|
||||||
private void be_renderBuffer(PoseStack matrices, Matrix4f matrix4f, VertexBuffer buffer, VertexFormat format, float r, float g, float b, float a) {
|
private void be_renderBuffer(PoseStack matrices, Matrix4f matrix4f, VertexBuffer buffer, VertexFormat format, float r, float g, float b, float a) {
|
||||||
RenderSystem.setShaderColor(r, g, b, a);
|
RenderSystem.setShaderColor(r, g, b, a);
|
||||||
buffer.bind();
|
if (format == DefaultVertexFormat.POSITION) {
|
||||||
format.setupBufferState();
|
buffer.drawWithShader(matrices.last().pose(), matrix4f, GameRenderer.getPositionShader());
|
||||||
|
}
|
||||||
|
else {
|
||||||
buffer.drawWithShader(matrices.last().pose(), matrix4f, GameRenderer.getPositionTexShader());
|
buffer.drawWithShader(matrices.last().pose(), matrix4f, GameRenderer.getPositionTexShader());
|
||||||
|
}
|
||||||
VertexBuffer.unbind();
|
|
||||||
format.clearBufferState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void be_initStars() {
|
private void be_initStars() {
|
|
@ -11,7 +11,7 @@
|
||||||
"ClientRecipeBookMixin",
|
"ClientRecipeBookMixin",
|
||||||
"MinecraftClientMixin",
|
"MinecraftClientMixin",
|
||||||
"PlayerRendererMixin",
|
"PlayerRendererMixin",
|
||||||
"WorldRendererMixin",
|
"LevelRendererMixin",
|
||||||
"MusicTrackerMixin",
|
"MusicTrackerMixin",
|
||||||
"AnvilScreenMixin",
|
"AnvilScreenMixin",
|
||||||
"BiomeColorsMixin",
|
"BiomeColorsMixin",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue