Closed AndrewRayCode closed 2 years ago
Shader code:
#ifdef GL_ES
precision mediump float;
#endif
#define PI 3.14159265358979323846
#define cx_arg(z) atan(z.y, z.x)
#define cx_abs(z) length(z)
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
uniform mat4 viewMatrix;
uniform vec3 cameraPosition;
// Play with this funciton, you drunken clod!!
vec2 f(vec2 z) {
return vec2(z.x * z.x - z.y * z.y + 2.0 + z.x, z.x * z.y + z.y * z.x + 0e+0 + z.y);
}
// http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl
vec3 hsv2rgb(vec3 c)
{
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
vec4 domcol(vec2 z) {
float h = 0.5 + cx_arg(z) / (2.0 * PI);
float s = abs(sin(2.0 * PI * cx_abs(z)));
float b = abs(sin(2.0 * PI * z.y)) * pow(sin(2.0 * PI * z.x), 0.25);
float b2 = 0.5 * ((1.0 - s) + b + sqrt((1.0 - s - b) * (1.0 - s - b) + 0.01));
vec3 hsv = vec3(h, sqrt(s), b2);
return vec4(hsv2rgb(hsv), 1.0);
}
void main() {
vec2 z = vec2(
mix(2.0, -2.0, (gl_FragCoord.x + 0.5) / resolution.x),
mix(2.0, -2.0, (gl_FragCoord.y + 0.5) / resolution.y)
);
gl_FragColor = domcol(f(z));
}
@jfontan I've seen some 500 errors on save recently too, but it's intermittent. Is everything OK on Heroku?
We've moved from heroku to a server hosted in DigitalOcean. There are other problems with old pages that also give error 500.
I've manually loaded old effects and they are in the database. Still don't know what is causing the problems.
I've fixed the problem with the old pages. I have some errors in the logs that are probably causing the error on save. It seems to be a problem with the post call, probably the image. Still have to test a couple of things to check how it can be fixed.