Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shader Compilation Error #16

Open
lnorton89 opened this issue Nov 15, 2019 · 4 comments
Open

Shader Compilation Error #16

lnorton89 opened this issue Nov 15, 2019 · 4 comments

Comments

@lnorton89
Copy link

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!

@HackerPoet
Copy link
Owner

This is a known issue, the colors don't currently work with variables yet. I'll hopefully push in a fix for this soon.

@lnorton89
Copy link
Author

Thanks for the update. Look forward to seeing your next commits.

@lnorton89
Copy link
Author

This is a known issue, the colors don't currently work with variables yet. I'll hopefully push in a fix for this soon.

I'm assuming this library is dead Since there hasn't been a commit over over a year?

@Ayers-Kendall
Copy link

This is a known issue, the colors don't currently work with variables yet. I'll hopefully push in a fix for this soon.

I'm assuming this library is dead Since there hasn't been a commit over over a year?

We could move it elsewhere and try to expand it if you want. I just found this and fixed the recording bug, and plan to expand my version of it to be a bit more generalized for colors and maybe having an initial selection menu as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants