The development of new approaches to control cardiac arrhythmias requires a deep understanding of spiral wave dynamics. Optogenetics offers new possibilities for this. Preliminary experiments show that sub-threshold illumination affects electrical wave propagation in the mouse heart. However, a systematic exploration of these effects is technically challenging. Here, we use state-of-the-art computer models to study the dynamic control of spiral waves in a two-dimensional model of the adult mouse ventricle, using stationary and non-stationary patterns of sub-threshold illumination. Our results indicate a light-intensity-dependent increase in cellular resting membrane potentials, which together with diffusive cell-cell coupling leads to the development of spatial voltage gradients over differently illuminated areas. A spiral wave drifts along the positive gradient. These gradients can be strategically applied to ensure drift-induced termination of a spiral wave, both in optogenetics and in conventional methods of electrical defibrillation.