It looks like you are always setting child_gene.visible = false
, but never set it back to visible = true
before you rasterize the layer in computeFitness()
. I'm not sure that there's a need for juggling layers in each frame - it should work just as well without it.
Here's a simplified example that uses a square with a gradient as the target raster.