Vray Materials – Part 2: Transparency Maps + UVW Mapping

11 12 2011

Well, I’m back from the LEED studying abyss.  So I figure it’s about time to get back to helping those of you following me with more Vray material tutorials.

Transparency Maps:

In the previous tutorial, I have shown how to create a diffuse material and even how to add a jpeg to create a brick material.  Let’s take that a step further to look at how to add a sense of transparency to our materials.

Open the material editor, in the diffuse tab, I’ve added a color again (removing the .jpeg map).  Now notice the Transparency color swatch.  This color swatch works primarily on a grayscale.  Solid black swatch = 100% opaque, Solid white swatch = 100% transparent.  Thus if we want a material to be 50% transparent, we should use a medium gray (128-128-128 on the RGB).  Click the update preview button to see the transparency of the material.


Let’s try a simple test render to see how it looks:

We can now begin to see how the material shows a sense of transparency.  This works great if we want the entire material to be a uniform transparency.  Now let’s look at if we wanted to create something like a chain link fence that doesn’t have a consistent transparency.  Just as we previously used a jpeg to create a material, we can use a gray-scaled jpeg to create a transparency map.

Let’s take a look at using this same idea to create a cut out (for example a chain linked fence).  Just as we had previously used a brick .jpeg image to show a pattern in the diffuse layer, we can also add a .jpeg image in the transparency map to create a cut out to match a certain pattern or image.  For this example, I will borrow a few maps that come standard with 3D Studio Max, so thank you to the people at Autodesk for allowing me to use these maps.  I will use a diffuse map to give me the color and pattern that I want, I will then add a gray-scale image (actually this one is just black and white) to show add the cut out.

This is the image to be used and placed in the Diffuse Layer color map slot.

One that is rendered, you should see an image similar to below:

In order to change the black background into something transparent that can be seen through, we will have to add the image below to the Transparency map under the diffuse layer.  Notice the image is black and white.  Just as when we previously used colors only to affect the transparency, white will be completely transparent, black areas will be completely opaque and the gray scale will affect the amount of transparency accordingly.

Chainlink cut out image to be placed in the transparency map under the diffuse layer

Follow the same methods as previously to add the cut out image below to the transparency map and we will get the following render.  The transparency objects are completely opposite of what we want.

The reason for this incorrect transparency actually goes back to the fact that I borrowed these images from 3dS max.  In Max transparency white is opaque, black is transparent.  In Rhino, black is opaque and white is transparent.  Since there is so many existing 3Ds max materials out there, the good people of Vray for Rhino made this transition as easy as checking a single box.   While in the material editor, when the texture editor is open, notice the “Invert” button under the preview image.  Select this when applying the Transparency map and notice the black and white areas have been inverted.

Re-Render and see what we get!

This technique can allow us a lot of flexibility that can save time both modelling and when it comes to render time.  It also allows us to place things such as trees, people, etc. in our scenes.  A future tutorial will further go in depth as to these possibilities.

Let’s now however take a second to discuss UVW mapping.  The reason this is a good time is because we have our chainlink fence that appears to be scaled too large.  We need to adjust the way in which the map (jpeg image) is applied to the plane on which the material is applied.  To do this we will adjust the UVW map of the plane.  The way to think of a UVW map is a coordinate system that is relative to the object that it’s applied onto, NOT world coordinates.  XYZ coordinates refer to the way in which an object is situated in world space, hence UVW are similar coordinates, but relate to the way the material is applied onto the object, having nothing to do with the way that the object is situated in world space.  We actually have the ability to adjust the scale, position, and rotation of the way our material appears on our geometry.  Let’s investigate how to manipulate these parameters to scale down the size of the chainlink.

Select the object that you wish to change the UVW map on.  In the Properties Palette, select the dropdown that currently says “Obejct”.  Change that to the last selection, “Texture Mapping”.

Select the “Custom” radio button and a new set of options will appear.  Take some time to familiarize yourself with these options and test them out.  I will do another tutorial later that goes more in depth with some of these options, but right now you need to understand that the “Projection” setting determines how the image is applied to your geometry.  For example, surface just applies the material to the surface of the object and then “pulls” the image through, often creating weird results if the object has any depth to the geometry.  In that case, box might be a better option.  for more information on these various projection types, look at the Vray for Rhino manual.

For now I will make the change in projection type to “Planar”.  First we will turn on a graphical representation of the image to be applied to the geometry.  Select the “Advanced UI” and then the “Show Mapping” button.  Now we can see a flat rectangle that is perpendicular to the plane.  This object is called the “gizmo” and represents the jpeg image that you are applying to the geometry.  If you rotate this object, the jpeg applied to the material will be rotated.  If you scale it up or down, the map will appear scaled up or down.

Note the Gizmo located in the center of the object, perpendicular to the geometry

We will rotate the gizmo so that is parallel to the plane.  Do do so, either select the gizmo and rotate it in 3D space or under the Rotation, change the X number to 90 (rotating it 90 degrees in the X axis.)  Now to adjust the size of the holes between the chainlink, I will change the size parameter.  Instead of the current numbers, I will change the “Size” parameters to 12 for all three (X, Y, and Z although in this case the z parameter won’t matter I just like to be consistent).  This means that the JPG we have applied is a 12″ x 12″ square.  This becomes important when working with real world scaled objects such as brick or wood flooring, etc.

Notice the gizmo size has now changed.  A re-render shows the geometry with a smaller scaled pattern of chainlink.  We can continue to adjust these numbers until we get the desired result.

A rendering with the rescaled UVW map

Remember that the UVW mapping is based per object.  If I have 4 brick walls, I will need to take the time to adjust their individual UWV maps, one adjustment won’t apply to all object with the same material.

Please come back later this week to get part 3 of this tutorial: Reflection and Refraction Layers

Advertisements

Actions

Information

3 responses

18 01 2012
Vray Materials Part 4 – Refractions « macdesignstudio

[…] remember that in order to see the refraction, we are seeing through the material.  How do we see through a material?  The  diffuse transparency!  Right now, it’s showing as black which makes the object 100% […]

28 01 2012
Vray Materials Part 5 – Emissive « macdesignstudio

[…] If you’re having trouble with getting the image to look the way you want it to, check out the UVW mapping tutorial. […]

18 12 2013
Vray Material Basic – 2 | berita dan informasi arsitektur

[…] ) Vray-materials-part-2-transparency-maps-uvw-mapping […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: