Activate Sun Position add-on
Sun Position add-on comes bundled with Blender 2.91. To activate the add-on go to Edit>Preferences>Add-ons and search for “Sun Position”. Enable an add-on. In its preferences, you can enable additional information labels if needed. Once activated, the add-on will be visible in World Properties of Blender.
Create a test scene and HDRI lighting
- Leave default cube, add Plane object under the cube, and scale 10 times.
- Go to Object Properties > Visibility enable Shadow Catcher.
- In shader editor add some HDRI environment map. If you have Node Wrangler enabled, you can select Background node and press CTRL + T to create all nodes.
- Load 2K sample HDRI map from here to Environment Texture node. Switch to Cycles rendering engine and turn on Viewport Preveiw Mode (shortcut Z + 8)
- Lower Background’s Strength value if it’s too bright.
Attaching Sun light to HDRI
- Select default Point light and switch it to Sun type. If the scene preview is too bright, you’d need to lower its Strength to a reasonable value (between 2 and 5).
- Switch to the World Properties and the Sun Position panel.
- Select Usage mode: Sun + HDR texture
- For the Sun object select Light
- Click on Sync Sun to Texture, make sure that you are on 3D Viewport is in display Preview Mode (shortcut Z + 8), otherwise, the plugin won’t work properly.
- You should now be able to see your hdri map and two crossing lines. Use the mouse scroll button to get closer to zoom, and if hdri is too bright use CTRL + mouse scroll wheel to make it darker in preview. Click where sun should be, even if it’s not visible on hdri.
- Now when your Sun light is attached to HDRI map, you can rotate the whole of your lighting setup using Sun Position > Rotation input field. Tweak a Distance and Rotation to your needs. Select Sun lamp and set its color to something more yellow so it matches the natural environment. if the shadow is too harsh, you can fix it by increasing Sun Light’s Angle number.
Rendering and conclusion
When you toggle Light off and on in preview, you will notice how blue cast coming from hdri has gone, and cube casts a softer shadow when light is activated and rendered directly on plane. In such a scenario, additional Sun light can help you to improve hdri color balance (reducing the blue tinge coming from the hdri map).
When rendering directly on shadow catcher, the cube has almost no visible shadows. Introducing additional light improved shadows significantly. HDRI blue tinge has been smoothly balanced with yellow Sun light.