Sub topic 9
Combining an HDRI with Lamps
This chapter assumes that you can navigate the Blender 3D Viewport, use the Properties and Shader Editors, and render a simple scene in Cycles or EEVEE. You should also understand how to add and transform objects.
An HDRI, or high dynamic range image, is an image that stores a wide range of brightness values. When connected to the World shader, it provides ambient illumination and reflections from every direction. Lamps add deliberate control. Use the HDRI for believable environment light and use lamps to shape the subject.
Build a controlled lighting balance
Start with the HDRI at a modest strength. A strong HDRI can flatten the subject because light arrives from many directions. Add an Area lamp as the key light, which is the main light that defines form. Add a weaker fill lamp only when the shadow side is too dark.
A useful starting balance is:
| Light source | Starting role | Typical starting value |
|---|---|---|
| HDRI World | Ambient light and reflections | Strength 0.3–0.8 |
| Area key | Main direction and highlight | 500–1500 W |
| Fill lamp | Softens deep shadows | 10–40% of key power |
| Rim lamp | Separates the subject from the background | 20–60% of key power |
These values depend on scene scale, camera exposure, and the HDRI. Judge the result from the render, not from the numbers alone.
Rotate the HDRI until its bright region supports the key light. If the HDRI shows a bright window on the left but the Area lamp creates a strong highlight from the right, the scene may look contradictory. Either rotate the World, move the lamp, or reduce one source.
Add lamps without fighting the HDRI
Place the key lamp on the side that agrees with the HDRI's brightest visible source. Keep the fill close to the camera axis and use less power. A rim lamp can sit behind the subject, but check that it does not create an unwanted outline on every edge.
Use the World strength to control the overall environment contribution. Use lamp power to control specific highlights and shadows. Adjusting exposure changes the whole image, so use it after the relative light balance is reasonable.
The following script creates an HDRI World and two Area lamps aimed at the origin. Replace the HDRI path with an image available to your Blender file.
import bpy
import math
scene = bpy.context.scene
# Create and configure the HDRI World.
world = scene.world or bpy.data.worlds.new("HDRI World")
scene.world = world
world.use_nodes = True
nodes = world.node_tree.nodes
links = world.node_tree.links
nodes.clear()
output = nodes.new("ShaderNodeOutputWorld")
background = nodes.new("ShaderNodeBackground")
environment = nodes.new("ShaderNodeTexEnvironment")
mapping = nodes.new("ShaderNodeMapping")
coordinates = nodes.new("ShaderNodeTexCoord")
environment.image = bpy.data.images.load("//hdri/studio.exr")
background.inputs["Strength"].default_value = 0.5
mapping.inputs["Rotation"].default_value[2] = math.radians(35.0)
links.new(coordinates.outputs["Generated"], mapping.inputs["Vector"])
links.new(mapping.outputs["Vector"], environment.inputs["Vector"])
links.new(environment.outputs["Color"], background.inputs["Color"])
links.new(background.outputs["Background"], output.inputs["Surface"])
# Add an Area lamp and aim it at the scene origin.
def add_area(name, location, power, size):
data = bpy.data.lights.new(name, "AREA")
data.energy = power
data.shape = "DISK"
data.size = size
lamp = bpy.data.objects.new(name, data)
bpy.context.collection.objects.link(lamp)
lamp.location = location
lamp.rotation_euler = (bpy.Vector((0, 0, 0)) - lamp.location).to_track_quat("-Z", "Y").to_euler()
return lamp
add_area("Key", (4, -4, 5), 900.0, 2.0)
add_area("Fill", (-3, -2, 2), 250.0, 3.0)Exercise
Exercise
An HDRI creates attractive reflections, but the subject has weak form and nearly invisible shadows. What should you change first?
Show answer
Lower the HDRI strength slightly and add or strengthen a large Area key lamp placed to agree with the HDRI's brightest direction.