Page 1 of 2

Shaders

Posted: Mon Oct 27, 2014 7:47 pm
by flip
Hello all

I have recently got Magic and have been having great fun producing synchronised visuals to my music
I am brand new to this area of video art and have absolutely no idea how to use program languages.(at the moment)
What kind of Shaders can I use in Magic and where can I download them from and what sort of price can I expect to pay?
Better still is there a program I can learn and use to produce my own Shaders that are compatible with Magic?

Cheers

Flip

Re: Shaders

Posted: Mon Oct 27, 2014 8:35 pm
by Magic
Hi Flip, Magic's shader functionality is designed primarily to work with shaders from these two sites: http://glslsandbox.com and http://shadertoy.com

The shaders on these sites are free, but not all of them are licensed for commercial use. You'll have to read each one to see how it can be used.

This section of our User's Guide might be helpful: http://magicmusicvisuals.com/downloads/ ... GLSLShader

You can't really use a program to design shaders from scratch (as far as I know); you have to write them using the GLSL language. So for now, I'd recommend you just try copying and pasting existing shaders from the sites above.

Does that help?

Eric

Re: Shaders

Posted: Mon Oct 27, 2014 9:23 pm
by flip
Hello Eric

Thank you very much for your quick reply
I'll go and have a rout around in the sites you mentioned.

I forgot to say in my first post what an amazing and inspiring program you have made.
It's brilliant to be able craft beautiful visuals in such an easy and transparent way.

Cheers

Flip

Re: Shaders

Posted: Fri Nov 07, 2014 10:44 pm
by Ranya
what is the syntax for copying and pasting the code from shaders on this site? when i copy the code i just get a blank screen

thanks

Re: Shaders

Posted: Sat Nov 08, 2014 6:35 pm
by Magic
Hmm, you shouldn't have to worry about syntax. It's just a matter of copying and pasting the code into a text file on your system. Is there a particular shader that's not working for you? Can you post the link?

Eric

Re: Shaders

Posted: Sat Nov 08, 2014 8:27 pm
by Ranya
Hi Eric

none of the shaders are working for me. I am basically copying the code from shader toy pasting it on note pad and saving as textfile. Is this the right way?

Re: Shaders

Posted: Sun Nov 09, 2014 12:45 am
by Magic
Yup, that's the right way.

How about the shaders that come with Magic? Are those working for you? You might want to look at one of them in a text editor to make sure you're copying and pasting the right things.

Re: Shaders

Posted: Sun Nov 09, 2014 1:29 am
by Ranya
yes all the stock shaders work well. only the downloaded ones dont. Basically what i am doing is:

1. Copying the code
2. Pasting onto note pad
3. saving the file with any name into the GLS folder in C: Magic
4. Launching the .txt file

The screen just appears blank white

Re: Shaders

Posted: Sun Nov 09, 2014 4:38 am
by Syd
they're probably using textures that you don't have.

Re: Shaders

Posted: Sun Nov 09, 2014 9:34 am
by Terry Payman
Ranya wrote:yes all the stock shaders work well. only the downloaded ones dont. Basically what i am doing is:

1. Copying the code
2. Pasting onto note pad
3. saving the file with any name into the GLS folder in C: Magic
4. Launching the .txt file

The screen just appears blank white
Here's one that doesn't need a texture, and so works with just the above copy & paste:
https://www.shadertoy.com/view/MsSSRV#
If I get an all-white screen it's usually because I've missed copying the closing "}" at the very end of the ShaderToy code, or made a syntax error in a modification.
Syd wrote:they're probably using textures that you don't have.
Eric gives details in his numbered notes at the end of the GLSLShader section:
Eric wrote:...This section of our User's Guide might be helpful: http://magicmusicvisuals.com/downloads/ ... GLSLShader...

Re: Shaders

Posted: Sun Nov 09, 2014 2:42 pm
by Ranya
Can i download textures or is this graphic card dependent?

Re: Shaders

Posted: Sun Nov 09, 2014 6:04 pm
by Magic
Ranya, can you post a link to a shader you're trying to use, or post the code that's not working for you? That way I can tell you exactly why it doesn't work, and hopefully fix it if possible.

Re: Shaders

Posted: Mon Nov 10, 2014 9:48 pm
by Ranya

Re: Shaders

Posted: Mon Nov 10, 2014 9:58 pm
by Magic
Ok, that one works fine for me. Try this:
MatrixRain.txt
(2.59 KiB) Downloaded 1564 times
If my version works for you, you should compare it to your version and see what the difference is.
Terry Payman wrote:If I get an all-white screen it's usually because I've missed copying the closing "}" at the very end of the ShaderToy code.
As Terry said, the most common problem is that you didn't copy the last "}".

Re: Shaders

Posted: Mon Nov 10, 2014 10:48 pm
by Terry Payman
Eric wrote:As Terry said, the most common problem is that you didn't copy the last "}".
... and if I get an all-black screen (as for the "problem" Matrix Rain shader), the first thing I try is providing an input.
qobupd.jpg
qobupd.jpg (10.71 KiB) Viewed 33699 times
Likewise, if you see an all-black screen for a shader on the Shadertoy site you probably need to click on the "iChannel0" panel and select a texture as an input. It seems only some of the shaders have a texture preselected, even if it's required.

Re: Shaders

Posted: Tue Nov 11, 2014 2:52 pm
by Ranya
Thanks that now worked for me.

Re: Shaders

Posted: Tue Nov 11, 2014 4:52 pm
by Ranya
I still have issues with certain shaders that are either fully black or just white. It may have to do with the way i am copying and pasting or just my graphix card. Am hoping to upgrade to the GTX 970 this Xmas! if my dad agrees.

Re: Shaders

Posted: Thu Mar 05, 2015 6:17 pm
by hyp
hello. for the life of me, i can't get any of the shadertoy shaders to work inside of MMV. i copy and pasted them to a .txt file, loaded them up in MMV and no go.

i noticed with some of the examples posted here that the syntax was different where there was a gl_ added to some of the code. however this is weird because if you are copying/pasting directly why is your code different than mine?

sorry for the newb question, since this is all new to me. any help would be greatly appreciated. thanks!

here's one that i would really like to try:
https://www.shadertoy.com/view/ldl3W8#

Re: Shaders

Posted: Thu Mar 05, 2015 6:33 pm
by Magic
Yeah, unfortunately Shadertoy just changed their specification. No idea why they did it but it broke things for a lot of apps.

There's an easy fix though. Just copy and paste this into the bottom of your text file:

Code: Select all

void main(void) {
    mainImage(gl_FragColor, gl_FragCoord.xy);
}
The next version of Magic (1.6) will add this automatically.

Re: Shaders

Posted: Thu Mar 05, 2015 10:37 pm
by hyp
Eric wrote:Yeah, unfortunately Shadertoy just changed their specification. No idea why they did it but it broke things for a lot of apps.

There's an easy fix though. Just copy and paste this into the bottom of your text file:

Code: Select all

void main(void) {
    mainImage(gl_FragColor, gl_FragCoord.xy);
}
The next version of Magic (1.6) will add this automatically.
thanks so much eric! finally got it working :)