aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/makamys')
-rw-r--r--src/main/java/makamys/neodymium/Compat.java40
-rw-r--r--src/main/java/makamys/neodymium/renderer/NeoRenderer.java2
2 files changed, 25 insertions, 17 deletions
diff --git a/src/main/java/makamys/neodymium/Compat.java b/src/main/java/makamys/neodymium/Compat.java
index acb76ca..6343e14 100644
--- a/src/main/java/makamys/neodymium/Compat.java
+++ b/src/main/java/makamys/neodymium/Compat.java
@@ -44,8 +44,29 @@ public class Compat {
return RPLE;
}
+ private static boolean shadersEnabled;
+
public static boolean isShaders() {
- return false;
+ return shadersEnabled;
+ }
+
+ public static void updateShadersState() {
+ try {
+ Class<?> shaders = Class.forName("shadersmod.client.Shaders");
+ try {
+ String shaderPack = (String)shaders.getMethod("getShaderPackName").invoke(null);
+ if(shaderPack != null) {
+ shadersEnabled = true;
+ return;
+ }
+ } catch(Exception e) {
+ LOGGER.warn("Failed to get shader pack name");
+ e.printStackTrace();
+ }
+ } catch (ClassNotFoundException e) {
+
+ }
+ shadersEnabled = false;
}
private static void disableTriangulator() {
@@ -57,21 +78,6 @@ public class Compat {
warns.add(new Warning("Advanced OpenGL is enabled, performance may be poor." + (statusCommand ? " Click here to disable it." : "")).chatAction("neodymium disable_advanced_opengl"));
}
-// try {
-// Class<?> shaders = Class.forName("shadersmod.client.Shaders");
-// try {
-// String shaderPack = (String)shaders.getMethod("getShaderPackName").invoke(null);
-// if(shaderPack != null) {
-// criticalWarns.add(new Warning("A shader pack is enabled, this is not supported."));
-// }
-// } catch(Exception e) {
-// LOGGER.warn("Failed to get shader pack name");
-// e.printStackTrace();
-// }
-// } catch (ClassNotFoundException e) {
-//
-// }
-
if(!isGL33Supported) {
criticalWarns.add(new Warning("OpenGL 3.3 is not supported."));
}
@@ -122,7 +128,7 @@ public class Compat {
}
return false;
}
-
+
private static class OptiFineStubVirtualJar implements IVirtualJar {
@Override
diff --git a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
index fcd4c67..ff13dd7 100644
--- a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
+++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
@@ -412,6 +412,8 @@ public class NeoRenderer {
// This means 1 MB of index data per 512 MB of VRAM.
MAX_MESHES = Config.VRAMSize * 128;
+ Compat.updateShadersState();
+
attributes = new AttributeSet();
attributes.addAttribute("POS", 3, 4, GL_FLOAT);
if (Config.shortUV) {