Tuesday, May 8, 2012

Vray speed tips for 3d visualisation


Here is a compiled list of tips that can improve Vray rendering speeds whilst maintaining a high level of quality. These tips come from my own experience, they may help improve your rendering, but they are not to be used as a definitive solution as every 3d project is different. I have categorised each tip to make it easier to follow and although some may seem obvious, I thought they should be mentioned as they can be useful.

Global switches

Geometry
  • When working with 3rd party CAD data, specifically Autodesk Inventor 3d files imported into Autodesk 3ds Max, leaving displacement ticked increases render times considerably. I assume this is to do with how it reads the mesh data. Obviously you will need to leave this on if you plan to have displacement in your scene, if not, turn it off.

Indirect illumination (GI)

Irradiance map
  • This GI method is resolution dependant, so adjust the min/max rate to suit your output resolution.
  • If you have multiple camera views for the same scene, save out an incremental irradiance map. The same map can be used providing there is over lapping geometry between camera views. This will save you some rendering time.
  • Tick show calc. phase, this will show you the irradiance map as its calculating. After a few seconds you will begin to get an idea of the general illumination of the scene. If it is incorrect you can cancel the render, therefore only wasting a small amount of time.
Light cache
  • Tick use light cache for glossy rays, this can reduce rendering times by quite a lot if you have heavy glossy reflections in your scene. Keep in mind that it is very dependent on the scene and because of this, in some instances it can lead to unwanted artefacts. There are multiple steps you can take to avoid this happening.
Option A
If you have the latest version of Vray (which is 2.0), there is an added feature called retrace threshold which improves the precision of the global illumination and helps eliminate light leaks when use light cache for when glossy rays is on.
Option B
Set the filter to fixed and adjust the filter size to two or three times the sample size. So if your sample size is 150 mm set the filter size to 300 mm.
Option C
Within a material, scroll down to the options panel and set treat glossy rays as GI to always. Also turn off the use light cache for glossy rays if you have it on. By doing this you are telling the material to always use the secondary GI engine to calculate the glossy rays, which in this case is the light cache. It basically does the same job as use light cache for glossy rays but you can specify which materials within the scene use this option.
  • Use screen as a method for scale when dealing with scenes that have large ground planes and distant objects. If you choose world scale, you may find that these distant objects can become very noisy, and you may decide to increase samples to remove this noise which will lead to longer render times.
  • Set your number of passes to the number of processor cores you have in your PC. Even if you have multiple cores over multiple PC’s, the light cache is only calculated on one PC.

System settings

Memory
  • By default, Vray sets the dynamic memory limit to 400, but this can actually go a lot higher. It is recommended to change this to a value that is half your RAM amount. For example if you have 8GB of RAM, you can set this to 4000.

Common

Image output size
  • It is important to understand render output resolution and DPI, Make sure you know what’s happening to the render once you have signed it off. If you have rendered an A3 image at 300 DPI and you then later on find out that image was going into a small area on an A5 leaflet, you have rendered your image at a higher resolution than what was required.

Render elements

  • Save out all your passes as separate files to later on composite them in post. This will allow you to tweak each individual aspect of your render such as lighting, reflection, refraction and shadow without the need to re–render the whole image again.

Image sampler

Antialiasing filter
  • Sharpening filters such as Mitchell-Netravali and Catmull-Rom may increase noise within the render, to compensate more samples are required to reduce the noise level. Turn the filter off completely and add it in post. Renders of around 3000 pixels are fine without a filter. Only use a filter when rendering smaller images to avoid antialiasing issues
Type

  • Adaptive subdivision is best used for flat non reflective materials such as buildings, whereas adaptive DMC is better and faster for glossy materials and camera blur.

Material editor

Reflect
  • When adjusting the reflective glossiness, you will need to increase the subdivs value to compensate, otherwise you will get very noisy results. Do not fall into the habit of setting the subdivs to a value you use throughout your scenes. Setting all your reflective materials to a subdivision of 32 for example, is not a solution. In fact it will increase your render times unnecessarily. Keep in mind that the higher the reflective glossiness, the lower subdivisions you can have. If you have reflective glossiness set to 0.85 you can set your subdivisions to 16 or even lower depending on your set up. If the reflective glossiness is set to 0.6, it would require a higher subdivision. This requires a little experimenting but it is good practice, especially for architectural visualisation, to have a default library of materials that you can use for multiple projects. This way, you won’t have to keep adjusting subdivisions because you know that material from your library is good enough.
Refract
  • From experience, adjusting the refraction glossiness does more harm than good unless you are aiming for a frosted effect. If not the majority of results are less than noticeable, and the render times are through the roof. Keep this at 1.0. You will save so much render time this way.
Vray materials
  • Vray calculates its own materials faster than non Vray materials because they are specifically optimised for Vray. A scene can easily be converted by right clicking the viewport and using the Vray scene convertor.

Preferences

Gamma and LUT
  • Without gamma correction, you are forced to add extra Vray lights in darker areas to further illuminate a scene causing the render times to go up. Gamma correction gives more luminance therefore fewer lights are needed. Within the 3ds Max preferences, enable gamma and set it to 2.2 and tick affect colour selectors and material editor. You will also need to change the Vray gamma. In the render setup under colour mapping set the gamma to 2.2.

MintViz is the owner and author of this content. Please click the following link to be redirected. http://www.workshop.mintviz.com/tutorials/vray-speed-tips-for-3d-visualisation/#ixzz1uGfZlib1
Under Creative Commons License: Attribution Non-Commercial

Compositing Vray render elements


The purpose of rendering out multiple passes is that it allows you to tweak all aspects of an image such as global illumination, direct light, diffuse, reflection, specular etc. These passes can then be compiled together in Adobe Photoshop.
The whole process of saving out the different render passes may seem like an extra task within your workflow but it will save you a lot of time, especially if you wish to reduce the reflection of a material or change the colour of an object. Without render passes you would result in rendering the image again and that is not the best way to go if you have a deadline looming.
Vray has multiple render elements, some are compulsory where as others are not. To view a list of render elements that Vray supports click here. Before I start, I would like to point out that I will be using a linear workflow with a gamma 2.2 setup within 3ds Max and Vray. I strongly recommend setting this up as it will improve many areas within your workflow. You can find an easy to follow step by step guide here.

Selecting the render elements

Within the Vray render settings go to the render elements tab and add the following elements.
VrayRawGlobalIllumination
The difference between VrayRawGlobalIllumination and VrayGlobalIllumination is that the raw version is not multiplied by the diffuse colour. This allows much more control in post processing
VrayDiffuseFilter
The pure diffuse surface colour, combined with VrayRawGlobalIllumination it will give you VrayGlobalIllumination.
VrayRawLighting
This element works in the same way as the VrayRawGlobalIllumination. Combined with the VrayDiffuseFilter the result will be VrayLighting
VrayReflection
The reflections on the surface.
VraySpecular
The surface specular highlights.
VrayMtlID
As long as you have given all your materials within your scene a material ID, the resulting render element will be a mix of solid colours that correspond to a material ID. This can then be used to colour pick areas within your render to adjust in post.

Providing you are using the Vray frame buffer leave all settings as they are. There are other render elements that are not included in this guide that you may need depending on the type of project, such as VrayZDepth for DOF, VrayRefraction to control the opacity and VrayExtraTex combined with Vray Dirt to create an ambient occlusion pass.
Additionally you can add the VrayRawShadow element to control the intensity of shadows but from experience, the outcome is sometimes less than desired because of the low amount of samples it uses to calculate. Similar to the diffuse pass, the end result is not very smooth. It’s best left combined with the GI and lighting elements.
Vray render elements also work best with Vray materials, if some of your objects are standard materials they may not function correctly as a render element. So double check that your objects have Vray materials applied before you render.

Auto save the render elements

Because there are many passes saving these out one by one is time consuming and out of the question when you are creating an animation. In the Vray frame buffer rollout tick split render channels and choose a location to save the render passes. I recommend saving as a TIF file with at least 16 bit Colour. This will allow for maximum range when adjusting the levels in Adobe Photoshop.
Leave save RGB and save alpha ticked. The RGB will be the completed render which combines all the render elements before any post production, this is known as the beauty pass. Due to the fact that you are saving the resulting image here, you do not need to specify a location for the render output in the common tab. Ignore the pop up warning for no files saved.
At this stage it is important to note that if you are following the gamma 2.2 and linear workflow setup mentioned earlier the rendered image will appear darker in the Vray frame buffer because don’t affect colours (adaptation only) is ticked. To see the actual result click the sRGB button in the Vray frame buffer during or after rendering.

Compositing the render elements in Adobe Photoshop

In Adobe Photoshop go file/scripts/load files into stack. Then select all the render elements and click ok, this will add all the elements into a single work file for you. Then re-order the stack into the following:
  • Alpha
  • RGB Colour
  • VrayMtlID
  • VraySpecular
  • VrayReflection
  • VrayRawLighting
  • VrayRawGlobalIllumination
  • VrayDiffuseFilter
The VrayDiffuseFilter will be used more than once and is combined with other render elements. A main purpose for the diffuse pass is to easily apply colour correction and if necessary, change the colour of an object completely. So that you do not have to manually adjust each diffuse pass, convert it to a smart object by right clicking the layer and choosing convert to smart object. Now duplicate the newly created smart object and place it under the VrayRawLighting so that both main light sources now have a diffuse layer to blend with.
To edit the smart object at any time, double click the layer and it will open in a new window. Once completed save and close and it will automatically update the smart object and any duplicates within your composition.
Set the VrayRawGlobalIllumination blend mode to multiply and create a clipping mask so that the blending of the VrayRawGlobalIllumination only affects the layer it has been clipped with. To do this hold down the Alt key and click between the VrayDiffuseFilter and VrayRawGlobalIllumination (The cursor will change into two circles). Repeat this step for the VrayDiffuseFiltercopy and the VrayRawLighting elements.

Group both the VrayRawLighting and VrayDiffuseFilter. Do the same for the VrayRawGlobalIllumination and VrayDiffuseFilter. Then change the blend mode between the two groups to linear dodge (add).
Linear dodge (add) adds the colour information from the blended layer and removes the black because it is seen as a value of 0 and is therefore invisible. A basic terminology is anything that adds light is to be linear multiplied such as GI complete with diffuse, reflection, specular etc.. Anything that takes away light (such as shadows) is to be multiplied.
Turn on the VrayReflection and VraySpecular layers and set both of their blend modes to Linear dodge (add).

Gamma correction

At the start I mentioned that the composition will appear darker than normal. This is because we are still working in linear space. Add a levels adjustment layer on top of the stack and change the middle Input slider to 2.2. The middle input slider adjusts the gamma in the image. For more information on level adjustments click here.
Some gamma users have mentioned that the results can appear washed out. To correct this you can add further adjustment layers to improve the colour and contrast.

This has been a summary of the required render elements to complete an RGB beauty pass. There are many more elements and adjustments that can be added to aid with post processing. However, it is very much down to the type of project and the result you are after.

MintViz is the owner and author of this content. Please click the following link to be redirected. http://www.workshop.mintviz.com/tutorials/compositing-vray-render-elements/#ixzz1uGVEGXWA
Under Creative Commons License: Attribution Non-Commercial

Flicker free animation using Vray


Rendering an animation using indirect illumination (GI) methods that rely on caching samples are known for producing frames that flicker. This is because the samples of each rendered frame are calculated differently, causing different lighting values per frame. To resolve this, an animation can be rendered using a pre-calculated solution where the same sample data is used for every frame. You would pre-calculate both GI methods, commonly the irradiance map and light cache, by choosing multiframe incremental mode for the irradiance map and fly-through mode for the light cache. The irradiance map and light cache combination is effective if you have no moving objects within your animation. So it is advised to be used only when creating fly-through animations.
If you pre-calculate a rendering solution for an object that has a set position for x, y and z. Then move that object to a new x, y and z position, there are no pre-calculated samples in the rendering solution for the new position of the object. Therefore you will notice artefacts and splotches within your render. This combination is a fast solution, compared to rendering using brute force which calculates the samples for every single shaded point separately and independently from other points. Although the result is very accurate and flicker free, it is very slow.
To avoid flickering frames, Vray introduced time-interpolated irradiance maps as part of SP2. The primary function is to reduce the amount of flickering that occurs when using the irradiance map GI method. It works by blending a range of samples from several irradiance maps causing a smoother transition between frames. The range is determined via the interpolation frames parameter.

The use camera path parameter

Whilst time-interpolated irradiance maps solve the majority of flickering, there is still the added flickering from the camera. This happens because the irradiance map is calculated by tracing rays from the camera and as the camera is moving, the rays will be calculated differently for each frame. The use camera path parameter that is part of SP3 alters how the rays are shot from the camera. Instead of shooting them from the current camera position on every frame, it will shoot them for the entire camera path, resulting in the same rays being used for every frame.

Animation prepass, animation rendering mode

This method is completed within two stages. First, a single irradiance map is calculated for each frame using the animation prepass mode, with a few frames before and a few frames after the actual animation range. The second phase is to render the final animation using the animation rendering mode of the irradiance map. You will not need a secondary GI method because it will be part of the first phase.

Animation prepass workflow

Irradiance map
Tick use camera path and set the mode to animation prepass. Click save and choose name and location for your irradiance map range. Check that auto save is enabled. There should be no samples calculated because you are doing this for the first time.

*UPDATE* After clicking save, it will not store a file there until you actually press render. You are simply pointing to a location for the save to occur.
Light cache
In the light cache rollout, tick use camera path and set the mode to single frame. Alternatively, you can pre-calculate the light cache beforehand and use from file, this may save you some rendering time.

IMPORTANT! Once the prepass has been completed you will need to specify the amount of blending between the irradiance maps. So before you render, you will need to decide on how many irradiance maps you wish to blend. This is because it effects your animation timeline range. For example, if you have a blend of 2, this means it will blend 2 frames before and 2 frames after. In order to render frame 5, it will blend frames 3,4,5,6,7. Frame 6 will blend frames 4,5,6,7,8 and so on.
Increasing the number of blending frames reduces the chances of flickering, but this will also increase render times. If you increase the value too much, the result will be over smoothed you will lose detail. That said, frame 0 needs to have frames before it in order to blend correctly. Otherwise frame 0 will have less frames to blend than others, causing irregularities. Set your animation starting frame to –2, this will allow frame 0 to blend –2,-1,0,1,2. Repeat this for your last frame, if you animation ends at 100, set the animation finishing frame to 102.

The animation prepass can be rendered via backburner, previous methods have required you to render locally, putting your desktop out of action whilst it renders. If you do have access to another PC, I recommend using it to render the prepass, note that when rendering the preview window will not display a final result.

Animation rendering workflow

Irradiance map
Once you have completed the prepass, you will notice there is now some sample information present. This tells you that it has successfully stored the samples. You can also check by going to your saved location and make sure your full animation range has been saved.

*UPDATE* Select animation rendering mode, it will prompt you to select a file. You must select the first file which in this case is Bouncing_ball.0000.vrmap. This file acts as a call function and will automatically load in the irradiance map range.

In the irradiance map parameters, you will notice that interp. frames is not greyed out anymore. This setting determines the amount of frames that are to be blurred. The animation range is –2 to 102, so 2 would be correct. If you wish to blend 4 frames then set this to 4 but remember that you will be increasing the render times.  You can also lower the interp. samples, when calculating in single frame mode. Interp. samples control the amount of GI samples from each irradiance map that will be used to interpolate the indirect illumination.
Since we are using several irradiance maps per frame, leaving this at 20 would be unnecessary and would increase render times. As the value depends on your interp frames, try a value of 5, do a test render and if the result is less than satisfactory then choose a higher value. From experience, most interior animations require a value of 10 – 12. Use camera path has no effect anymore. So having this on or off for the irradiance map does not matter.

Light cache
You now have two options depending on your workflow, if you have rendered your animation with use light cache for glossy rays ticked, you will need to leave your light cache as the secondary GI engine. Keep it in single frame mode and have use camera path ticked. If you have rendered without use light cache for glossy rays, disable the secondary GI engine leaving only the irradiance map as the primary GI engine. You can do this because the secondary GI data has been stored in the primary GI engine via the irradiance map prepass.

Rendering the final output

Set your animation range to 0 – 100. You do not want to render the frames outside of this range because they will not have the same amount of samples from the prepass. You will now have a flicker free animation.

MintViz is the owner and author of this content. Please click the following link to be redirected. http://www.workshop.mintviz.com/tutorials/flicker-free-animation-using-vray/#ixzz1uGQwySze
Under Creative Commons License: Attribution Non-Commercial

HDRI exterior lighting with Vray


exterior_013


An outline of the techniques used for rendering an exterior scene using Autodesk 3ds Max and Chaos Group Vray. A HDR image will be used to light and reflect the environment and VraySun as the direct light source for a typical sunny day scene.
HDRI stands for high-dynamic-range imaging, which is a 32bit float image format that allows a greater dynamic range of luminance between the lightest and darkest areas of an image.
A HDR image holds enough information to light a scene, where as images such as JPEGs do not hold enough information to light a scene successfully. HDR images can produce good results, but the intensity is still not enough to give realistic hard shadows that would come from the sun. By adding in VraySun as a direct light source, the two methods combined will allow for easy control over time of day and various types of weather conditions.
Before I start, I would like to point out that I will be using a linear workflow with a gamma 2.2 setup within 3ds Max and Vray. I strongly recommend setting this up as it will improve many areas within your workflow. You can find an easy to follow, step by step guide here. This tutorial will not go through the Vray render settings, but you can find a detailed explanation of how to set up the Vray renderer here.

Finding the right HDR image

The choice for time of day and weather conditions will determine what HDR image is required. Within this tutorial it will be a sunny midday scene with minimal cloud. There are various shapes and sizes of HDR images out there on the web. You will need to make sure that the HDR image is a 360 degree spherical image and the higher the resolution the better. When a spherical HDR image has been applied as an environment, Autodesk 3ds Max wraps the HDR image around a sphere. None spherical HDR images will not wrap around the sphere correctly and produce incorrect results. Resolution matters only if you are planning to use the HDR image as a back plate. If the HDR image is only to be used to light a scene, you can get away with a much smaller resolution.
You would want a HDR image that has maximum sky and a hint of a horizon. Typically a HDR image is pure black under the horizon and therefore will not cast any light. In theory it will also be covered up by geometry.

You can also find HDR images that are pure sky with no horizon. This type of HDR image allows for maximum light, there is no pure black present.

Aligning the HDR image in the viewport

A 360 degree spherical image has a narrow aspect ratio. By default the 3ds Max viewport is 4:3 (1.33) which is a standard resolution of 640 x 480 pixels. As a result of this, you will not be able to see the full height of the HDR image no matter what aspect ratio you choose and this is due to the nature of a computer screen. The majority of exterior visualisations are viewed from a person’s eye line. If the sun is high up in the sky, it will not be visible within the viewport.
Start by setting your 3ds Max standard environment to a VrayHDRI.

Next drag and drop the material from the environment rollout to an empty slot in your material editor. Choose instance and then load in your HDR image. Here you can select spherical for the mapping type.

Go to views, viewport background and tick use environment background and display background. Under apply source and display to change the view type to all views.

HDR images are typically over exposed and may appear blown out in your viewport. To fix this, lower the overall multiplier so that you can clearly make out brightest spot within the HDR image, in this case it is the sun with no clouds. The render multiplier is there if you only wish to affect the map upon render time and not in the viewport.

Next add a Vray physical camera to your scene and point the target up in the sky. Move around the viewport and locate the brightest spot within the HDR image. Ideally the brightest spot needs to be in the centre of your viewport. You can leave the Vray physical camera settings at their default. Do not rotate your HDR image using the horizontal rotation in the material editor; this will need to remain at 0.0.

Once you have aligned the Vray Physical Camera to the bright spot within the HDR image, change the HDR image overall multiplier back to 1. Render your scene using the Vray physical camera with everything hidden so you only render the viewport environment. Once complete, within the Vray frame buffer click duplicate to Max frame buffer and leave it open. This is used as a reference so you can check that the VraySun lines up correctly.

Adding the VraySun

Add a Vray sun to the scene and choose yes to adding a VraySky map to the environment when prompted. This will replace the current HDR image in the viewport. Again, the VraySky map may be over exposed but there is no need to view the VraySky within the viewport, so turn off the viewport background.
Using the align tool, align the VraySun target to the Vray physical camera and then align the Vray physical camera target to the VraySun. The height of the VraySun will vary depending on where the bright spot is within the HDR image. The higher the VraySun the brighter the VraySky, this simulates the time of day. As an example the height of the VraySun for this scene after matching it to the HDR image is roughly 50 times the height of the building.

Render only the environment background using the Vray physical camera. If your sky is over exposed then adjust the f-number of the Vray physical camera to something like 12. Compare the rendered VraySky to the previously rendered HDR image. Both suns should be roughly in the same place within the image.
You may need to adjust the size of the sun within the VraySun parameters. Adjust the size multiplier but keep in mind that the larger the sun, the softer the shadows. A range of 2 – 10 is adequate. All other settings can remain at their defaults.
Depending on the scene, there are multiple options available for the type of sky used with the VraySun.
Preetham et al
This is typical blue sky that has a visible atmospheric haze.
CIE Clear
Again a typical blue sky, but it has less atmospheric haze which tends to give a deeper more saturated blue
CIE Overcast
A very diffuse and desaturated sky that you would typically get in overcast weather conditions. You would normally use very soft shadows, which are controlled by the sun size.

Adding environment light

Place a VrayLight in to the scene and change the type to dome, set the intensity multiplier to 1 and under texture, drag and drop the HDR image from the material editor and chose instance. Make sure the Vray light dome is perpendicular to the ground plane.
If you want the HDR image to be visible when rendered, keep invisible un-ticked and if you plan to add your own sky in, post production then tick invisible. The VraySky will then be the background for the render; this can be removed via an alpha mask whereas the HDR image cannot.

The resolution and the adaptiveness of the texture affect the way shadow rays are generated towards bright area of the HDR image. Increasing the resolution requires more RAM and slows down the render times slightly, but it will make the adaptation follow more closely with the intensity of the HDR image. Within the majority of scenes this goes unnoticed, so the default resolution and adaptive amount is adequate.

Setting up the multipliers

In the material editor, make sure the HDR image overall multiplier is set to 1. Also set the VraySun multiplier to 1. You can control the level of intensity via the Vray physical camera settings. Keeping all multipliers at 1 and the default settings for the Vray Physical Camera is a good starting point. Then adjust the exposure to suit your scene. You can turn off the Vray dome light and complete a test render to see the effects of the VraySun and vice versa. By doing this you can see how one is affecting the other and then find a healthy balance between the two.

Making final adjustments

Remove the VraySky from the 3ds Max standard environment as this is no longer required because the scene will be lit via the Vray dome light. It was only used to make sure that the VraySun was aligned to the HDR image correctly and was the right size.
Next within the Vray physical camera settings, change the white balance to daylight as this will add a colour filter to the render. This is not a requirement, you can choose to have a neutral colour balance of white if you prefer.

You may need to increase the sampling subdivisions of the Vray dome light. If your shadows are very noisy, increase the subdivisions by multiples of 8 until you are satisfied with the results.

The resulting render has a visible reflection within the windows. The Vray dome light does two things, illuminates the scene and adds a reflective environment. There is no need to add a reflection map in the Vray GI environment (skylight) override.

Rotating the VraySun and HDR image

At the moment the sun is to the right of the building. Obviously if you were to move the VraySun to front or the left side you would want the HDR image to rotate also, so that the two suns stay together. This can be achieved by wiring the horizontal rotation of the HDR image to the Z rotation of the Vray dome light.
When rotating HDR images, they are rotated by degrees. Because the 3ds Max rotation is also in degrees, wiring HDR image and the Vray dome light together is very straight forward. There would only be any complication when trying to wire an image that uses U and V as rotation, which is essentially X and Y coordinates. If for example you use EXR images instead of HDR images, you would need some method of converting the different forms of rotation.
Hide everything within your scene except the VraySun and the Vray dome light. In the top view, position the Vray dome light half way between the VraySun and its target, it doesn’t have to be exactly to centre.
Using the select and link tool, select both the VraySun and its s target and link them to the Vray dome light. Test that the link was successful by rotating the Vray dome light on its Z axis, the VraySun and its target should rotate around the Vray dome light. If you have rotated the Vray dome light, undo this step as it needs to be in its original position.

Still in the top view, select and right click the Vray dome light and choose wire parameters, transform, rotation, and then Z rotation.

A wire will appear prompting for you to select an object so select the Vray dome light itself. Then choose object (VrayLight), texture, and then horizontal rotation.

In the new pop up window, choose one-way connection: left parameter controls right parameter. In the expression window put a – (Minus) in front of Z_Rotation. This is to make both the Vray dome light and HDR image rotate in the same direction. Otherwise the Vray dome light will rotate in a clockwise direction and the HDR image will rotate in an anticlockwise direction. Press connect and close the window.

This allows you to control the rotation of the HDR image shown within the material editor by rotating the Vray dome light on the Z axis within the viewport. Now the position of the brightest spot within the HDR image will follow the VraySun. You will notice that you can no longer rotate the HDR image by horizontal rotation within the material editor, this is now greyed out. You can see the results by rotating the Vray dome light and watching the HDR image within the material editor rotate in real time.



Monday, May 7, 2012

Vray 2.0 Materials Guide

1Diffuse
2Reflection
3Refraction
4Translucency
5BRDF
6Options
7Maps
8Reflect/Refract interpolation
9About MintViz
 
A more in depth look at each setting within a Vray material for version Vray 2.0.

Diffuse

Diffuse

This is the actual colour of the surface, reflection and refraction colours can affect the visual appearance of this colour. It is important to understand that no material in the real world is pure white RGB (25,255,255) nor pure black RGB (0,0,0). When creating a white or black material, set the colour values to an off white RGB (245,245,245) / black RGB (2,2,2). If you render an object that is pure white or pure black you will notice that there is no contrast. The light rays are bouncing all over the place, and not being absorbed.

Roughness

Can be used to simulate dust on a surface by controlling the way the surface reflects direct light.

Reflection

Reflect

Like diffuse it uses a colour value to determine the reflection strength. White RGB (255,255,255) is fully reflective and black RGB (0,0,0) is not reflective at all. By using colour instead of grey scale you will get coloured reflections. You would commonly use a grey scale value to determine the reflection strength and there is no right or wrong value so you will have to take your best judgement. However the following can be used as a guide.
By default the reflection colour acts as a filter for the diffuse colour and the stronger the reflection colour the dimmer the diffuse colour.

Metals

• Pure aluminium polished, 80 - 87 %
• Pure aluminium matte, 80 - 87 %
• Polished aluminium, 65 - 75 %
• Matte aluminium, 55 - 75 %
• Aluminium painting, 55 - 65 %
• Chrome polished, 60 - 70 %
• Steel, 25 - 30 %
• High polished copper, 60 - 70 %
• High polished brass, 70 - 75 %

Composites

• Light oak (Polished), 25 - 35 %
• Dark oak (Polished), 10 - 15 %
• Wood chipboard, 25 - 40 %
• White paper, 70 - 80 %

Ceramics

• Granite, 20 - 25 %
• Lime stone, 35 - 55 %
• Polished marble (Depending on colour), 30 - 70 %
• Light stucco, 40 - 45 %
• Dark stucco (Rough), 15 - 25 %
• Concrete (Rough), 20 - 30 %
• Bricks new, 10 - 15 %
• White tiles, 75 - 80 %
• Glass, 5 - 10 %

Finishes

• White enamel, 65 - 75 %
• White lacquer, 80 - 85 %
• Silver mirror, 80 - 88 %
• High polished mirror, 92 - 95 %

Diffuse colour also affects the reflection intensity. White reflects the entire visible colour spectrum whereas black absorbs all colour.

• White, 75 - 85 %
• Light grey, 40 - 60 %
• Middle grey, 25 - 35 %
• Dark grey, 10 - 15 %
• Light blue, 40 - 50 %
• Dark blue, 15 - 20 %
• Light green, 45 - 55 %
• Dark green, 15 - 20 %
• Light yellow, 60 - 70 %
• Brown, 20 - 30 %
• Light red, 45 - 55 %
• Dark red, 15 - 20 %
• Black, 2 - 5 %

Fresnel reflections

Most materials except metals have a Fresnel reflection, making the reflection strong at glancing angles but weak at more front on angles. A good example of this would be to look at an old CRT monitor, where the viewing panel is glass. If you position yourself to the side of the monitor and look into the glass you will clearly see a reflection of the environment, but if you position yourself directly in front you will notice that the reflection is reduced. Fresnel is a good approximation and is as close to physically correct materials as you can get whilst keeping the rendering times low.

The Fresnel Effect was first documented by the French physicist Augustin-Jean Fresnel (1788-1827). Fresnel studied the behaviour of light and how it was transmitted and spread by different objects.
IOR stands for index of refraction and is used to measure how light refracts through a surface relative to the viewing angle (Yourself), confusing at first but read on. Place a stick in a pool of water, notice how the stick bends below the water surface? As light passes through the water surface it changes speed and bends.

IOR can also be used to measure reflection and how light reflects off a surface relative to the viewing angle (Yourself) and although calculated in a slightly different way they are usually directly proportional. Therefore the same IOR value is a good approximation for both reflection and refraction. This is why by default it is locked to the refraction IOR. A formula known as Snell’s law is used to describe the relationship between the angles of incidence (Viewing angle) and refraction which gives you the IOR.
You can find many IOR tables on the internet and they all give different values for real world materials. The truth is there is no actual value, it depends purely on the material and its characteristics such as dirt, scratches rust and so on. But if you need a value then below is a good starting point for the most common materials.

• Water 1.333
• Glass 1.5 - 1.6
• Diamonds 2.13
• Compound materials such as wood, stone, concrete etc. 3 - 4
• Plastics 5 – 8

If an IOR of 1 is used, then light reflects/passes off/through the surface without changing direction, meaning it has the same density as air. Materials such as glass allow light to pass through, but also reflect. The ratio between reflection and refraction is dependent on the viewing angle. Geometry must have a thickness to refract properly. If you have window glass that has no thickness use an IOR of 1.0.

You can control the Fresnel reflection using a falloff map. However this method is known for rendering slower than the built in Fresnel control.
A falloff map will create a transition between the front and side colours (By default front is black, sides are white). It will use the falloff type to determine the type of reflection. With Fresnel selected, the black colour will be positioned front on angles and it will transition to white as it becomes more of a glancing angle. You can change that falloff by adjusting the IOR value, or by adjusting the output curve, or both.

Highlight glossiness
In the real world highlights are reflections of light sources and the surrounding objects. In computer graphics there are two different methods to calculate the same effect. The first is to make no distinction between lights and objects. The second is to treat lights separate from objects. One may be desired over the other for a particular scene.

By default highlight glossiness is locked to the reflective glossiness because in the real world they are the same thing. Highlight glossiness is better known as specular. It takes the reflection of a direct light and adds it to the surface of the material, since direct light is usually round the specular highlight is therefore round.

The 3ds Max Scanline renderer calculates reflection this way, and although unrealistic it is still favoured by some for artistic reasons. In reality reflections come from the area of the light source such as a bulb, therefore it would not be round and it would have certain characteristics. If the highlight glossiness is unlocked you can control its shape separate from the reflection glossiness. This has become part of the method for achieving car paint materials.

Reflection glossiness

A value of 1.0 means the reflection is mirror, lower values mean the reflection is more blurred. The more blurred the reflection the longer it takes to calculate.

Subdivs

This controls the quality of the reflection glossiness. The higher the reflective glossiness, the lower subdivisions you can have. If the subdivisions are too low the result will be very noisy.

Use interpolation

You can cache glossy reflections to speed up rendering. Since light cache for glossy rays has been introduced, this method is somewhat redundant as the results were never that good.

Dim distance

You can set the maximum distance a reflection ray will travel. As an example, if set to 100mm, anything outside the 100mm radius will not be reflected.

Dim fall off

A fall off radius for the dim distance.

Max depth

Controls the amount of times a light ray can reflect. A max depth of 1 means only 1 reflection on the surface and a max depth of 2 means that a reflection of a reflection can occur on the surface. Higher values increase render times.

Exit colour

When the max depth has been reached it will use the exit colour. You may reduce the max depth to keep render times low and instead rely on the exit colour. In most cases you would set the exit colour the same as the diffuse colour such as for a green glass bottle.

Refraction

Refract

A colour value is used to determine the refraction strength. White RGB (255,255,255) is fully refractive and black RGB (0,0,0) is not refractive at all. By using colour instead of grey scale you will get coloured refractions. You would commonly use a grey scale value to determine the refraction strength and there is no right or wrong value so you will have to take your best judgement. However the following can be used as a guide.
By default the reflection colour acts as a filter for the diffuse colour and the stronger the reflection colour the dimmer the diffuse colour. For tinted glass it is best to control the tint colour via the refraction colour. By setting the diffuse colour to black (0,0,0), it has no effect on refraction colour. You are effectively turning the diffuse colour off.

IOR

An Index of refraction (IOR) value describes the way light bends as it travels through a surface. A value of 1.0 means the light will not change direction.

Glossiness

A value of 1.0 means sharp, clear refraction, lower values mean the refraction is more blurred and frosted. The more blurred the reflection the longer it takes to calculate.

Subdivs

This controls the quality of the refraction glossiness. The higher the refractive glossiness, the lower subdivisions you can have. If the subdivisions are too low the result will be very noisy.

Use interpolation

You can cache glossy refractions to speed up rendering. Since light cache for glossy rays has been introduced, this method is somewhat redundant as the results were never that good.

Max depth

Controls the amount of times a light ray can pass through a surface before it stops. A max depth of 1 means that only 1 refraction through a surface and a max depth of 2 means that a refraction of a reflection can occur on the surface. Higher values increase render times. As an example if you were to look through a drinking glass it would have 4 surfaces. A max depth of 4 would be correct. However you may need to take into account loss of light energy therefore higher values are needed.
Exit colour

When the max depth has been reached it will use the exit colour. You may reduce the max depth to keep render times low and instead rely on the exit colour. In most cases you would set the exit colour the same as the diffuse colour such as for a green glass bottle.

Fog colour

Controls the attenuation of light as it passes through the surface, darker colours absorb more light whereas lighter colours don't absorb the light as much. Naturally thicker objects will become less transparent than thinner objects. By setting the fog colour to green it can be used to simulate coloured glass.

Fog multiplier

The strength of the fog colour is controlled by the multiplier. Higher values will make the object less transparent and lower values will make the object more transparent.

Fog bias

If used it will control the way in which the fog colour is applied. You can make thinner parts of the object more or less transparent than the default.

Affect shadows

If ticked, the object will cast transparent shadows, depending on the refraction and the fog colour.

Affect Channels

Here you can specify which channel is affected by the transparency of the material. For glass you would need to choose all channels so that both reflection and refraction are effected.

Dispersion

In the real world as a ray of light travels through a refractive object it produces a caustic effect which consists of a ray of colours. This is now an option in Vray 2.0, previous versions of Vray only allowed you to render white.

Abbe

At the default value the amount of dispersion is physically accurate in accordance with the IOR. You can increase or decrease for artists reasons. Increasing the value means the dispersion will be less visible and narrower whereas decreasing the value will spread out the dispersion and make it more intense.

Translucency

Type

You cannot see through a translucent material, but light can partially travel through and be scattered around. Materials such as human skin and wax are some of the most common.

Back-side colour

By default the colour of the translucency effect is dependent on the Fog colour. However you can additionally tint the effect using this parameter.

Thickness

You can limit the number of rays that are to be traced below the surface of the material by adjusting the thickness. This would therefore limit the amount of visible light.

Light multiplier

Control the intensity of the visible light.

Scatter coefficient

The amount of scattering that will occur inside the object. 0.0 means rays will be scattered in all directions where as a value of 1.0 means a ray will not change its direction.

Forward/backward coefficient

Controls the scatter direction of a ray, 0.0 means a ray moves away from the surface. 0.5 means that a ray has an equal chance of moving forward or backwards. 1.0 means a ray will move towards the surface.

BRDF

The BRDF types determine the type of the highlights and glossy reflections for a material. You would use Ward for metals such as stainless steel. Blinn and Phong for plastics and none metals and Blinn for chrome materials. Calculation speeds do vary for each type. Phong is fastest, followed by Blinn, and then Ward.
Soften

You can control the blending between the light and dark areas within the specular reflection.

Fix dark glossy edges

Unwanted dark edges may appear, use this to eliminate them.

Anisotropy

Changing this value makes the reflection directionally dependent for materials that have a fine grain such as brushed metals and woods. Reflections would appear more blurred if you were looking against the grain. Reflections appear less blurred if you were looking with the grain. A value of 0.0 means the reflection is isotropic, meaning the reflection is the same in all directions.

Rotation

Control the orientation of the anisotropic effect in degrees. You can also use a texture map to control the direction.

UV vectors derivation

Control how the direction is chosen by either using local axis or map channel.

Options

Trace reflections

Turning this off means that reflections will not be traced, but highlights will still be shown.

Trace refractions

Turning this off means that refractions will not be traced.

Cutoff

Control the threshold for which reflections/refractions will not be traced. Reflections that hardly contribute to the final image sample will not be traced. Using a higher cut-off means faster render times. If set to 0 the render times will be very slow, there needs to be a threshold in order for Vray to know when to stop calculating.

Environment priority

Determines what environment map will be used when you override the environment of various materials and they reflect/refract each other.

Double-sided

When ticked the back facing surface will be flipped. The Scanline renderer ignores back facing surfaces to speed up the rendering process. By default Vray will not ignore polygons, one of the reasons is because a back facing surface may still be visible within a reflection/refraction.

Reflect on back side

For materials such as glass you would need to turn this on to get a realistic result so that reflections are calculated on all surfaces. This will however increase render times.

Use irradiance map

By default the irradiance map is used to calculate diffuse indirect illumination of the material. Objects with fine details may render with artefacts, but you can render these objects better by turning off use irradiance map in the material. Then Brute forced will be used for that material only.

Fog system units scaling

Enabled by default, the fog colour attenuation becomes dependent on the system units. If your scene has not been modelled to real world scale you may get unwanted results with this on.

Treat glossy rays as GI rays

If set to always you are telling the material to always use the secondary GI engine to calculate the glossy rays, which in this case is the light cache. It basically does the same job as use light cache for glossy rays but you can specify individually which materials within the scene use this option.

Energy preservation mode

You can choose a different way of distributing light between the reflection and the diffuse layer. As in the real world the reflection level dims the diffuse and refraction levels causing the visible reflection to not be 100% of the reflection RGB value. To make the reflection 100% of the reflection RGB value, set it to monochrome, that way the diffuse colour has no effect on the resulting reflection colour.

Maps

Here you can add texture maps to control the effects of each property of the material.

Reflect/Refract interpolation

Here you control interpolation of glossy reflections. The options are somewhat similar to the options for the irradiance map in the render setup.