1
$\begingroup$

I'm interested in inserting 3D rendered objects into a real scene in a photo (and eventually video) and using image-based lighting. I took the following photo of a mirror ball (pretty low-res):

example mirror ball

I then tried following this tutorial which was one of this only resources I could find giving step-by-step instructions for mirror balls:

  • switch to Cycles
  • go to the World tab
  • add a Background surface
  • specify Environment Texture
  • open the above sphere.jpg
  • select Mirror Ball
  • select Vector = Mapping
  • select Vector = Texture Coordinate > Generated

This generates the attached garbage. Why, and what should I do instead? I'd like to stick with mirror balls since they're much faster/easier to capture than a 360-panorama. Thanks!

render

Update: here are the results after following Spencer's answer, before (original) and after—still seems kinda fake (any tips?), but it was fun for a first stab.

Some details:

  • I just pointed the camera from the front view
  • I left the background transparent and gimped it in later
  • I clicked the Smooth button under Shading on the left toolbox or else the monkey looked extremely polygonal
  • I added Glossy BSDF material on the monkey
  • I added a Sun light - not sure that that helped actually

original

fake

$\endgroup$
3
  • 2
    $\begingroup$ You need two images, one from each side of the ball. With only one image you only capture one side of the environment. Also note that to accurately reproduce the lighting conditions of the environment in which the image is taken, you'll need a larger dynamic range $\endgroup$
    – gandalf3
    Nov 27, 2015 at 21:45
  • $\begingroup$ @gandalf3 Thanks for commenting. (1) 2-sided sounds counter to what I've read from multiple sources, saying you only need what the camera can see. And all the mirror ball images I've found online have been one-sided, e.g. blenderartists.org/forum/…. Can you cite sources, identify exactly how one would represent a two-sided ball + how to accomplish things in Blender? (2) The ball image in the OP was in fact captured using Google's HDR software. (3) Would really appreciate any answers you can give, esp. step-by-step instructions! $\endgroup$
    – Yang
    Nov 27, 2015 at 22:05
  • $\begingroup$ @Yang Nope, these are panoramas (360 degree hdri data aka lightprobe), which is required in order to match your footage. Is this question more about capturing a hdri or using it in blender? $\endgroup$
    – p2or
    Nov 28, 2015 at 11:38

1 Answer 1

3
$\begingroup$

First of all, you need to use the .hdr or .exr formats instead of .jpg. No matter what tool you used to capture the image, .jpg as a format can only hold red, green, and blue channels that go from zero to one. You can imitate some dynamic range with judicious use of RGB curves but for the best result you will need an image that has high dynamic range and was saved in .hdr or .exr format, since those are the only formats Blender reads that are meant to handle such data.

Second of all, besides that you are mostly setting up the environment correctly. The only additional step you need to take is to enable Multiple Importance Sampling for the world. This property is found in the Properties panel, under the World tab, under Settings, and it will make your render converge more quickly. You should always turn this on unless your environment is a constant color, in which case having it off will save a little bit of render time.

enter image description here

If you look at some balls from the Front view, you will see that the garbage portion of the image is clearly visible in the background, but everything that's in the image of the mirror ball is reflected correctly onto whatever geometry is facing the viewer. This situation is ideal because it puts all of the details from the mirror ball onto the geometry, where it can do its job by looking good.

If you want something else to show up in the background besides mirror ball trash, there are a few ways to do it. The first option is modeling most of an environment so that the background isn't visible. The second option is to set the background to Transparent in the Properties panel->Render settings->Film, which will make the background transparent so you can composite or paint one in later. And, finally, the third option is to use the Input->Light Path node to show a background image to the camera and the mirror ball environment to the objects in the world. Here's something like what you might get from such a setup:

enter image description here

You can use any sort of image, photo or matte painting you like here, as long as it looks good and makes sense in the context of your render.

The next problem you'll run into is that you might not want to render with the camera aligned to the Front view. So, you need to rotate the environment texture around until you get all of the mirror ball trash in the background of the camera's view. You can use the Vector->Mapping node for this. The Z rotation will rotate the environment around the Z axis, which will usually get you the result you want.

This all gets much more complicated for animation because you have to interpolate between a sequence of mirror balls to get a result that fits in with your real-world footage, and you would have to animate the Mapping node which might be possible with drivers but probably wouldn't give you the perfect result you might be looking for. For rendering animation that's going to be composited with real-world footage I therefore prefer equirectangular maps that were digitally stitched together from carefully bracketed, Macbeth-chart calibrated HDR photographs of the set, as the amount that you have to animate the Mapping node is minimal and you don't have to use an image sequence for the environment texture which Cycles doesn't support in a straightforward way.

$\endgroup$
4
  • $\begingroup$ Thanks so much! This set me on the right track. I wish I could upvote this multiple times. Do you have the source files for your screenshots you can share as well? $\endgroup$
    – Yang
    Nov 28, 2015 at 20:01
  • $\begingroup$ I updated the question with my own results. Would love to hear any feedback you have as well! $\endgroup$
    – Yang
    Nov 28, 2015 at 20:14
  • 1
    $\begingroup$ You probably need to improve your photography technique next to get better results from here on out. Look into shooting multiple exposures and converting them from RAW to EXR with Lightroom or some other software (probably the Blender compositor can do it although I'm not sure how.) Some cameras can shoot multiple exposures automatically to accelerate this process. You might also want to try taking the mirror ball photographs zoomed in optically to capture more detail on the mirror ball. You may also want to purchase a Macbeth chart to help color-correct and correctly expose your photographs. $\endgroup$ Nov 29, 2015 at 7:02
  • 2
    $\begingroup$ If you must use a mirror ball, carry on. However, I'd strongly encourage you to try the solution posted here blender.stackexchange.com/questions/412/…. Also note that to fully capture the sun, you will require a ten stop ND filter. Direct sun will land somewhere near sixteen stops over your perceptual middle grey exposure point. $\endgroup$
    – troy_s
    Nov 29, 2015 at 20:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .