Recognize .glsl files as glsllib.

fix-openal-soft-deadlink
Riccardo Balbo 5 years ago committed by GitHub
parent 484d192467
commit a9afcecc41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      jme3-core/src/plugins/java/com/jme3/shader/plugins/GLSLLoader.java
  2. 1
      jme3-core/src/test/java/com/jme3/asset/LoadShaderSourceTest.java
  3. 2
      jme3-core/src/tools/java/jme3tools/shadercheck/ShaderCheck.java

@ -191,7 +191,7 @@ public class GLSLLoader implements AssetLoader {
if (info.getKey() instanceof ShaderAssetKey) {
injectDependencies = ((ShaderAssetKey) info.getKey()).isInjectDependencies();
}
if (info.getKey().getExtension().equals("glsllib")) {
if (info.getKey().getExtension().equals("glsllib")||info.getKey().getExtension().equals("glsl")) {
// NOTE: Loopback, GLSLLIB is loaded by this loader
// and needs data as InputStream
return reader;

@ -46,6 +46,7 @@ public class LoadShaderSourceTest {
assetManager.registerLocator(null, ClasspathLocator.class);
assetManager.registerLoader(GLSLLoader.class, "frag");
assetManager.registerLoader(GLSLLoader.class, "glsllib");
assetManager.registerLoader(GLSLLoader.class, "glsl");
String showNormals = (String) assetManager.loadAsset("Common/MatDefs/Misc/ShowNormals.frag");
System.out.println(showNormals);
}

@ -31,7 +31,7 @@ public class ShaderCheck {
assetManager.registerLocator("/", ClasspathLocator.class);
assetManager.registerLoader(J3MLoader.class, "j3m");
assetManager.registerLoader(J3MLoader.class, "j3md");
assetManager.registerLoader(GLSLLoader.class, "vert", "frag","geom","tsctrl","tseval","glsllib");
assetManager.registerLoader(GLSLLoader.class, "vert", "frag","geom","tsctrl","tseval","glsllib","glsl");
}
private static void checkMatDef(String matdefName) {

Loading…
Cancel
Save