Page 1 of 1

Custom control for shader's parametr

Posted: Sun Apr 05, 2015 4:12 am
by neoz
Hey guyz!!
Is there any chance to make a custom control parameter for selected shader?
For example, i need to control this string in BWwarpdots.txt:
vec2 position = ( gl_FragCoord.xy - resolution.xy*.3 ) / resolution.x; // 256 angle steps
Changing the number after "resolution.xy" gives the possibilities to full interaction with coordinates from kinect!..
Thanx for any advice))

Re: Custom control for shader's parametr

Posted: Sun Apr 05, 2015 8:38 pm
by Magic
This tutorial explains how to do it: viewtopic.php?f=3&t=86

But, the quick solution is just to replace .3 with mouse.x:

Code: Select all

vec2 position = ( gl_FragCoord.xy - resolution.xy*mouse.x ) / resolution.x;
Then you can control it with the X Param.

Does that help?

Re: Custom control for shader's parametr

Posted: Tue Apr 07, 2015 10:44 am
by neoz
Yeah!!!
You made my day again and again!
Thanx, Eric!!
:)