Previous topicNext topic

Controlling shader effects from midi

Questions, comments, feedback, etc.
Post Reply
neoz
Posts: 28
Joined: Mon Feb 16, 2015 2:07 pm

Controlling shader effects from midi

Post by neoz »

Hey guys!
Can someone explain how to control shader modul from midi device?
For example, i need to control many effects (ascii, matrix, etc) with midi knob smoothly. 5 effects - 5 knobs and smooth applying...
I tried to do it thru LumaKey modul, but i feel its not correct and there's also fps drop in this case...
Thanks a lot!
:geek:
Attachments
?
?
mscr1.jpg (106.95 KiB) Viewed 9656 times
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: Controlling shader effects from midi

Post by Magic »

Hmm, I think the issue you're having is that not all shaders respond to their parameters. It depends on every individual shader. Can you give me an example of an effect you're trying to achieve?
Sadler
Posts: 1143
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Controlling shader effects from midi

Post by Sadler »

Perhaps you're looking to (cross) fade shaders in and out using midi knobs or sliders.

One way that works well for me is to use the RGBA module and link all RGBA to the same control.
neoz
Posts: 28
Joined: Mon Feb 16, 2015 2:07 pm

Re: Controlling shader effects from midi

Post by neoz »

Eric wrote:Hmm, I think the issue you're having is that not all shaders respond to their parameters. It depends on every individual shader. Can you give me an example of an effect you're trying to achieve?
Eric, i'm trying just to on\off shader with knob, but their parametrs is another story!)
I.e. i need to apply the effect on scene smoothly, hold it and get it back...
neoz
Posts: 28
Joined: Mon Feb 16, 2015 2:07 pm

Re: Controlling shader effects from midi

Post by neoz »

Sadler wrote:Perhaps you're looking to (cross) fade shaders in and out using midi knobs or sliders.
One way that works well for me is to use the RGBA module and link all RGBA to the same control.
Sadler, the problem is that [the effect shader] module is still rendering even when its not in use and fps dropdown dramatically - so i have to turn it off everytime and also i cant control module's on\off from the midi!
Attachments
111111111r.jpg
111111111r.jpg (92.25 KiB) Viewed 9633 times
Sadler
Posts: 1143
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Controlling shader effects from midi

Post by Sadler »

Well I guess that depends on the shaders you're using and the power of your graphics card and your resolution. Yes, shaders keep running when they're not visible but with 4 shaders running in this setup I still get a consistent 90fps on a GTX 570. A frame rate throttle set to 10ms keeps the fan noise down.
midi_control_shader_mix.jpg
midi_control_shader_mix.jpg (106.85 KiB) Viewed 9632 times
In this scene I control the opacity of 4 shaders using midi sliders on ColorRGB. Admittedly not the most complicated setup but enough to create video soup if you're not careful.

One way to compel shaders to (almost) turn off would be to edit (in shader code) a param so that it affected opacity and did nothing when zero. If you want to use a shader that already uses X and Y then give ShaderLoader FFGL a try which adds RGBA params, all of which can be controlled by midi.

Unless you're looking for specific interaction between shaders (e.g. blend modes or texture mapping) you could put your shaders in different scenes and fade between them that way.
neoz
Posts: 28
Joined: Mon Feb 16, 2015 2:07 pm

Re: Controlling shader effects from midi

Post by neoz »

Sadler, thanx for such detailed answer!!
My problem is in working shaders, they need to be inactive while not in use...
I've got ati m5100 firepro - it's not so bad, but in complicated scenes i have 30-40 fps, while without this - all ok 60fps...
So maybe there's a way to apply midi on module on\off button?))
I've got no more idea...
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: Controlling shader effects from midi

Post by Magic »

Ah, I see what you're saying now. Well, it just so happens that the next version of Magic (1.55 - coming very soon) will have the ability to control the module on/off via MIDI. So it should definitely improve your fps :).
neoz
Posts: 28
Joined: Mon Feb 16, 2015 2:07 pm

Re: Controlling shader effects from midi

Post by neoz »

Oh man... You made my day! :ugeek:
Post Reply