fix: disable splash shader on intel

This commit is contained in:
LordMZTE 2023-10-14 17:17:24 +02:00
parent 4ef2ca5812
commit 53cec5b2b2
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
2 changed files with 28 additions and 15 deletions
src/main/java/net/anvilcraft/ntx4core

View file

@ -2,6 +2,8 @@ package net.anvilcraft.ntx4core;
import java.io.IOException;
import com.mojang.blaze3d.platform.GlDebugInfo;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.Shader;
import net.minecraft.client.render.VertexFormats;
@ -13,6 +15,9 @@ public class Ntx4CoreShaders {
// This method is called from SplashOverlayMixin as Forge has no fitting event that
// fires early enough (and not too early).
public static void registerShaders() {
// This shader is somehow borked on Intel. Not My fault!
if (GlDebugInfo.getVendor().equals("Intel"))
return;
Ntx4Core.LOGGER.info("Registering Shaders");
try {

View file

@ -10,6 +10,7 @@ import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import com.mojang.blaze3d.platform.GlDebugInfo;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
@ -114,20 +115,20 @@ public class SplashOverlayMixin extends Overlay {
} else {
f2 = 1.0F;
}
//RenderSystem.enableBlend();
//RenderSystem.blendEquation(32774);
//RenderSystem.blendFunc(770, 1);
RenderSystem.setShader(() -> Ntx4CoreShaders.SPLASH);
Ntx4CoreShaders.SPLASH.getUniform("Time").set(this.time / 20.0f);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, f2);
BufferBuilder buf = Tessellator.getInstance().getBuffer();
buf.begin(DrawMode.QUADS, VertexFormats.POSITION);
buf.vertex(-1.0, -1.0, 0.0).next();
buf.vertex(1.0, -1.0, 0.0).next();
buf.vertex(1.0, 1.0, 0.0).next();
buf.vertex(-1.0, 1.0, 0.0).next();
buf.end();
BufferRenderer.draw(buf);
// This shader is somehow borked on Intel. Not My fault!
if (!GlDebugInfo.getVendor().equals("Intel")) {
RenderSystem.setShader(() -> Ntx4CoreShaders.SPLASH);
Ntx4CoreShaders.SPLASH.getUniform("Time").set(this.time / 20.0f);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, f2);
BufferBuilder buf = Tessellator.getInstance().getBuffer();
buf.begin(DrawMode.QUADS, VertexFormats.POSITION);
buf.vertex(-1.0, -1.0, 0.0).next();
buf.vertex(1.0, -1.0, 0.0).next();
buf.vertex(1.0, 1.0, 0.0).next();
buf.vertex(-1.0, 1.0, 0.0).next();
buf.end();
BufferRenderer.draw(buf);
}
l1 = (int) ((double) this.client.getWindow().getScaledWidth() * 0.5D);
int k2 = (int) ((double) this.client.getWindow().getScaledHeight() * 0.5D);
@ -206,7 +207,14 @@ public class SplashOverlayMixin extends Overlay {
int i = MathHelper.ceil((float) (maxX - minX - 2) * this.progress);
int j = Math.round(opacity * 255.0F);
int k = Argb.getArgb(j, 116, 119, 236);
fill(matrices, minX + 2, minY + 2, minX + i, maxY - 2, Argb.getArgb(j, 203, 166, 247));
fill(
matrices,
minX + 2,
minY + 2,
minX + i,
maxY - 2,
Argb.getArgb(j, 203, 166, 247)
);
fill(matrices, minX + 1, minY, maxX - 1, minY + 1, k);
fill(matrices, minX + 1, maxY, maxX - 1, maxY - 1, k);
fill(matrices, minX, minY, minX + 1, maxY, k);