In this short basic tutorial, made with Blender 4.5, I’ll show you how to light a scene with an HDRI image and render the world background with a different image, a color, or a Texture, depending on your needs.
Video Transcript
Hello everyone! In this short basic tutorial, made with Blender 4.5, I’ll show you how to light a scene with an HDRI image and render the world background with a different image, a color, or a Texture, depending on your needs.
I’ll start by setting an HDRI image as an Environment Texture for the World. This image will provide the lighting for the object at the center of the frame, as we can verify by switching to the Rendered view mode in the 3D Viewport.


As you may know, in Blender it’s possible to render the world background as transparent, so you can light the objects with an HDRI image and later replace the background in post-production, using Blender’s Compositor or other editing software. To achieve this, simply enable the Transparent checkbox in the Render Film section of the Properties Editor, and then save the render in a file format that supports transparency, such as PNG in RGBA mode.


Let’s now see how to use a different image for the background to be displayed directly in the render, without using Compositing in post-production. First, I’m activating the background display again by disabling the Transparent option.

I’ll now use a Shading Layout, setting the preview at the top to Rendered instead of Material mode, which is the default. In the Shader Editor at the bottom, I switch the view to World. Right now, the HDRI image is connected to the Background node, which is in turn connected to the World Output node.


I duplicate the image node so I can load a different one. Then, I add a Color Mix node and an Input Light Path node to the setup.

Now, I connect the image used for lighting to the first Color input of the Mix node. Then I connect the image used for the world background to the second Color input of the Mix node. Be careful because the order matters, as I’ll explain in a moment. Finally, the output of the Color Mix node should be connected to the Color input of the Background node, of course.

I now connect the Is Camera Ray output of the Light Path node to the Factor input of the Color Mix node to achieve the desired result. The Is Camera Ray information returns 1 when the rays from the world hit the camera directly, while for bounce rays it returns 0. By using this information as the Factor for the Color Mix node, in the areas where the background is seen, the value is 1, so the second Color input of the Color Mix node is used. On the other hand, for bounce rays, the Factor value is 0, so the lighting of the objects comes from the first input image.

I can temporarily mute the Mix node and observe the lighting and background coming only from the first image node simply by selecting Mix and pressing the M key, which stands for Mute, to toggle it on and off.


For the second Color input of the Color Mix node, I used another HDRI image, but of course you can connect any valid data to that input, such as a procedural texture or even a flat color.


Before wrapping up this short tutorial, I’ll also show you how to set the image used as the background of the render window. This can be useful for producing a rendered image with the desired background directly, without having to use Transparent and the Compositing workflow. To use this technique, however, I need to use an Image Texture node instead of an Environment Texture node, which means the ones currently in this setup aren’t suitable for this purpose. First, I delete the node connected to the second Image input of the Mix node, which is the node defining the background.
I add an Image Texture node, connect it to the empty input of the Color Mix node, and load the desired image. Here I’m choosing the same image that was used in the second Environment node, so for now the result is the same as before.


To map the entire image to the render window, all I need to do is add an Input Texture Coordinate node, connecting its Window output to the Vector input of the Image Texture node. At this point, I can start rendering, obtaining the lighting from the first image and the background from the second image directly in the final render.

Great, that’s it for this short tutorial! I hope you found it useful! See you soon!