hello,
it is possible to make osl node, that picks UV map (from external attribute or internal “getattribute”),
and then moving for example 20px right and 60px down vertices in UV map??
And then passing to output result - changed UV map.
I have made pixilated image that has dimensions 2000x2000px, and smallest random block has 10x10px.
UV map in object contains faces that each covers one block.
This is only small preview.
I have trying to pass thru only uv map from attribute but I have failed.
#include "stdosl.h"
#include "node_color.h"
shader windowlight(
/*matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),*/
normal NormalIn = N,
point Vector = P,
output point UV = point(0.0, 0.0, 0.0),
output normal Normal = normal(0.0, 0.0, 0.0),
output point VectorOut = 0
)
{
point p = Vector;
/*p = transform(mapping, p);*/
getattribute("std::uv", UV);
Normal = transform("world", "object", NormalIn);
VectorOut = p;
}
Even VectorOut and UV does not work properly.
Goal is to make that UV work in output. And then shift in some regular distances that will cover blocks of image.
regards,
Dominik
ps how can I debug osl code?? Print some statements, variables in console. For me “printf()” does not work at all.