Previous topicNext topic

Some GLSL shaders work improperly, others not at all?

Questions, comments, feedback, etc.
Post Reply
Fairlight2cx
Posts: 3
Joined: Sun Jul 29, 2018 4:01 pm

Some GLSL shaders work improperly, others not at all?

Post by Fairlight2cx »

So I've gone to the GLSL Sandbox site and tried some of their modules.

Some work in Magic as they do on the website. Others do nothing. Some work improperly.

Improperly:

http://glslsandbox.com/e#48083.0

Didn't Work:

http://glslsandbox.com/e#48011.1
http://glslsandbox.com/e#48023.0

Any chance I could get assistance on this?

Other than this difficulty in getting third party shaders to work properly, I am -loving- this product. It's worth every cent, and then some. And I'm not tapping the full potential with all the stuff it can do like controlling physical lights, etc.

I have used it as a realtime filter/overlay on Twitch streams, which is actually really cool. You can set a colour filter in StreamLabs OBS, and then make it -really- tolerant about a colour it won't care about, and then turn the opacity down. Boom, instant Pink Floyd old-days light show over the top of your stream. Fantastic!!!

Absolutely -amazing- software, and I'm nothing but thrilled with it! Just need a bit of help.

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

Re: Some GLSL shaders work improperly, others not at all?

Post by Magic »

Unfortunately I can't promise that every shader will work. Many of them were written by amateur authors, and were written just to run in the GLSLSandbox/Shadertoy web sites, and not tested for compatibility with different apps or with different brands of graphics cards. For example the third one seems to have some code errors because it was written very specifically to run in a web browser, not in a regular app. If the code isn't written properly, there won't be any way for Magic to understand it.

The first one runs but just seems deformed. The code looks ok to me though. I'm not sure why it looks different in the browser, but I will try to investigate.

The second one works fine for me... again, maybe a graphics card issue. Not sure.
Fairlight2cx
Posts: 3
Joined: Sun Jul 29, 2018 4:01 pm

Re: Some GLSL shaders work improperly, others not at all?

Post by Fairlight2cx »

How do you modify these to be reactive to the sound?

This one works, for instance: http://glslsandbox.com/e#48100.0

However, it's static in nature, and never alters based on the input of sound0, for instance. The parameters change in the window, but the shader behaviour does not follow suit.

Documentation on how to alter these to work against the dynamic changes in the sound would be most helpful.

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

Re: Some GLSL shaders work improperly, others not at all?

Post by Magic »

There is an older tutorial here which should give you exactly what you're looking for: viewtopic.php?f=3&t=86

Besides that, shaders are programs, so to document them fully would mean to document their entire programming language (GLSL)... which is a bit outside the scope of Magic documentation ;). But suffice it to say, for most shaders in the GLSL Sandbox, you should just be able to use the X/Y/Z/W parameters in Magic's GLSLShader module without any modifications. If these don't work for some particular shader, the easiest thing would be to look for another shader -- there might very well be a similar one that works better.
Sadler
Posts: 1139
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Some GLSL shaders work improperly, others not at all?

Post by Sadler »

There are many ways to make it more reactive. Here is one: Modify line 34, change it to,

Code: Select all

vec3 normal = normalize(vec3(tan(position.x * PI * SCALE), tan(position.y * PI * SCALE * mouse.x), CORNER));
Post Reply