I'm just starting with ISF and GLSL in general.
I'd like to get a slider to move a point from the left edge of the canvas over to the right edge.
I have a point2D input.
(Is there a way to set the MAX value to RENDERSIZE.x?)
For now the slider value ranges from 0.0 to 1.0. So in my code I multiply it by RENDERSIZE.x.
This actually works as expected in ISF tester app but in VDMX the value goes too high and the dot moves beyond the right edge of the canvas.
Any tips or advice on how this should work?
Thanks!
- Code: Select all
/*{
"INPUTS": [
{
"NAME": "size",
"TYPE": "float",
"MIN": 0.0,
"MAX": 1000.0
},
{
"NAME": "position",
"TYPE": "point2D"
}
]
}*/
void main() {
float x = position.x * RENDERSIZE.x;
float y = position.y * RENDERSIZE.y;
vec2 pos = vec2(x, y);
float dist = length(gl_FragCoord.xy - pos);
float color = size / dist;
gl_FragColor = vec4(vec3(color), 1.0);
}