|
|
|
|
|
|
Digital Insertion with Adobe Photoshop CS4 Extended
Photoshop CS4 Extended improves upon several of the 3D features introduced in Photoshop CS3 Extended. Among these is a ray tracer capable of rendering images with more complex lighting effects such as shadows, true reflections, refractions and diffuse inter-reflection. In this tutorial I'll quickly go over how we can use the ray tracer to insert a 3D object into a photograph. Obviously, the scene used is to merely demostrate the effect and its poor artistic value should take away from the utility of the feature.
The first thing you need is the image. I just went to my back room and took a picture of the fireplace mantle in the relative dark, blasting the flash.
Now we need something to insert into this image. I used Happy Buddha model (downloaded from Stanford Scanning Repository). I converted the model from PLY to OBJ format myself, so you might have to hunt around on the web to find an OBJ file. When Photoshop loads the model its orientation could be quite different, so the first thing I do is try to orient the model using the 3D Rotate Tool and get it approximately in place. I also adjust the diffuse color of the material to be something warm so that it fits the overall scene better (a trick here is to use the color picker to just sample an existing color in the scene, I used a swatch from the back wall). When you load a 3D model, Photoshop will create 3 infinite lights for you by default. I delete two of them and adjust the last one to try and match the scene lighting as closely as possible. Once you do all of these things, you should something that looks like this.
There are two primary things that keep this from looking good, first is the shadow on the wall and second is how the ledge of the mantle is behind the buddha. We'll fix both of these things. First lets address the shadow problem. If you haven't done so, switch to the ray tracer (3D->Render Settings... change Face Style to 'Ray Traced'). The tracer can trace shadows but we need something to catch them and display them properly. To do this we need to create a plane. The easiest way to do this is to create a new layer and then use the 3D->New 3D Postcard From Layer command to turn it into a 3D layer. Now we need to merge our two 3D layers, the one with the plane and the one with the buddha. To do this, select the 3D layer with the plane, and select the camera tool, then in the top toolbar under 'view:', select the name of the 3D layer to match and the two cameras will be matched. Once the two cameras are matched, select the two 3D layers and select 3D->Merge 3D Layers. Now the plane should be in the same 3D scene as the buddha. Now you'll need to move and orient the plane so that it is behind the buddha where it can catch a nice shadow. Note that you'll probably want to add some softness to the shadow (for this scene, I set softness to 12%). You should then get something that looks like:
We now have a shadow, but we also have all the other bits of the plane. There's a simple fix to this. Any 3D object can be designated as "View Invisible" yet can still cast and catch shadows. In the 3D panel, select the mesh for the plane, check off the box marked 'Invisible', this will make the plane invisible to view rays, yet it will still catch shadows.
We have a shadow on the wall, but its very black, hence doesn't match the shadows of the other objects. The way to fix this is to color the shadow cast by our buddha. There is an easy way to do this. If an 'invisible' object that is casting shadows has an opacity map attached to it, that opacity map is actually used to color the shadow. Yea I know its somewhat convoluted but it does the trick. So select the material for the plane and add an Opacity map. Now all I did was used the color picker to sample the shadow areas of one of the other objects and filled the Opacity map with that color and voila!
The last thing we have to fix is the base of the buddha which seems to hang over the mantle top. Unfortunately there is no cool trick to doing this, just old school Photoshop masking. Create a layer mask for the 3D layer and use a brush to mask out the base of the buddha. The ray tracer's ability to compute diffuse inter-reflection is only available during final render (and is always turned on for final render). In addition to diffuse inter-reflection, the ray tracer will also use the scene's Global Ambient Color as the ambient light in final rendering. So I set the Global Ambient Color to be a very dark orange/yellow color. You don't want to set the Global Ambient Color to be too high otherwise the rendered image will look washed out. Final rendering also turns on the highest level of anti-aliasing. Once we do that, we end up with our final image:
I'm sure that those far more creative than me will create far more amazing images with these tools than I've done today, but hopefully this tutorial helps. I rendered one more scene with the buddha, on my coffee table in a room very well lit by a window.
In this scene, there is no obvious direction for the light, so I didn't have any lights in the 3D scene and just used the diffuse inter-reflection on the buddha. These two scenes were easy to create, in all I probably only spent about 15 minutes working on each of them.
Return to tutorial index
|
|
|
|
|
|