God rays in viewport but not in render
I found the answer. The problem was essentially what was described here: Volumetric Light not working on Cycles (but good in preview)
So what I did was I selected that cube that surrounds the scene, and I went into the object visibility properties and selected &quot;Render&quot; because it was unselected.