mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 07:17:58 +01:00
Add an option to disable the post-effect shader
This commit is contained in:
parent
989d1df294
commit
18f2865264
2 changed files with 18 additions and 1 deletions
|
@ -48,6 +48,9 @@ public class Config extends com.minelittlepony.common.util.settings.Config {
|
|||
public final Setting<Boolean> simplifiedPortals = value("compatibility", "simplifiedPortals", false)
|
||||
.addComment("Disables dynamic portal rendering");
|
||||
|
||||
public final Setting<Boolean> disableShaders = value("compatibility", "disableShaders", false)
|
||||
.addComment("Disables post-effect shaders used by the corruption mechanic");
|
||||
|
||||
public final Setting<Long> fancyPortalRefreshRate = value("client", "fancyPortalRefreshRate", -1L)
|
||||
.addComment("Sets the refresh rate of portals when using fancy portal rendering")
|
||||
.addComment("Set to -1 (default) for unlimited");
|
||||
|
|
|
@ -43,14 +43,24 @@ public class ViewportShader implements SynchronousResourceReloader, Identifiable
|
|||
}
|
||||
|
||||
public void loadShader(@Nullable Identifier shaderId) {
|
||||
|
||||
if (shader != null) {
|
||||
shader.close();
|
||||
try {
|
||||
shader.close();
|
||||
} catch (Throwable ignored) {
|
||||
} finally {
|
||||
shader = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (shaderId == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Unicopia.getConfig().disableShaders.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
shader = new LoadedShader(client, shaderId);
|
||||
} catch (IOException e) {
|
||||
|
@ -67,6 +77,10 @@ public class ViewportShader implements SynchronousResourceReloader, Identifiable
|
|||
}
|
||||
|
||||
public void render(float tickDelta) {
|
||||
if (Unicopia.getConfig().disableShaders.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (shader != null && client.player != null) {
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.disableDepthTest();
|
||||
|
|
Loading…
Reference in a new issue