Shaders
Shaders
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
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
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
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
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
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
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
thanks
Re: Shaders
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
Eric
Re: Shaders
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?
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
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.
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
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
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
they're probably using textures that you don't have.
-
- Posts: 711
- Joined: Sun Sep 14, 2014 8:15 am
- Location: UK
- Contact:
Re: Shaders
Here's one that doesn't need a texture, and so works with just the above copy & paste: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
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.
Eric gives details in his numbered notes at the end of the GLSLShader section:Syd wrote:they're probably using textures that you don't have.
Eric wrote:...This section of our User's Guide might be helpful: http://magicmusicvisuals.com/downloads/ ... GLSLShader...
Re: Shaders
Can i download textures or is this graphic card dependent?
Re: Shaders
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
Ok, that one works fine for me. Try this:
If my version works for you, you should compare it to your version and see what the difference is.
As Terry said, the most common problem is that you didn't copy the last "}".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.
-
- Posts: 711
- Joined: Sun Sep 14, 2014 8:15 am
- Location: UK
- Contact:
Re: Shaders
... and if I get an all-black screen (as for the "problem" Matrix Rain shader), the first thing I try is providing an input. 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.Eric wrote:As Terry said, the most common problem is that you didn't copy the last "}".
Re: Shaders
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
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#
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
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:
The next version of Magic (1.6) will add this automatically.
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);
}
Re: Shaders
thanks so much eric! finally got it workingEric 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:The next version of Magic (1.6) will add this automatically.Code: Select all
void main(void) { mainImage(gl_FragColor, gl_FragCoord.xy); }
Re: Shaders
I've noticed since this change some shaders have a 0.0 alpha set. This doesn't effect magic, but you can trip you up if you're syphoning out etc.
example: https://www.shadertoy.com/view/MlsGRS
example: https://www.shadertoy.com/view/MlsGRS
Code: Select all
fragColor = vec4(final*fog,0.0);
Re: Shaders
Yeah that's because of premultiplied alpha (a common theme recently it seems: http://magicmusicvisuals.com/forums/vie ... ?f=2&t=355).
Magic handles alpha the same way Shadertoy does, but other apps handle it incorrectly (er, differently).
For the technically-inclined, the difference in OpenGL is:
instead of
See http://blogs.msdn.com/b/shawnhar/archiv ... alpha.aspx for more info. The key issue is the proper handling of alpha cutouts and image composition (last sections of that article).
Also http://home.comcast.net/~tom_forsyth/bl ... lpha%5D%5D is a good one, especially the section "Compositing translucent layers".
Magic handles alpha the same way Shadertoy does, but other apps handle it incorrectly (er, differently).
For the technically-inclined, the difference in OpenGL is:
Code: Select all
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
Code: Select all
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Also http://home.comcast.net/~tom_forsyth/bl ... lpha%5D%5D is a good one, especially the section "Compositing translucent layers".