7. Transparency

By default PresenZ will render any transparent objects, such as a window, as a poster showing what is behind them.

In the previous section we explained that with deep reflections enabled, it will appear as a “stereoscopic poster”, showing depth queues. This works quite well for transparent objects far away ( 10 meters or more ), or for complex refractive objects like a lamp or a vase. However, in the case of a close by transparent objects, such as a window, parallax trouble will show.

../_images/Chapter_7_01.jpg

Above we can see the position of the VR camera inside the zone of view. The further you will be from the center of the ZOV, the stronger the effects of baked transparencies. In the image below you can see the effect this has on the scene.

../_images/Chapter_7_02.jpg

Using the native V-ray glass materials in PresenZ, will lead to a skewed perspective on objects behind glass. Almost as if they are coming towards the viewer. This is because the transparencies were baked on the glass. As we can see in the previous image on the left-hand side, it may seem like the transparency is correct from a certain angle. However, as soon as we move and look around inside the zone of view, the effects of the baked transparencies will be more noticeable, as shown in the right image.

PresenZ provides a solution to this problem for close by transparent objects by tagging them.

7.1. Glass Tagging

The glass tag allows you to explicitly state to PresenZ that an object is transparent, and it will thus use our custom glass material to render it. The following image shows what that result looks like.

../_images/Chapter_7_03.jpg

By using the modified V-ray material for PresenZ to render glass, this problem will no longer occur. Whatever position you may be in or whilst moving. If you do not specify an object as glass, all the transparencies and refractions will be baked at its surface and it will be similar to a “stereoscopic poster” of the scene behind the glass surface.

7.2. How to tag your transparent objects

On the PresenZ toolbar you will find the following button.

../_images/ToolbarGlass.PNG

Select a transparent surface that you wish to render as such. Click the button and a window will pop up.

../_images/SetGlass.PNG
  • Transparency: By default this will be set to 1,0 . This controls how transparent your mesh has to be. For a perfectly see through window 1,0 is recommended.
  • IOR: By default this is 1,6. This should match your IOR settings from the material shader you used for the surface.

By clicking ” set glass attributes ” the following lines will be added to your selected mesh’s object properties.

../_images/objectprops.PNG

This will tell PresenZ which object to render as a transparent object.

Warning

The transparent material must be applied on the whole object’s mesh, and not on some faces only. Just like the prz_glass_IOR flag which is only effective on the whole object. The V-ray Multi/Sub material, assigns materials by ID and thus can’t be used for a transparent material in PresenZ.

7.3. How to render the transparent surfaces for PresenZ

Transparent surfaces in PresenZ must be rendered in two passes, with two different PresenZ settings.

../_images/GlassRenderOptions.png
  • With the presenz parameter “opaque only” option selected, the surface with the prz_glass_IOR attribute will be invisible.
  • With the presenz parameter “transp only” selected, only the surface with the prz_glass_IOR will be rendered ( the ones with the “transparent for PresenZ” shader ).
  • With the presenz parameter “opaque and glass” selected, will render both passes.

This will output the przRender file into two different folders, postfixed opaque and transparent.

7.4. The transparencies for irregular or curved objects in PresenZ

Some transparent objects do not need to be rendered with a special shader and pass, because the objects’ curvature distorts most of the refractions. Flat and transparent surfaces far from the viewer ( more than 20m ) can also be rendered with the original shaders.


../_images/Chapter_11_01.jpg ../_images/Chapter_11_02.jpg

../_images/Chapter_11_03.jpg

For a transparent and curved object, the standard transparent mtl shader can be used with the trace refraction enabled. These shapes alter the geometry of shapes behind them , hence why we can use the normal mtl_shader with all the refractions traced and with the PresenZ deep reflections parameter enabled.

7.5. The PresenZ Vray Glass Material for 3ds Max

The glass tagging system allows you to easily apply the Vray PresenZ glass material to your object with a Transparency and IOR value. If you want to apply more complex changes to your glass objects you can also directly work with this glass material in the material editor.

../_images/PresenZGlassMaterial.PNG

Create a VRayPluginNodeMtl and select the BRDFPRZGlass plugin, here you can edit the glass material to your specifications. One example of an application of the glass material is stenciling, which is explained in the following section

7.6. Stenciling by opacity

The stencil is a method to cut a surface with an 8-Bit alpha map. For instance in V-ray this consists of assigning a map in the opacity slot of the mtl_shader. Applied on a flat object, the shader will only be computed where there is opacity through the white on the alpha channel, but this will cause complications with PresenZ.

../_images/Chapter_13_01.jpg ../_images/Chapter_13_02.jpg
  The stencil applied. It will be rendered correctly by V-ray, but will lead to complications with PresenZ
../_images/Chapter_13_03.PNG ../_images/Chapter_13_04.jpg ../_images/Chapter_13_05.PNG
PresenZ - without stencil PresenZ - with stencil

This is the typical artifact of a stencil in PresenZ. The wall behind the tree can not be reached by camera rays, because the opacity map is not considered by PresenZ for the spatialization. The strange artifact caused by the tree stencil can be avoided by making use of the PresenZ glass material.

The following example is given for 3ds Max and shows how to resolve this issue. In the material editor create a VRayPluginNodeMtl and select the BRDFPrzGlass plugin. Set your color bitmap as the diffuse color, and your alpha map as the refract value. Within the glass material in the refractions section set the IOR value to 1.0 and in the Reflection section set the reflection color to black. If you then assign this material to an object and you render with both opaques and transparencies enabled your stencils will render properly. Below we give an example of how this setup would look in the Material Editor.

../_images/StencilExample.PNG

The following images show how an original Vray stencil compares to the PresenZ solution. As you can see the black holes behind the stencil have completely disappeared.

../_images/Stencil_1.PNG ../_images/Stencil_2.PNG