Hi,
I've downloaded and converted some ISF Generators.
But when trying to use them in VDMX.
Many of the X/Y 2Point cordinates aren't working properly or normalized properly.
Trying to center a X/Y control point it seems like it is using the bottom left of the canvas
to base it cordinates on.
Any thoughts on this or on how to convert or what to change in the editor?
/*{
"CREDIT": "by Carter Rosenberg",
"CATEGORIES": [
"Generator"
],
"INPUTS": [
{
"NAME": "radius1",
"TYPE": "float",
"DEFAULT": 0.1
},
{
"NAME": "radius2",
"TYPE": "float",
"DEFAULT": 0.25
},
{
"NAME": "startColor",
"TYPE": "color",
"DEFAULT": [
1.0,
0.75,
0.0,
1.0
]
},
{
"NAME": "endColor",
"TYPE": "color",
"DEFAULT": [
0.0,
0.25,
0.75,
1.0
]
},
{
"NAME": "location",
"TYPE": "point2D",
"DEFAULT": [
0.5,
0.5
]
}
]
}*/
float distance (vec2 start, vec2 end) {
return sqrt(pow((start.x-end.x),2.0) + pow((start.y-end.y),2.0));
}
void main() {
vec2 tmpPt = location / RENDERSIZE;
float mixOffset = distance(tmpPt * RENDERSIZE.x / RENDERSIZE.y, vv_FragNormCoord * RENDERSIZE.x / RENDERSIZE.y);
float tmpRadius = radius1 + radius2;
if (mixOffset <= radius1) {
gl_FragColor = startColor;
}
else if (mixOffset > tmpRadius) {
gl_FragColor = endColor;
}
else if (radius1 == tmpRadius) {
gl_FragColor = endColor;
}
else {
gl_FragColor = mix(startColor,endColor,(mixOffset-radius1)/(tmpRadius-radius1));
}
}