Create the object that will be made transparent and the object whose lines will be drawn.
Go to the [Create] panel and press the [Geometry] button, then select [Standard Primitives]. Finally press the [Teapot] button in the [Object Type] rollout to create a teapot object.
Next, press the [Cylinder] button in the [Object Type] rollout to create a cylinder object that covers the container part of the teapot.
Create the transparent material.
Press the [M] key to open the [Material editor] and set [Opacity] to 50.
Configure the [Pencil+2 Reflection/Refraction] map.
Press the [Refraction] map button in the [Maps] rollout, select [Pencil+2 Reflection/Refraction] from the [Material/Map Browser] and press [OK].
Set the [Amount] of [Refraction] to 50 in the [Maps] rollout.
Change the [Reflection/Refraction] map parameters.
Open the [Pencil+2 Reflection/Refraction] map from above and change [Base Parameters] rollout / [Reflection/Refraction Map] to [Thin Wall Refraction].
Adjust the [Thin Wall Refraction] map parameters.
Set [Thin Wall Refraction Parameters] / [Render] to [Every Nth Frame].
This completes the configuration of the transparent material.
Assign this material to the cylinder object.
- Add a Pencil+ 2 Line to rendering effects.
Open [Rendering] menu / [Effects] / [Environment and Effects] dialog, select [Pencil+2 Line] from [Effects] tab / [Add] / [Add effect] dialog and press [OK].
Configure the Pencil+ 2 Line.
We configure the lines for the teapot object. Set the line color red and the line size to 1.5 so that the effect is easily visible. Set the [Color] to white in [Environment and Effects] dialog / [Environment] tab / [Common Parameters] rollout / [Background].
- Render the scene.
We see that lines were also drawn inside the transparent cylinder.
With the current configuration, what is inside the cylinder is drawn with a refraction. Depending on the image, the refraction might be undesirable.
Remove the refraction effect.
Open the transparent material's [Thin Wall Refraction] map, uncheck the [Apply Blur] check box under [Thin Wall Refraction Parameters] rollout / [Blur] and set the value of [Thin Wall Refraction Parameters] rollout / [Refraction] / [Thickness Offset] to 0.
- Render the scene.
We see that the teapot is rendered without being refracted.
By adding the following settings to the tutorial configuration above, it is possible to render all except the lines inside the cylinder with the background color.
- Allocate a [Matte/Shadow] material to the object whose lines are drawn.
- Set the color of the lines to the same color as the background.
- Set the value of [Amount] for the transparent material's [Refraction] to 100.
- Check the [Replace color] check box under [Pencil+ 2 Reflection/Refraction] map / [Base Parameters] rollout / [Line Color].
* By using this method and setting the background color to black and the replace color to white, it is possible to create an alpha matte of the transmitted lines to be used for rendering.