Fix fitness function bug (hopefully)

The shader rounds to the nearest color when rendering, sometimes
it rounds up. I made it only round down,
This commit is contained in:
Joscha 2017-04-30 09:23:00 +00:00
parent c281026b53
commit fc0840d79d
2 changed files with 12 additions and 12 deletions

View file

@ -34,10 +34,10 @@ void main(void)
// encode to rgba channels in current pixel
vec4 col = vec4(0.0, 0.0, 0.0, 1.0);
// total = total/200.0;
col.r = mod(total, 256.0/255.0);
col.g = mod(total/256.0, 256.0/255.0);
col.b = mod(total/65536.0, 256.0/255.0);
// total = total/255.0;
col.r = floor(mod(total*255.0, 256.0))/255.0;
col.g = floor(mod(total*255.0/256.0, 256.0))/255.0;
col.b = floor(mod(total*255.0/65536.0, 256.0))/255.0;
// color.g = 0.0;
// color.b = 0.0;
// color.g = mod(total, 256.0/255.0);