Вы находитесь на странице: 1из 9

SHADOW CHANNEL

Physically-based GPU+CPU Render

Shadow Channel
One of the features of Thea Render v1.4 is the availability of a variety of new Render Channels
supported by Presto engines. One of these channels is the Shadow Channel, supported by both
Presto (AO) and Presto (MC). This separate pass for the scene shadows allows faster and better
post processing resulting in a variety of final outcomes.
An example of what can be produced is seen in Figure 2, where with the use of the Shadow
Channel (as seen in Figure 1) we managed to isolate from our scene the model with its shadows Figure 1: Shadow Channel
and add it later on different backgrounds, reserving all shadow information.

Tutorial Contents
At this small tutorial we will see the way we can generate this Channel from inside Thea Studio
and Integrated plugins:
• 3dsMax
• Cinema4D
• SketchUp

At the final part of the tutorial we will give the basic steps one needs to follow in post process- Figure 2: Plane with shadows - after post process
ing (with the use of an image editor software) to isolate the desired models and their shadows
and generate the final images.

Note: at the final step of post-processing, we will also need a way to isolate our models and their shadows. For this, we will need to
use the Mask Channel. So on parallel with Shadow Channel we will show how the Mask Channel can be generated and used.

Mask Channel allow us to index the models/groups we want (by assigning a Mask Index to them) and in this way produce the need-
ed black/white masks of the selected models.

1
SHADOW CHANNEL
Physically-based GPU+CPU Render

General Note: At the following paragraphs we will examine how we can enable the Mask Index
for the selected model and how we can generate the Shadow and Mask Channels. For all cases,
we suppose we have the same scene and goal:
• We will start from a scene with some models laid on a floor.
• We will then produce the Color, Mask and Shadow Channels.
• Finally, we will combine these three images at post processing to produce the final image,
our models and their shadows.
Figure 3: Some models laid on a floor

1) Shadow & Mask Channels with Thea for 3dsMax


For producing the Mask and Shadow Channels inside 3dsMax one needs to follow the next steps:

• Assign at first a Mask Index to the item you need to use as Mask (floor to our example). For
doing this you can use both native 3dsMax tags: Object ID and Material ID. In case you select
both, note that Material ID has a higher priority (so you can set a sub-material ID inside a ob-
ject that already has an ID applied).
• Then, before rendering, select as render engine cores Presto (AO) or Presto (MC) and enable
the Shadow/Mask Channels (see Figure 4). These Channels can be found at the Render Ele-
ments tab of the Render Setup window.

Some extra tips on the options available at this window:


• Save Separated button saves each channel in a different file.
• Save Img.Thea button saves that file format that contains all the channels in a single file.
• With Show button enabled, a frame-buffer per channel is created and shows the rendered
channel inside 3dsmax. If it is not checked channels can be still saved but they will not been
displayed.

Figure 4: Enable render Channels inside 3dsMax

2
SHADOW CHANNEL
Physically-based GPU+CPU Render

2) Shadow & Mask Channels with Thea for Cinema4D


For producing the Shadow and Mask Channels inside Cinema4D one needs to follow the next
steps:
• Assign at first a Mask Index to the floor, so that we can use this mask later to isolate the floor
shadows. For changing the Mask Index inside Cinema4D you will need to add the Cinema4D
Compositing tag to the model you want (floor in our case). Enable then the Object Buffer
and set a value at the first Buffer (see Figure 5). Note that Cinema4D allows multiple buffers
per model, though Thea only needs one, so the first one listed will be taken into account.
• Before start rendering, open the Render Settings window and select as Renderer Thea Ren-
der.
• Go to Thea Render panel and at General tab enable the Production Mode. Select Presto (AO)
or Presto (MC) as Engine Core
• Then go to the Channels tab and from the list enable both Shadow and Mask [Object Buffer]
Figure 5: Mask Index inside Thea for Cinema4D
Channels (Figure 6). is the Object Buffer
• You can then render inside Thea Darkroom or Cinema4D Picture Viewer and the rendered
channels will be available at Thea Darkroom at the Channels list (see Figure 7) and at Picture
Viewer at the Layer tab (see Figure 8).

Tip: in case of an animation, for having all the needed frames rendered and saved automatically,
Picture Viewer needs to be used. You will need to enable prior to rendering the Multi-Pass op-
tion and specify the path of the rendered channels at Save > Multi-Pass Image. The sequence
of the shadow channels will be then added at this folder.

Figure 7: Select and see Shadow/ Figure 8: Select and see Shadow/Mask Channels at Figure 6: Enable Shadow Channel at Render
Mask Channels at Thea Darkroom Picture Viewer Settings

3
SHADOW CHANNEL
Physically-based GPU+CPU Render

3) Shadow & Mask Channels with Thea for SketchUp


For producing the Mask and Shadow Channels inside SketchUp you
will need to follow the next steps:

• Seleact a group, component or an image you want to assign


the Mask Index (floor in our case), press right click and choose
Thea Render > Assign Mask Index. Then select a Mask Index
Figure 9: Assign a Mask Index for a Component
number (from #1 to #5). You can see these options in Figure 9.
Note that all SketchUp object have “No Mask Index” set by de-
faut.
• Then, before rendering, open the Thea Rendering Window, go at
first to the Rendering tab and select as engine core either Presto
(AO) or Presto (MC). Deselect the Interactive option as Channels Figure 10: Enable Shadow and Mask Channels
can be generated at the final, Production rendering.
• Switch to the Channels tab and from the available channels
select the Shadow and Mask Channels (see Figure 10).
• Start rendering and the selected channels will ap-
pear at the Channels Drop down list (Figure 11).
The one you select will be seen at the rendering window. Use the Figure 11: Select, see and save render Channels
Save button in order to save them.

In case of an animation the Color and Channels frames will be all


added automatically to the specified folder.

4
SHADOW CHANNEL
Physically-based GPU+CPU Render

4) Shadow & Mask Channels with Thea Studio


In order to enable and produce the Shadow and Mask Channels inside Thea Studio, one needs to
follow the next steps:

• Select the floor model and then at the Properties Panel increase the Mask Index from the de-
fault 0 (that means no Indexing) to number 1, as seen in Figure 12.
• Then, and before rendering, go to the Settings Panel and enable the Production mode (either by
double clicking on the Interactive tab or by going to the Darkroom).
• Go to the General tab and select as Engine Core Presto (AO) or Presto (MC).
• Switch to the Channels tab and enable both Mask and Shadow Channels (see Figure 13).
• Once the rendering starts you will be able to find the Shadow/Mask Channels listed at the Chan- Figure 12: Enabling Mask Index for the
nels drop-down menu, at the Darkroom (see Figure 14). floor
• With the Save button you are able to save the Color, Mask and Shadow Channels at the desired
format (png for example).

In case of an animation, the rendered images and their channels will be added directly to the spec-
ified output folder.

Figure 14: Find Mask and Shadow Channels at the Darkroom Figure 13: Select Both Mask and Shadow
Channels

5
SHADOW CHANNEL
Physically-based GPU+CPU Render

Post Processing Procedure and Tips


By following any of the above methods (render the Color, Mask and Shadow Channels inside 3dsMax, Cinema4D, SketchUp or Stu-
dio) you will end up with the following images (Figure 16, Figure 17 and Figure 18):

Figure 15: Initial Scene (Studio Viewport) Figure 16: Color Channel Figure 17: Mask Channel Figure 18: Shadow Channel

As we have created now the above channels we can use an image editing software, like Gimp or
Adobe Photoshop in order to make the needed modifications to our Channels and produce the re-
sults we want. In our example we will use Photoshop. We import all the channels (Color, Mask and
Shadow) in Photoshop and then we follow the next basic steps.

Step 1: The first we will need to do is to isolate the models we need from the rest ones with the
use of the Mask channel (remove the floor in our example).

We select the Mask channel and we copy it. We go at the Color channel layer, and from the menu
on top we select Layer > New Layer Mask > Reveal All (Figure 19).

We paste then (paste in place) the copied Mask channel to the new mask layer and then we invert Figure 19: Add New Layer Mask
it. This is how the Color layer with the applied Mask should look like now:

In Figure 20 we see that the background has been removed now from the Color Channel.

Figure 20: Mask added at Color Channel

6
SHADOW CHANNEL
Physically-based GPU+CPU Render

Step 2: The mask channel will be used once again at this step in order to isolate the needed shad-
ows. These are the contact shadows, created by the models onto the floor.

We select the Mask channel and we copy it. We go then to the Shadow channel layer, and once
again from the top menu we go at Layer > New Layer Mask > Reveal All (Figure 19).

We paste in place then the Mask channel to the new mask layer (no need to invert it this time). Figure 21: Mask applied to the Shadow
This is how the layer should look like now: Channel

We see the results on the Shadow Channel in Figure 21. As you see the only problem we still need
to handle is the white color appearing at the background.

What we need to do now is to remove totally these white parts and keep the shadows only in a
transparent background.

For doing this we go the Blending Options of the layer (Figure 22) and at the Blend If Grey panel,
at first bar (This Layer), with Alt+Click we drag the right cursor half-left part at the left side as we
see in Figure 22. Figure 22: Blending Options

In this way we manage to remove the white background and our results are seen in Figure 23.

Figure 23: Floor Shadows at a transparent


background

7
SHADOW CHANNEL
Physically-based GPU+CPU Render

Step 3: The final step is to combine the Models with their Shadows.

For doing this, we simply need to copy the layer with the Shadows as we created at the
previous step, Step 2. We need to copy it merged. Then paste it (paste in place) as a
new layer below the Color layer.
This is the way our layers should like now:

The resulted image is seen in Figure 24. Figure 24: Models with their Shadows

Then you can add any other background to a layer below the Shadow layer. This is the
way our layers should like now:

At the Blending options of the Shadow layer select the Multiply option, and see your
rendered models and images at a new background (as seen in Figure 25 and Figure 26).
Tip 1: In case any “gaps” exist between the models and the Figure 25: Models with Shadows in a new background - 1 -
shadows you can select the Shadow layer, go to Filter > Other
> Minimum and change Radius value to 1-2. This will give you
a smooth result.

Figure 27: Minimum Filter Figure 26: Models with Shadows in a new background - 2 -

8
SHADOW CHANNEL
Physically-based GPU+CPU Render

Additional Step - No Background export


At the previous steps we ended up with three layers: the models, their shadows and a back-
ground. We used the Multiply option at the Blending Mode in order to achieve nice use of our
shadows with the background.

What if one needs to use this image at a website for example? We will need to export the im-
age with the shadows only (and transparent background).
Figure 28: Load Selection Window
With the method we stated above, by hiding the background layer and saving the resulted im-
age in png format, some white parts will be still left on the shadows area, as the Multiply Blend
is ignored.
For totally removing these white parts, some additional steps are needed:

• At the layer with the Shadow, as it has been already generated from the previous steps you
need to use the option from the top menu Select > Load Selection (enable the invert option
at the dialogue box) as seen in Figure 28. Then go to Edit > Cut and cut the selected part.
• Afterwards, at top menu again go to Image > Adjustments > Levels and remove totally the
white color (see Figure 29).

The above steps will let you have a white-free shadow to use it at websites or a leaflet with any
Figure 29: Levels Window
background color. You can see such an example in the next image, where some parts are over
our document grey coloured background box, some others on white but still their shadows are
correctly applied.

Find out more at www.thearender.com

Вам также может понравиться