Add u and v variables to pixel_callable

It's currently calculated from x,y and w,h, but with the switch to shaders
this situation could be reversed to calculate x,y from u,v and w,h

(cherry-picked from commit 46c46b5548)
This commit is contained in:
Celtic Minstrel 2018-04-08 13:56:15 -04:00
parent b6991ced4d
commit 4f2f292618

View file

@ -232,6 +232,8 @@ public:
{
add_input(inputs, "x");
add_input(inputs, "y");
add_input(inputs, "u");
add_input(inputs, "v");
add_input(inputs, "red");
add_input(inputs, "green");
add_input(inputs, "blue");
@ -259,6 +261,10 @@ public:
return variant(w);
} else if(key == "height") {
return variant(h);
} else if(key == "u") {
return variant(p.x / float(w));
} else if(key == "v") {
return variant(p.y / float(h));
}
return variant();