ShaderEditor icon indicating copy to clipboard operation
ShaderEditor copied to clipboard

Make compatible with Shadertoy.com?

Open odbol opened this issue 9 years ago • 6 comments

I tried pasting in a shader from shadertoy.com but it doesn't look like the names are the same. Is there an easy way to do this?

Otherwise I can add some kind of alias system for each variable, so it checks both mouse (ShaderEditor) and iMouse (ShaderToy) and binds to whichever one the script is using. Does that sound like a good idea?

odbol avatar Sep 20 '16 03:09 odbol

I would highly agree with this suggestion despite potential implementation and conversion issues. The shaders from Shadertoy could be easily downloaded using the publicly available API. Adding such accessibility in your app would make for a huge boost in popularity among those less skilled. And from an entrepreneur's view, a feature like this would honestly be worth paying for in some aspect.

ghost avatar Sep 20 '16 05:09 ghost

Yes, the names of the uniforms are more similar to GLSL Sandbox than ShaderToy. At the moment, there's no automatic conversation unfortunately. But that would be nice of course!

I'd go for conversion rather than supporting both sets because that would have to happen just once. Also, ShaderToy has some uniforms (and cool features) that the app doesn't support yet. And a different way of handling samplers too (channel names instead of object names).

That said, I definitely want to support importing from ShaderToy and I too think that would really be a great feature. But there are a couple of issues I probably need to fix first: the app doesn't support multi pass shaders yet and ShaderToy sources are quite big sometimes and Android's highlighting method gets really slow at about 500+ loc. So right now it'd be a sub optimal experience I think.

But I'm on it and it will happen.

markusfisch avatar Sep 20 '16 08:09 markusfisch

Awesome. I did some preliminary work to convert them here:

https://github.com/markusfisch/ShaderEditor/pull/40

odbol avatar Sep 20 '16 08:09 odbol

Great!

But what I meant by conversion was more like a string replacement than searching the shader for both symbols. I think supporting both sets will lead to fragmentation. So I'd try to replace ShaderToy names when importing with their existing counterparts (and add new uniforms where necessary).

Another option would be do it the other way round and change everything to work in ShaderToy. Existing shaders could be changed automatically. Probably more work and there may be inconsistencies because the app works a bit different than ShaderToy (there are uniforms that do not exist on ShaderToy, using samplers is name based and not channel based and so on).

I just don't want to carry the burden of two name sets around :)

markusfisch avatar Sep 20 '16 09:09 markusfisch

Ah sorry, I've realised I misread the topic. But I agree with the need for additional compatibility, or at least compatibility with ShaderToy shaders, nonetheless.

ghost avatar Sep 20 '16 09:09 ghost

I'd love to see some integration with GLSL Sandbox, more than ShaderToy. Maybe a way to download the shaders using the IDs generated from GLSL Sandbox.

rafaellago avatar Nov 03 '16 12:11 rafaellago