Recognize .glsl files as glsllib.

This commit is contained in:
Riccardo Balbo 2019-09-02 09:25:41 +02:00 committed by GitHub
parent 484d192467
commit a9afcecc41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -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) {