Previous topicNext topic

Shadertoy to ISF

Tutorials, FAQs, resources, and examples for using Magic.
Michael_Z_Freeman
Posts: 5
Joined: Sat May 06, 2017 6:21 pm

Re: Shadertoy to ISF

Post by Michael_Z_Freeman »

Cheers. saves me puzzling over html/js code of their pages :mrgreen:.
Slavi
Posts: 55
Joined: Thu Mar 31, 2016 7:15 am

Re: Shadertoy to ISF

Post by Slavi »

Hi Eric,

I just wanted to mention, that you have another soul praying for a multipass support :oops: ....

Lots of epic shaders out there :geek:

Regards,
S.
Jaysin
Posts: 3
Joined: Sat Sep 30, 2017 4:56 am

Re: Shadertoy to ISF

Post by Jaysin »

Hey, just got Magic and I'm loving it so far. I gave this a try and none of the shaders I tried worked. Is this still working or did I screw up some how? Usually I'm smart ;-)

So here's a couple of the ones I tried, if anyone could give a shot converting them and let me know how it goes or have any ideas what I may be doing wrong.

https://www.shadertoy.com/view/XlsczN
https://www.shadertoy.com/view/MtfSz2
https://www.shadertoy.com/view/Md3SRM

Thanks
Magic
Site Admin
Posts: 3676
Joined: Wed Apr 09, 2014 9:28 pm

Re: Shadertoy to ISF

Post by Magic »

Thanks for letting me know. It looks like Shadertoy changed its spec recently, so I just updated my script and it should work with the second two. The first one is multipass so it won't work (yet).
Jaysin
Posts: 3
Joined: Sat Sep 30, 2017 4:56 am

Re: Shadertoy to ISF

Post by Jaysin »

Thanks for the quick reply and the quick fix, works now. Guess I'll start saving a list of all the multi-pass shaders in anticipation :-)
Slavi
Posts: 55
Joined: Thu Mar 31, 2016 7:15 am

Re: Shadertoy to ISF

Post by Slavi »

Hi,

Is it possible to use Magic with this shader:
https://www.shadertoy.com/view/4sB3WV

I don't want to use textures, but Magic generated content. I tried to do it the "tutorial way" but it gives me a "one way" module:, that doesn't have an input.
Thank you!

Regards,
S.
Magic
Site Admin
Posts: 3676
Joined: Wed Apr 09, 2014 9:28 pm

Re: Shadertoy to ISF

Post by Magic »

If you want to use Magic images as inputs instead of the Shadertoy textures, click the checkbox that says "Don't use IMPORTED images (advanced)".
Carbinax
Posts: 10
Joined: Sat Feb 17, 2018 11:45 am
Location: Northern Ireland
Contact:

Re: Shadertoy to ISF

Post by Carbinax »

I'm not 100% per cent sure if I've done this correctly because a lot of this is new to me.

I didnt know how to get the shadertoy content so it would work in Magic, so I googled it a bit and found this converter. I converted it, then copied and pasted it into a text file, and deleted .txt at the end and replaced it with .fs . Is that correct ?

If I've done that right, do I just link to a folder anywhere with those .fs files in it, or will it work more fluidly if that folder is placed in a specific place within the magic installation folder ??

Apologies for noob questions. I excel at audio DAWs, but this is all new to me and i'd never even heard of a shader until yesterday and thought it was simply a tool to make gradients of a colour so that red could become lighter red or blue becomes lighter blue etc....so imagine my surprise when I tried the shaders and found not shaders, but FX !!

Very cool. I see the potential for awesomeness, but feeling very green
Magic
Site Admin
Posts: 3676
Joined: Wed Apr 09, 2014 9:28 pm

Re: Shadertoy to ISF

Post by Magic »

Try this tutorial: viewtopic.php?f=3&t=412
Carbinax
Posts: 10
Joined: Sat Feb 17, 2018 11:45 am
Location: Northern Ireland
Contact:

Re: Shadertoy to ISF

Post by Carbinax »

thanks eric. I had a look at that and it seems easy enough.

Having problems with shadertoy though. I can see 1 page and the video is moving but i click to the next page, they take an age to load, and then get a message about webGL being disabled, so i went into firefoxes config page ( the here be dragoons page ) and went down to webGL.disable.angle or something like that and changed it from true to false, or vice versa ( cant remember ), and it worked for a few minutes and screwed up again. I tried this several times, changing back and forth from true to false, but firefox wont play the videos now.
Without the videos, the code doesn't appear either, so I can't copy / paste and do the .fs thing without it.

Any ideas ?? :D
Magic
Site Admin
Posts: 3676
Joined: Wed Apr 09, 2014 9:28 pm

Re: Shadertoy to ISF

Post by Magic »

Hmm... well I can't say I'm an expert on Firefox or WebGL or Shadertoy itself... but I might suggest trying a different browser, such as Chrome...
Carbinax
Posts: 10
Joined: Sat Feb 17, 2018 11:45 am
Location: Northern Ireland
Contact:

Re: Shadertoy to ISF

Post by Carbinax »

yeah I tried Chrome, and its just a little bit better, but does the same thing. Im new to graphics so a lot of it is double dutch to me, and was hoping you might know. Thanks anyway :D
mulherje
Posts: 15
Joined: Wed Apr 25, 2018 2:38 am

Re: Shadertoy to ISF

Post by mulherje »

Hey everyone!

I am trying to get a pixel sorting type shader for live performances. I have been trying one with no success in Magic and then read that you can't use ones with multiple buffers. I found this one (https://www.shadertoy.com/view/MstyDl) but the program still closes every time I try to use it. I am very new to uploading these myself so any help on how to get them into Magic would be much appreciated.
Magic
Site Admin
Posts: 3676
Joined: Wed Apr 09, 2014 9:28 pm

Re: Shadertoy to ISF

Post by Magic »

When you say that the program closes, do you mean that Magic crashes? If so, you may want to try updating your graphics drivers...
IslandGhost
Posts: 2
Joined: Sun Oct 21, 2018 9:32 pm

Re: Shadertoy to ISF

Post by IslandGhost »

Thanks Eric,

Very useful indeed. :-)

If you are considering any updates to the conversion script, I've needed to manually add the following line:

float iFrame = FRAMEINDEX;

to the converted code for shaders that use the iFrame variable (similar to the way the code handles iTime). Not sure how common this is, but might be worth adding at some point if you are making any other changes.
Terry Payman
Posts: 807
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Shadertoy to ISF

Post by Terry Payman »

I wanted to use the awesome Shadertoy XY Audio Oscilloscope in Magic. https://www.shadertoy.com/view/3t23Rt
The current shadertoy_to_isf script only produced minimal output, so I used the VIDVOX ISF editor to import from Shadertoy which managed much better. I highly recommend this editor for Windows users.

With David Lublin's help I managed to get it working very nicely in their ISF editor's preview window, getting results just like those in the Shadertoy environment.

When I try the same shader in Magic it only works partially, with just vertical deflection (and that mainly in the +X direction).
Help!
Attachments
XY_Audio_Oscilloscope_3t23Rt_V1.7.fs
Most recent version, with lots of parameters made adjustable. The parameters (like color) work normally, the problem is with the plotting.
(8.85 KiB) Downloaded 52538 times
Magic
Site Admin
Posts: 3676
Joined: Wed Apr 09, 2014 9:28 pm

Re: Shadertoy to ISF

Post by Magic »

Yes, that's a multipass shader and my conversion script won't handle it. If the Vidvox editor works for multipass then I'd definitely recommend it over my old script.

I ran your .fs file on my everyday laptop and it makes Magic run at 2 fps with nothing else in the scene though...?
Terry Payman
Posts: 807
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Shadertoy to ISF

Post by Terry Payman »

Odd. I've attached a project that I tried on two of my systems (both GTX1070) and it runs at good speed, running 720p at nearly 200fps at the same time as the ISF editor. With no music input there's normally a small dot in the centre of the screen.

Here's a screenshot of the attached project running, with the ISF window alongside for comparison.

In order to see something more than just a dot or vertical line in the attached Magic project I turned the persistence way up - and then there's a trail drifting towards the top right corner. I used a low persistence setting for the ISF instance of the shader for clarity.

David Lublin did mention that I might need to change his ISF editor into OpenGL 4 mode, but I found enabling OpenGL 4 made no difference (although I couldn't confirm that the editor was indeed changing modes accordingly).

Perhaps you can spot something in the ISF editor's output code that Magic doesn't handle.
Magic project and display vs ISF editor display. When the shader persistence isn't turned up there's just a vertical line in the Magic window in the +X direction, pulsating with the music.
Magic project and display vs ISF editor display. When the shader persistence isn't turned up there's just a vertical line in the Magic window in the +X direction, pulsating with the music.
XY scope problem 2.jpg (103.46 KiB) Viewed 4019250 times
Attachments
XY_Audio_Oscilloscope.magic
Magic project illustrating the issue.
(1.45 KiB) Downloaded 49929 times
Terry Payman
Posts: 807
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Shadertoy to ISF

Post by Terry Payman »

Oops, I just noticed that my Magic project has the XY scope module in Points rather than Lines mode. It makes the trail a little more responsive when the persistence is maxed out. In the ISF editor I much prefer the Lines mode.
Magic
Site Admin
Posts: 3676
Joined: Wed Apr 09, 2014 9:28 pm

Re: Shadertoy to ISF

Post by Magic »

Ok. I guess I can't guarantee that the ISF editor will behave exactly the same as Magic, and I can't guarantee that the code between them is 100% compatible. But I will have a look when I get a chance.

Shouldn't your AudioToImage module have Spectrum selected, not Waveform? Maybe not, I dunno.
Post Reply