Skip to content

Commit 0b1e87c

Browse files
Added capacity for #includes in shaders to be wrapped in quotes or diamond brackets (#93)
1 parent 6570c16 commit 0b1e87c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

common/src/main/java/foundry/veil/api/client/render/shader/processor/ShaderImportProcessor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ public void modify(Context ctx, GlslTree tree) throws IOException, GlslSyntaxExc
3030
}
3131
for (String directive : imports) {
3232
String importId = directive.substring(ShaderImportProcessor.INCLUDE_KEY.length()).trim();
33+
34+
if ((importId.startsWith("\"") && importId.endsWith("\"")) || (importId.startsWith("<") && importId.endsWith(">"))) {
35+
importId = importId.substring(1, importId.length() - 1);
36+
}
37+
3338
try {
3439
ctx.include(tree, ResourceLocation.parse(importId), IncludeOverloadStrategy.SOURCE);
3540
} catch (ResourceLocationException e) {

0 commit comments

Comments
 (0)