how to make epic god rays in blender
God rays are epic and if they are missing in your scene it will show, but making them in blender is not straight forward. so let me present you an easy trick.
video:
how to add god rays in blender:
to add god rays in blender you need three things
- An obstacle: like a tree this will obscure the light from the sun or any light source and the shadow will cast volumetric shadows which are essentially god rays.
- A volume object: a volume object in blender is created by adding a volume shader like the principled volume any mesh object will do but to keep things simple i just use a cube mesh.
- A light source: While a sky texture comes with a sun disc which is enough as a light source, for a proper volumetric effect i also add a sun object which you can add under the add menu in the light category
The light source:
the sun object and the sun disc are different objects but in our case we want to treat them as one, atleast tie the rotation of the sun disc to the rotation of the sun object.
for this we are going to use drivers, we shall setup two drivers, one for the sun disc rotation in the sky texture and another for the sun rotation.
How to control the sky texture sun elevation using a driver or object in blender:
the sun rotation is going to be driven by a driver using the sun object as the target object, and using the sun object’s x rotation to drive the elevation of the sun disk.
to add a driver to the sun disc elevation, go to the sky texture and right click the sun elevation value and add a diver, the pop up will require a target object, select the sun object from the list
and in the type use the x rotation.
the driver takes an expression that converts the sun x rotation to a variable name var, we have to add 1.5708 which is adding 90 degrees in radians to the rotation of the sun to compensate for an offset in the sun disk rotation as by default the sun disc at 0degrees is pointing in the x direction while the sun object would be pointing directly down.
How to control the sky texture sun elevation using a driver or object in blender:
the setup will not be that different here, add a driver to the sun rotation and, select the sun object as the target, and use the z rotation this time
in the expression you can use the expression “var * -1”, by default when you rotate the sun object in the positive direction the sun disc will rotate in the opposite direction so we multiply the variable by a negative value to correct this
download project file:
patreon: https://www.patreon.com/posts/76816501?pr=true