Yes, your tank must have direct lighting to grow plants.
They will only dirty the water if they are not growing well,
and are rotting. (sounds like yours were rotting)