XSI Softimage - Photorealistic Rendering Tutorial.pdf

(6698 KB) Pobierz
untitled
Q & A
SOLUTIONS / FIXES / ADVICE
TH E M ON TH
S ubmit ted by Gerry, v ia ema il
“How do I set up FG for
photorealistic rendering?”
FAC TFILE
about photorealism because, apart from the spelling,
there isn’t really anything ‘real’ about it. What we
perceive as being ‘realistic’ in an image (or an
animation, for that matter) has more to do with whether it’s
consistent with our expectations of it, rather than whether it’s truly
representative of the real world. Over time, we get used to certain
motifs being rendered in a certain way, and any deviation from this
stands the risk of being regarded as strange or unnatural. As an
extreme example, imagine Godzilla painted in vibrant pink and yellow
stripes. No matter how good the paint job is, or how cute he looks,
the effect would still look slightly odd, to say the least.
Another important point to note is that whenever we look at a
photograph, we’re not actually looking at reality itself, but a
representation of it. Even though variables such as f/stop (focal
ratio, or depth of fi eld), motion blur, camera lenses, different fi lm
types and grain don’t exist in the world around us, we could
rationally claim that the image we’re scrutinising is unrealistic if any
of these variables are absent. In effect, we have to mimic not only
reality but the equipment used to ‘capture’ it.
However, unless you’re fortunate enough to have a huge render
farm tucked away in your cupboard, you’ll soon come to realise that
there’s no way you can enable all the bells and whistles in your 3D
application and still keep render times reasonable, particularly if
you’re generating multiple passes. This includes the feature referred
to in the question: fi nal gathering (FG) – an advanced method of
indirect lighting that samples light refl ected from surrounding
surfaces. And while some of its effects can be ‘faked’ in
compositing, this comes at the cost of quality – the results just
won’t look quite as good as their 3D counterparts.
Given that realism is about a whole lot more than just activating
the switch that simulates the light bouncing around in your scene,
the following walkthrough sets out a selection of techniques for an
effective fi nal gathering workfl ow, including how to use FG in
combination with ambient occlusion. The procedures can be further
refi ned, and can be used all at once or separately, depending on your
requirements. For now, pour yourself a new cup of coffee (purely as
reference material, of course) and let’s get started.
FOR
Softimage XSI
DIFFICULTY
Intermediate
TIME TAKEN
1-2 hours
ON THE CD
• Full-size screenshots
• Supporting scene fi les
ALSO REQUIRED
N/A
3D WORLD June 2006
TDW78.qa_lead 072
6/4/06 4:17:47 pm
Q&A | Simulating water
QUE ST ION OF
SOFTIMAGE XSI
This issue’s solution is supplied by Ola Madsen, who works
as a 3D artist for Digital Context in Sweden. The image above
is a fairly accurate picture of his desk at the end of the day
T here’s a certain irony involved when people enquire
072 | 3D WORLD
68828413.020.png 68828413.021.png
Creating photorealistic images | Q&A
STAGE ONE | Shades of grey
Start by opening the ‘CoffeeCup’ scene on the CD.
The fi rst thing you need to do, which you should do
with any scene, is turn off the ‘ambience’ light, as
this gives a fl at and unrealistic illumination. Next, open an
Explorer (shortcut [8]) and delete the default light as well.
Your scene is now completely black, so any illumination will
have to be created and, more importantly, controlled by you.
The lighting is diffi cult enough without having all
the textures and materials complicating things
further. At this stage, you’re really only interested in
getting the illumination to play properly, so any redundant
information in the image may cause unnecessary distraction.
Nevertheless, a common ‘mistake’ made by a lot of 3D artists
is to set the lights up in a fully textured/shaded scene.
Seeing as the cups already have individual colours
applied to them, you don’t want to modify their
actual materials. Instead, you can temporarily
override their local materials by placing the cups in a new
Partition and by applying a shader to it. Select all of the
cups and press [3] to switch to the Render toolbar.
From the Pass > Partition menu, choose New
Partition. With the partition still selected, click Get >
Material and pick Lambert. Set the RGB values for
Diffuse and Ambient to 0.5 to ensure a neutral colour. By
limiting the objects that are to be lit in your scene to shades
of grey, it will be a lot easier for you to see the effect of the
colour and the intensity of each light.
Apart from certain situations, the purpose of
lighting is to make your objects visible in an
otherwise completely black environment. However,
a well-lit scene does more than illuminate your objects – it
defi nes them. While you’ll most likely strive to keep your
models smooth in your fi nal image, you will actually benefi t
doing the opposite as you’re setting up the lighting.
With the partition still selected, click Get > Property
> Geometry Approximation and switch to the
Polygon Mesh tab. Each of the coffee cups is made
up of a number of polygons, which will be rendered as either
smooth or faceted depending on your Discontinuity settings.
Set the Angle to 0 (zero) to ensure that the polygons will be
rendered completely fl at (you’ll see why in the next stage).
STAGE TWO | Let there be light
The idea is to start from a three-point lighting set-up
and refi ne it as you advance. But instead of standard
lights, you’ll use 3D geometry with different
coloured constant materials applied to them. As you progress
through the steps, make sure to frequently draw a render
region to see the effect each adjustment has on the scene.
You do need at least one light for the fi nal gathering
(FG) to work, so start by creating a standard
spotlight from the Get > Primitive > Light menu.
Position the spotlight approximately at X:6, Y:3, Z:0, set
Colors to RGB 0.83, 0.88, 0.93 and the Intensity to about 0.4.
Open the Render Options PPG (Render > Region > Options…).
Switch to the FG tab and tick Final Gathering to enable it.
Increase the number of Bounces to 2. You can leave
the rest of the settings for now. When it’s time to
render the fi nal image, increase Accuracy to 200
(or more), set the Min Radius to 0.2 and the Max Radius to 1.
Now let’s start creating the lights. From the Get > Primitive
menu, choose Sphere and change the settings to match
those shown in the screenshot above (included on the CD).
June 2006 3D WORLD
TDW78.qa_lead 073
6/4/06 4:17:56 pm
01
02
03
06
04
05
07
08
09
3D WORLD | 073
68828413.022.png 68828413.023.png 68828413.001.png 68828413.002.png 68828413.003.png 68828413.004.png
Q&A | Creating photorealistic images
STAGE TWO (Continued) | Let there be light
Rotate and position the sphere behind the spotlight.
Apply a Constant shader and set RGB to 2.0, 2.2,
2.5. Duplicate it and make it slightly smaller (see
next screenshot for how to position the spheres). Click Get >
Material > MakeLocal Material, and change RGB to 1.99, 2.0,
1.57. Duplicate the sphere again and make it larger – click
Material > MakeLocal Material. Set RGB to 3.5, 3.5, 3.5.
With the lights in place, it’s time to fi ne-tune their
position and intensity, and this is where the fl at
polygons will come in handy. To get the most out of
your lighting set-up, aim for each of the cups’ polygons to
have a slightly different shade to the adjacent polys. While
it’s good to work with one light at a time, the fact that you’re
using FG means each modifi cation affects the entire scene.
For this reason, you should work by going back and
forth, making small changes each time. Note that
the Accuracy and Radius settings in the Render PPG
also affect the illumination of the scene and not just the
quality. Once you’re satisfi ed with the lighting, either delete
the partition (holding the overrides) or create a new Pass, to
revert to the cups’ original shading and materials.
STAGE THREE | Ambient occlusion and adding mattes
Even though you’re using FG to illuminate your
scene, combining it with a subtle effect of ambient
occlusion will place the cups on fi rm ground, and add
to the overall depth and richness of the image. From the Pass
> Edit > New Pass menu, choose Empty. Select all the cups
and the ground object and, from the Pass > Partition menu,
choose New Partition.
With the partition selected, apply any shader from
the Get > Material menu and press [7] to open a
Render Tree. Click Nodes > Illumination > Ambient
Occlusion (AO) and connect the node to the Surface input of
the Material node. Open its PPG and change the settings
(refer to screenshot on the CD). Open the Background_Objects_
Partition’s PPG and set the Render Visibility to Hide Members.
When you’re happy with the AO shader, hit the
render button. As you’ll be doing a fair amount of
adjustments to the images, render them in 16-bit
depths (using the SGI fi le) instead of the default 8-bit. This
will ensure that quality is maintained throughout the project.
You should also render the images at a larger resolution, as
the edges in the fi nal image will need to be cropped.
While the need for mattes may not be critical in this
scenario, it can be the difference between a couple
of minutes’ work in compositing or having to re-
render an entire sequence. From the Pass > Edit > New Pass
menu, choose Empty and name it ‘mattes’. From the Pass >
Partition menu, create three New Partitions and name them
‘red_matte’, ‘green_matte’ and ‘blue_matte’.
Select the partition named ‘red_matte’ and apply
a Constant shader. Set the RGB to 1, 0, 0. Apply a
Constant shader to ‘green_matte’ and ‘blue_matte’,
too, and set the RGB to 0, 1, 0 and 0, 0, 1. Select the blue
cups and, in Explorer, right-click on the ‘red_matte’ portion
and choose Add Selected Objects. Next, add the violet cups
to ‘green_matte’ and the turquoise cups to ‘blue_matte’.
Open the Background_Objects_Partition PPG and set
Render Visibility to Hide Members. Set the rendering
output and format to the same as in the two
previous passes and hit Render. Once completed, go to the
View > Layouts menu and switch to Compositing. (If you’re
using XSI Foundation , you can use Photoshop to composite
and edit the images instead.)
3D WORLD June 2006
TDW78.qa_lead 074
6/4/06 4:18:02 pm
10
11
12
13
14
15
16
17
18
074 | 3D WORLD
68828413.005.png 68828413.006.png 68828413.007.png 68828413.008.png 68828413.009.png 68828413.010.png 68828413.011.png 68828413.012.png 68828413.013.png 68828413.014.png
Creating photorealistic images | Q&A
STAGE FOUR | Compositing using the FX Tree
In the FX Tree menu, choose Passes > Get All Passes
to automatically import the rendered images into
the FX Tree. Add and connect the operators to match
the accompanying screenshot. Please refer to the
annotated full-size screenshot on the CD for further
explanation of the operators’ different settings.
When compositing the shadows or ambient
occlusion, people often add the images and set the
blending mode (Math Op in the FX Tree) to multiply.
However, shadows aren’t black at all – it’s a case of there
being a selective absence of light. For a subtle and realistic
result, you should add a colour corrector to the image and use
the shadow/AO image as a matte to limit the effect.
As discussed in the introduction, effects such as
depth of fi eld can bring your computer to its knees if
applied in the previous stage. However, there’s
another way: open the FileOutput operator and render the
composite. Once saved to disk, you can project the same
image back into your 3D scene. From the View > Layouts
menu, switch back to Default layout.
STAGE FIVE | Depth of fi eld
From Pass > Edit > New Pass, choose Empty. Name
it ‘Depth_of_fi eld’, open an Explorer and set the scope
to Passes. Select the Background_Objects_Partition
in your new pass and apply a Constant shader. Click on the
Connection icon and choose Image. Click the New button and
pick the image you just rendered from the FX Tree. In
Texture Projection, click New and select Camera Projection.
In the Explorer, pick the Camera. Select it and press
[Enter] to open the Camera PPG. Switch to the Lens
Shaders tab, press the Add button and pick the
Depth_of_fi eld shader. Select the same in the shader stack
(the list) and press the Inspect button. Determine which
value to enter to get the focus where you want it. It can be
tricky to animate by hand, so let’s use an expression instead.
From the Get > Primitive menu, pick Null and
name it ‘dof_focus’. Return to the depth of fi eld
PPG and right-click on the animation icon next to
‘Focal Distance in inches’ and choose Expression Editor… from
the menu. In the Editing Pane (the white area), enter ‘ctr_
dist_cam(dof_focus.)’ and press the Apply button. The
expression ensures that the focus will always be on the
null’s location. You can now tinker with the null’s position
and the ‘Depth of Field Strength’ parameter in the Depth _
of_fi eld PPG until you’re completely satisfi ed with the result.
Render the fi nal image, sit back and pop the kettle
on. You’ve just earned yourself another (real) cup of that
sweet, delicious, irresistible coffee. Make sure you enjoy
every drop!
June 2006 3D WORLD
TDW78.qa_lead 075
6/4/06 4:18:06 pm
19
21
20
22
23
24
3D WORLD | 075
68828413.015.png 68828413.016.png 68828413.017.png 68828413.018.png 68828413.019.png
Zgłoś jeśli naruszono regulamin