mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-18 19:04:23 +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)
|
public final Setting<Boolean> simplifiedPortals = value("compatibility", "simplifiedPortals", false)
|
||||||
.addComment("Disables dynamic portal rendering");
|
.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)
|
public final Setting<Long> fancyPortalRefreshRate = value("client", "fancyPortalRefreshRate", -1L)
|
||||||
.addComment("Sets the refresh rate of portals when using fancy portal rendering")
|
.addComment("Sets the refresh rate of portals when using fancy portal rendering")
|
||||||
.addComment("Set to -1 (default) for unlimited");
|
.addComment("Set to -1 (default) for unlimited");
|
||||||
|
|
|
@ -43,14 +43,24 @@ public class ViewportShader implements SynchronousResourceReloader, Identifiable
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadShader(@Nullable Identifier shaderId) {
|
public void loadShader(@Nullable Identifier shaderId) {
|
||||||
|
|
||||||
if (shader != null) {
|
if (shader != null) {
|
||||||
shader.close();
|
try {
|
||||||
|
shader.close();
|
||||||
|
} catch (Throwable ignored) {
|
||||||
|
} finally {
|
||||||
|
shader = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shaderId == null) {
|
if (shaderId == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Unicopia.getConfig().disableShaders.get()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
shader = new LoadedShader(client, shaderId);
|
shader = new LoadedShader(client, shaderId);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -67,6 +77,10 @@ public class ViewportShader implements SynchronousResourceReloader, Identifiable
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(float tickDelta) {
|
public void render(float tickDelta) {
|
||||||
|
if (Unicopia.getConfig().disableShaders.get()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (shader != null && client.player != null) {
|
if (shader != null && client.player != null) {
|
||||||
RenderSystem.disableBlend();
|
RenderSystem.disableBlend();
|
||||||
RenderSystem.disableDepthTest();
|
RenderSystem.disableDepthTest();
|
||||||
|
|
Loading…
Reference in a new issue