Week 2: Vray Review

Course [[Course:100b f13 creedon|]]
Date 2013/02/01
Learning Objectives This workshop will build off of your experience with V-ray from 100A, enabling you to make simple renderings with variable materials. You'll be exposed to specific materials, texture mapping, image mapping, and bump/displacement maps. These skills will help you take your renders into another level of complexity.
Agenda
  • Interface/Assigning Materials (5 min)
  • Camera Setup (10 min)
  • Sun System (5min)
  • Creating Composite Materials (25 min)
    • Image Mapping
    • Texture Mapping
      • Displacement and Bump Maps
Uses Tool(s) VRay , Rhinoceros

Introduction

Before we get started, here's a teaser that shows the power of rendering and post-processing from a group called The Third and the Seventh
Compositing Breakdown

VRay is a photorealistic render engine plug-in for a variety of 3d modeling programs, including Rhino. While it is an extremely powerful rendering engine with globla illumination, irradiance maps, and raytracing, it's also a complicated one. There are many different variable settings that can change how your rendering comes out and it will take many rounds of trial and error to get exactly what you want out of the renderer. This may be time-prohibitive, especially when you are just beginning to use VRay. Our goal is to use the software as a set-up of lighting, shadow, and perspective, then take the result into Photoshop or another photo editing program to get finer details.

Interface

The toolbar for VRay consists of the following buttons (listed from left to right):

VRayToolbar.PNG

Material Editor
Create, edit, and assign materials to objects.
VRay Options
Edit VRay settings and load preset settings. Options shown here include settings for Camera, Output (image), Environment, Displacement, and Indirect or Global Illumination.
VRay Frame Buffer
Open rendering window.
Add Sunlighting System
Create a system based on physically based daylight, or set it to a specific location and time.
Add Infinite Plane
Creates an infinite plane along the XY plane at the Z zero location, creating a horizon.
About VRay
Information about VRay

Materials & Layers

There are two ways to access the Material Editor in V-Ray: from the toolbar and from the Object Properties panel. Using the V-Ray toolbar, left click on the icon that looks like a tag with the letter "M" on it. Or, select the object(s) to create a V-Ray material for. Use the Properties command and select Material from the drop-down menu. Assign by Plug-in and then click Create.

Creating Materials

Open the Material Editor in V-Ray. Right click on Scene Materials and select "AddVrayMtl."

New material.jpg

New Material Vray.PNG

Assigning Materials

Materials can be attributed to both layers as well as individual objects by using the Material Editor. Materials can be made up of different layer attributes (such as texture, transparency, bumps, etc) in effort to not read more than a flat texture mapping. Sometimes these layers depend on a value (such as intensity or a percentage of transparency) while other times they come from a gray-scale image.

You can quickly view what these materials look like by changing the view to Rendered View which offers a simplified version of the texture maps on the object. However many of the details will change once you actually render the image so it is important to test render throughout the process to check your work.

The next step is to attribute the material to objects or layers. Materials can be applied in two ways: from within the V-Ray Material Editor, or within an object's Properties in Rhino.

In the V-Ray Material editor, right click on the material name, and then click on either "Apply material to layer(s)" or "Apply material to object(s)".

VRayApplyMaterial.jpg

To attribute the material to objects or layers in Rhino, select the objects or layers. Then, use the Properties command and select Material from the drop-down menu. Assign the material by Plug-in, and then click Browse to select the desired material (in the case of this workflow, the material is called Screen1).

VRayApplyMaterialinRhino.jpg


Camera Setup

When setting up your rendered views in Rhino, you want to think about how the camera is being used to helpfully depict your scene, for whatever purposes. You may wish to focus on circulation and get a close up of the stairs and passages into a space, or you may be interested in a sequence of spatial experiences as you move through a space or series of spaces. Regardless of your focus, a healthy understanding of how to set up your camera shots will be imperative in helping you reveal these various conditions clearly.

You can set up your camera automatically with the OrientCameraToSrf command covered last time, and then change your perspective settings in the properties box, but if you want subtle changes, manual options are also available, covered below.

Saved Views

As you should know by now, by clicking View>Set View>Named Views, you can Save your Camera View and access it again later. You may find that much of your model is not needed for the particular render your putting together. To save file space, you can delete the superfluous geometry and re-save the file as the render name or whatever you like. Below is an example of when a particular shot requires only a piece of the whole model.

(Left: Saved View, Right: Simplified Model (200C, 2011):
St marys rendering.jpg

Walkabout

If you make a 5' tall vertical surface off of the ground plane and OrientCameraToSrf, your camera will be 5' off the C-Plane. From here, if you type Walkabout your z-axis height locks, but you can zoom in an out along the 5' tall plane, as if you were walking around in 3d space. You can tell you're in WalkAbout mode by a small cross-hair in the middle of the screen, shown in the image below. To exit WalkAbout mode, type it again.

Walkabout example.jpg

With WalkAbout turned on, you can also look around or "LookAbout", though that's not a command. Without zooming, you simple orbit around and the point you are at will be held, while the rotation around that point will be adjusted, like you were looking around without moving.

View Camera / Set Camera

To properly set you camera, you'll probably want to see where it is in 3d space. This is viewport specific, fyi. By simply typing "Camera", you can show the camera in the viewport you are in. The camera will show up in the other viewports, so make sure you open all 4 viewports to accurately see the camera.

For example, if I type Camera>Show, and I'm in the perspective Viewport (shown below), the camera will appear in all three other viewports, exposing how it's framing the perspective viewport. If I type Show for another viewport, like Front View, the same thing will happen, and the other three viewports will pick up that camera scene.

Camera show.jpg

View Angle

If you want your view to be exactly 30 degrees up from a straight on view, you can use the appropriate view port to draw a guide line (make sure Osnap for Points is on) and then move your cone point or mid point into th new position.

Sunlight System

Sun positions.jpg Sunbox.jpg

The Sunlight System, when partnered with the Physical Camera settings and various options within Vray, give the user a great range of flexibility in creating accurate daylighting renderings for 3d models. First off click the Sunlight System button at the V-Ray menu to bring up the dialogue box. Here you have the option to manually position the sun with horizontal and vertical angles (be sure to keep the sun above the horizon or you will not get illumination). You can also choose a specific location and specific time if you want to place the rendering within your given site.

You can also adjust the settings of the sunlight by selecting the light within the rhino screen. Once selected input properties or click the object properties tab in the tools menu. This will bring up the Object Properties Dialogue Box, here click on the drop down menu and select Light under object. This box gives you the option to re-position the light with the modify button. Below this there are other buttons that effect the way the sun performs in the renderings.

Turbidity, when the value is raised increases the atmospheric haze creating a smoggy effect, and a warmer color cast (3 default - 6-12 warm - 20 heavily altered) Ozone, when raised gives a blue cast to the scene (0.35 default - 1.0 blue cast) Intensity Multiplier, when raised the sun's strength becomes stronger (levels depends on camera settings) Size Multiplier, when raised creates softer shadows (1 default - 6 soft shadows -12+ very soft shadows)

Light props.jpg

Creating Composite Materials

Color can be added to a material by simply selecting a color for Diffuse. However, to make your renders look convincing, you'll often want to employ a specific material to a surface. Just using a color for the material will render too flat and even. To add some texture and irregularity to the color of the material, an image map should be used. In order to do this, I wouldn't always take the time to make a new material from scratch, since V-Ray comes pre-loaded with sample materials that often are only in need of updating for nice results. However, if the material you want isn't there, you can create materials from scratch, which we are going to do with some concrete.

Use these files to follow along:
Rendered Room.3dm
Concrete Image.jpg
Concrete Image_bw.jpg

Image Mapping

To start, you'll need to make an image to map onto a surface, simply called an "image map". You'll need to find an image of concrete. Not any image, but a nice image for tiling, without overly distinguishing areas that will be noticable in the tiling. These sites have some good selections for various material image maps:

CGTextures
Vast library of high-resolution textures for download. Account registration required.
Maya NG's Textures
Over 4250 free, high-resolution textures. Limited to 20 downloads per day.

I've selected this image:
Concrete image.jpg

Once you have your image, you need to apply it to a material in V-Ray. You do this by opening the V-Ray material editor, right clicking on "Scene Materials", selecting Add Material, and then clicking "Add VRay Mtl". Make sure to rename your new material by giving it a name that matches the material, such as "Concrete".

Add vray mtl.jpg

If you click the grey "Diffuse" layer, you'll notice a small "M". By clicking it, you'll open a new menu box that will allow you to apply your image map. Select "Bitmap" on the left menu and then upload the image and click "Apply". You can update for a preview of the change.

Bitmap apply1.jpg

Once you have the image mapped, apply the material to a layer or surface. The result should look like this:
Concrete without scale.jpg

Adjusting the Scale

Depending on the scale of the model, the way the model was built, and the default settings in V-Ray, the image map and transparency map may not be rendered in V-Ray accurate to the scale of the building in real life. The image map may be enlarged and look stretched out, or the transparency map may not create the right effect because of its size relative to the building.

The test render should reveal whether or not the image map and transparency map are mapping at the right scale.

To change the scale of the perforations, edit the UVW of the transparency map in the Material Editor, under UVW Transform. In the Repeat column, increase the values of U and V to increase the number of times the image map repeats within each surface. Click on the Update button to preview the material texture.

Uvw.jpg

Changing both the U and V repeat setting to 8 should work for this room, but you'll have to adjust for different sized models. Offsetting the tiling can help avoid seams jumping out, but if you want lines to match up, it won't help. It's safe to use when you don't have a lot of straight lines in your image map. I'm not using here.

Once the scale is adjusted, the image should come out like this:
Concrete alone.jpg

Though the scale is right, the image is flat and lacks texture.

Texture Mapping

In order to add some depth to the material, we can add a bump map or a displacement map. These work like image maps, but add texture instead of an image. You'll need another version of your file that is black and white only,where white represents the part of the image you want to "pop out" slightly. Doing this in photoshop is easy.

A big difference between bump maps and displacement maps is that bump maps do not affect shadows, while diplacement maps actually alter the geometry for the render, and therefore affect shadows in the final output. They are set up in the same way. For this workshop, let's use the displacement map. Follow the same steps as the Image Map, including the UVW Transform scale changes, only add the new black and white concrete image as the Bitmap. Hit Apply.

Displacement map.jpg

Your image should now come out like this:
Concrete with bump.jpg Wall bump.jpg

The color here is yellowish, so with some small changes in the VRay options, including updating the white balance, and changing the primary rendering engine to "Irradiance Map", we get a better color balance.

Concrete with bump and irradiance.jpg

For more on editing VRay options, including skies and more camera settings, you should visit this helpful page: VRay 1.5 for Rhino

Transparency Mapping
Though we won't get into it here, there are also Transparency Maps, which you can check out here: Transparency Maps - VRay

Additional Resources

Introduction to VRay
This workshop will introduce VRay as a tool for rendering. The underpinnings of this rendering software, including settings and material selection/creation will enable you to create specific and variable images of your Rhino3d models. The goals here will not be to create "finished products" directly from VRay, but rather to help you generate a "base" image that will be further refined, edited and contextualized in Photoshop and possibly Illustrator.
Vray 1.5 for Rhino
Many options for polishing your renders in VRay, including how to use HDRI skies, VFB channels, ISO and Shutter speed settings and more.
Best Practices in VRay Rendering
VRay is a powerful tool for rendering realistic scenes from a 3D model. Generally, a model is built, a point of view is chosen, the scene is rendered, and the resulting image is edited. This workflow will show the basics of rendering in VRay, including render settings, material selection, and texture mapping.
Creating Composite Materials Using Image-Maps in VRay
Using the facade of the de Young Museum as an example, this workflow demonstrates how to use custom-generated image maps to define composite material "layers" in V-Ray. Using the material editor dialog, we will edit the transparency, diffuse, and displacement layers to create the pattern of punches across the material, alter the color using an image map, and simulate the bumps of the material.
Creating various rendering effects with VRay
This workflow shows how to use Vray for Rhino to create various rendering outputs, using the Sunlight System and the numerous options with the Render Options Dialogue box and the Light Properties Dialogue box.
Rendering with Hidden Geometry in Rhino & VRay
This workflow shows a simple method for rendering 3d models to show cut sections or plans while maintaining true lighting. We will utilize specific tools in Rhino to split our model, than create transparent materials in VRay to "hide" our cut-away model while leaving its ability to block light.