Access Godot Shading Language parser (ANTLR)
Asked Answered
T

2

0

Hello,

[Context] For a specific case of shader merging, I had the idea to parse two shader files and then merge the list of variables, the content of fragment shader, vertex shader methods.

Are there any tools to do this (using GDScript)? For example, having a ShaderParser.getFragmentFunction() method or a similar tool like Antlr (then access FRAGMENT_FUNCTION rule content for example). I don't like the idea of using a regular expression (except if it's the best solution).

Thanks for your contribution.

Teak answered 5/4, 2022 at 5:33 Comment(0)
G
0
This discussion was caught in the moderation queue since you have not confirmed your account yet.
Upon creating your account you should have received an account verification email. The confirmation email may have been incorrectly flagged as spam, so please also check your spam filter. Without confirming your account, future posts may also be caught in the moderation queue. You can resend a confirmation email when you log into your account if you cannot find the first verification email.
If you need any help, please let us know! You can find ways to contact forum staff on the Contact page. Thanks! :smile:
Gyron answered 5/4, 2022 at 5:33 Comment(0)
C
0

The shader parser is not exposed to the scripting API (just like the GDScript parser, in fact). Consider opening a discussion on the Godot proposals repository if you need this.

To do this, you'd have to implement your own Godot shader language parser using an external tool.

Calculus answered 7/4, 2022 at 18:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.