I'm trying to automate some parameters and I'm having trouble figuring out my issue. I'm getting shader compilation errors when overriding keyvar[3] with with the converted output of my generator. I'm editing the infinite_spheres fractal and trying to automate the first parameter in color:
obj.add(Sphere(0.5, (1.0, 1.0, 1.0), color=('3',0.9,0.5)))
These are the differences in frag_gen.glsl between working and non working:
*****
frag_gen.glsl
newCol = vec4(vec3(_3,0.9,0.5), de_sphere(p - vec4(vec3(1.0,1.0,1.0), 0), 0.5));
*****
frag_gen.glsl.broken
newCol = vec4(vec3(0.9,0.9,0.5), de_sphere(p - vec4(vec3(1.0,1.0,1.0), 0), 0.5));
*****
As you can see the first argument in vec3() is _3 but I'm not sure why. This is how I'm overriding keyvars[3]:
def rangeMap(x, in_min, in_max, out_min, out_max):
return (x-in_min) * (out_max-out_min) / (in_max-in_min) + out_min
sine = float(-1 * math.sin(step) * 2)
keyvars[3] = rangeMap(sine, -2, 2, 0.2, 0.9)
My first thought was some sort of type error but I've tried removing the float on the sine variable as well as several other type conversions with no luck. Any ideas?
Thanks for the cool fractals!
I'm trying to automate some parameters and I'm having trouble figuring out my issue. I'm getting shader compilation errors when overriding
keyvar[3]with with the converted output of my generator. I'm editing theinfinite_spheresfractal and trying to automate the first parameter incolor:These are the differences in
frag_gen.glslbetween working and non working:As you can see the first argument in
vec3()is_3but I'm not sure why. This is how I'm overridingkeyvars[3]:My first thought was some sort of type error but I've tried removing the
floaton thesinevariable as well as several other type conversions with no luck. Any ideas?Thanks for the cool fractals!