Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support exporting to shadertoy #197

Open
neozhaoliang opened this issue Mar 30, 2023 · 5 comments
Open

Support exporting to shadertoy #197

neozhaoliang opened this issue Mar 30, 2023 · 5 comments

Comments

@neozhaoliang
Copy link

Hi, is it possible for FragM to add shadertoy support? That is, export files like common.frag, BufferA.frag, ..., Image.frag so that one can copy them to the shadertoy UI and view the live result?

@3Dickulus
Copy link
Owner

This is not high on my priority list right now as I'm not familiar enough with the inner workings of shadertoy and I have a feeling that it would be difficult due to the differences between shadertoy and FragM... however, github member loicvdb has contributed to the Fragmentarium/Examples repo some frags and documentation about importing shadertoy to FragM, https://github.com/loicvdb/VDB-frags allows using shadertoy fragments in FragM.

This might be helpful when trying to figure out how to do it.

FragM has a full ECMA (java) scripting inteface with debugger, the FragM commands available are documented here https://github.com/3Dickulus/FragM/wiki/06.-Scripting . With the above mentioned fragments and some creative scripting one could engineer an export.fqs script and bind it to hotkey F6... press Shift+F6 to open a file dialog to load your script, after that your script will execute when you press F6.

Will keep this issue open, but for right now the only option is that if you want to write shadertoy fragments just use shadertoy.

@neozhaoliang
Copy link
Author

Thank you for your reply! The main reason I want to export Shadertoy files is that when I want to share some of my works with non-programmers, they lack the necessary experience to install and operate FragM. Shadertoy would be more convenient for them. However, this is not an urgent need. It would be great if this feature could be added in the future.

@3Dickulus
Copy link
Owner

Maybe a standalone player for FragM that could play animation settings? a "fragX" program that executes a shader without the main program. I think there's something like that out there already... maybe opensource?

@neozhaoliang
Copy link
Author

neozhaoliang commented Mar 31, 2023

One issue with using the fragX approach is the portability of GLSL. I have encountered this problem multiple times when using FragM/Fragmentarium, where many shader programs require modifications to the GLSL version for different machines. Even for versions below 120, I had to manually write functions like inverse(mat3). Does it seem Shadertoy is using GLSL es 300? Its compatibility on different platforms is much better.

@3Dickulus
Copy link
Owner

FragM supports GLSL versions: 100, 110, 120, 130, 140, 150, 300 es, 310 es, 320 es, 330, 400, 410, 420, 430, 440, 450, 460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants