4

How can I replace the background of my scene, but keep the reflections and lighting generated from my HDRI?

gandalf3
  • 157,169
  • 58
  • 601
  • 1,133
wysiwyg
  • 41
  • 1
  • 1
  • 2

1 Answers1

2

Enable Transparent in Render settings > Film:

Now the sky will render as alpha transparency when seen directly, but still illuminate and reflect off other objects.

Once you have a transparent background, it can easily be filled in with another image via an Alpha Over node:

enter image description here
The Translate node is used for some tweaks to the positioning of the background image.

gandalf3
  • 157,169
  • 58
  • 601
  • 1,133
  • 3
    Maybe it would be good to include a bit of information regarding compositing work involved. After all, the question was not about how to get a transparent background, but how to change the background without effecting the scene. – TARDIS Maker Jun 03 '15 at 07:07
  • Much better! Although for simplicities sake, I would get rid of the translate node, but that's just me. – TARDIS Maker Jun 05 '15 at 07:23
  • This was not helpful to me, can anyone please provide an video tutorial – Ehsan Zargar Ershadi Jun 15 '18 at 17:35
  • @EhsanZargarErshadi What is unclear? I can't really help unless I know where you're stuck. – gandalf3 Jun 15 '18 at 20:41
  • Sorry, my lake of knowledges where the issue, buy looking precisely to the images provided I was able to reproduce it. Thanks – Ehsan Zargar Ershadi Jun 17 '18 at 06:08
  • @EhsanZargarErshadi Glad you got it figured out :) – gandalf3 Jun 17 '18 at 22:40
  • Does this have to be made in the compositor? You can't do it straight in a world material so you can see it in the viewport? – eobet Mar 04 '21 at 12:56
  • @eobet Hm.. I think you could do it in a world material, yes. If you'd like to ask another question, comment a link to me here and I'll see if I can figure something out! (If you're still looking for a solution) – gandalf3 Mar 05 '21 at 23:17
  • 1
    Thanks, found the answer here already actually (although the result gets slightly distorted): https://blender.stackexchange.com/a/145396/38603 – eobet Mar 06 '21 at 14:52
  • @eobet I'm glad! To solve the distortion you could try connecting a texture coordinate node (window) -> mapping node -> vector input of your image texture node. – gandalf3 Mar 07 '21 at 00:50