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:
parent
c281026b53
commit
fc0840d79d
2 changed files with 12 additions and 12 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue