I see that gp.compile calls python's eval on the
str representation of a PrimitiveTree. Instead I want to compile to GLSL code.
For example, if the expr had been
lambda x, y, z: x+y*math.sin(z)
The GLSL code would be this text:
out float fragColor;
uniform float x;
uniform float y;
uniform float z;
main() {
fragColor = x + y*sin(z);
}
I would also have functions that exist in GLSL but have no meaning in Python
fragColor = myLookup(x, y) + sin(z);
Has anyone done this kind of custom compilation?