Professional Documents
Culture Documents
VRay Basic PDF
VRay Basic PDF
In this tutorial we are going to take a look at a simple scene with a teapot, and how we can use a combination of V-Ray
render settings, light settings, and V-Ray textures to make it look realistic. My hope is that this will get you pointed in the
right direction when working with the V-Ray rendering software.
Things you will learn to use in this tutorial will range all over but will include:
This is great startup information for new V-Ray users that can really help when you are first getting to know your way
around V-Ray.
To get started go ahead and download the starter file for this tutorial, it is nothing more than an un-textured Plane, a
Teapot, and a Camera. V-Ray has been assigned to the Renderer with all its default settings so we can change things as
we go. You can download the file here:
http://tutorials.diclementi.com/start_files/vraybasic_start.max
1
If you take a render right away you will find absolutely nothing stunning about our scene.
We will change all of that here. V-Ray is industry standard for photorealistic rendering and lighting for good reason. It
lets you create complex visuals the simplest way possible. All of these things are achievable in a renderer like Mental Ray
as well which comes equipped with 3D Studio Max, but V-Ray has found the best way possible to make things easy for
you rather than having to hunt and modify like you have to do in Mental Ray.
In order to get started we are going to open up our Material Editors first and take a look at creating 2 different kinds of
V-Ray textures. We will create a texture for the plane that will work exactly like the "Matt/Shadow/Reflection" material
in V-Ray which will get us a great studio lighting setup with no unsightly cornered walls or horizons. We will also create a
very simple standard V-Ray texture that is highly reflective to simulate a nice ceramic porcelain teapot.
So, open up the Material Editor (M) and select an Empty Material slot.
2
When this dialogue question box opens up, make sure Discard old
Material is marked, and hit OK.
The VRayMtlWrapper shader is a remarkable little shader that will let us key out everything but shadows and reflections.
Just like hte Matt/Shadow/Reflection texture in mental ray. It even lets us render proper alpha channels getting rid of
everything in the scene but what is important.
This shader allows us to do impressive things like creating Endless Horizons or letting us composite 3D Models directly
into photographs or videos. It does the green screening for us so we don't have to worry about keying out those awful
bright colored green or blue screens.
This will keep our shadows for us, but remove everything
else from the picture. Easy right?
Last, we will click on the long None channel button at the top of the Shader next to "Base material:"
3
We add a standard VRayMtl so that the MtlWrapper can pick up things like Reflections and Refractions, Bump maps, etc.
So that we can have an endless horizon which also does things like Reflect what is sitting on it.
For our purposes you don't have to change anything at all however, this nice matt texture will give us exactly what we
need to catch our shadows. (I am a creature of habbit however, so even though I don't have to do this I always match
my Diffuse Color swatch to the color I am going to use for my background) This ensures that the shadows will bleed
through onto same color as everything else in my scene.
You sample slot should look exactly like you have no object in there at all, just click and drag to add this texture to our
Plane in the scene.
Texture #1 is complete.
4
Next, press 8 on your keyboard to open up the Environment settings window. You can also find it under the Rendering
menu.
Change the color swatch here to white so it matches the one we made in our MtlWrapper.
Taking a render now will show our Teapot against a solid white background as if the plane did not exist.
Next, we will make a nice Shiny reflective material for our Teapot.
Go back to your Material Editor, and select a new empty material slot. Then click on the Standard button, and find the
regular VRayMtl in the browser, select it and hit the OK button.
5
The standard VRayMtl shader is a very powerful texture tool. It contains all the settings that our Standard 3DS texture
gives us and more, with controls over things like Fog and Sub Surface Scattering at our disposal without having to
concoct a lot of wild material choices.
We only need a simple reflective material for this demonstration though, so choose a Diffuse color for your teapot, it
can be any color you like... I always choose a nice yellow/green color because it is my favorite!
To get a Reflective or Shiny Surface in VRay, we have a color swatch for Reflection right below the Diffuse.
Black would be completely unreflective surface, and white would be a 100% reflective surface like a mirror. Grey gives us
shades of reflectivity in between.
Click on the Color swatch and set the Value to 100. This will give us a nice middle grey so our reflections aren't as bright
as a mirror but still very present. Then click OK.
6
This texture will work nicely for our teapot, but I want to talk a little bit about how VRay works if you wish to make the
reflection less crisp.
Below the Reflection color swatch you will find a Value field called Refl. Glossiness.
A 100% shiny and reflective surface will always be set to 1.0 The white specular hot spot will not be present in the
Sample window, but know that it will be a VERY shiny surface in the final render. If you have a surface like stainless steel
or brushed metal, reducing this number by a few points will help you to blur the reflection to get a different effect.
For this tutorial we want nice crisp reflections so leave the Refl. Glossiness value at 1.0, but I thought an explanation was
in order so you can change this in the future without difficulty.
7
If we take a render now we will see our textures are functioning but there is no light in the scene. The teapot is just
reflecting endless white, which makes it look flat and dull.
Now that our scene is fully textured we can move on to Render settings and Ambient Light using VRay.
Ambient light in Vray is taken care of completely via using the Render Setup (F10) go ahead and hit F10 to open up your
Render Settings now, this is where most of the VRay magic happens.
The common tab settings remain the same no matter what renderer you are using, we still adjust our size and where to
save the file etc. from there. We don't need to worry about anything in that tab today.
So click on the next in line, the V-Ray tab.
There are a TON of settings in the render setup window for V-Ray, and getting to understand what they all do is a long
educational journey. Today we will just set up together a good starting point from where you can begin. It will be a nice
looking render and you can adjust and learn more about the V-Ray Render settings as you continue to learn.
We will talk about what we find here as we go but may not make changes to everything.
8
The first rollout is the V-Ray:: Authorization rollout. This simply contains the location of your VRay license files and has
nothing to do with actual rendering so we will leave it be.
The next rollout is the About V-Ray rollout. This rollout just contains the splash page and version numbers etc. Once
again it has no bearing at all on what our render will look like so we will leave it be.
The third rollout down, the Frame Buffer rollout is where the important things begin.
The VRay frame buffer window looks like this just as an FYI:
For today just know it is there, and leave the box unchecked.
9
The Global Switches rollout is our next stop on the lecture topic list.
The next rollout down is the first rollout we will make some changes To, The V-Ray:: Image Sampler (Antialiasing) rollout.
This rollout controls the algorithms for sampling and filtering our images and good choices here will get us renders with
smoother edges and less pixelation. We have 3 types of Image Samplers to choose from -
Fixed - this sampler always takes the same number of samples per pixel;
Adaptive DMC - this sampler takes a variable number of samples per pixel depending on the difference in the intensity
of the pixels;
Adaptive subdivision - this sampler divides the image into an adaptive grid-like structure and refines depending on the
difference in pixel intensity.
I almost always use the Adaptive subdivision type setting here, as I like the way it works and it does its work fairly
quickly.
10
The Antialiasing Filter should hopefully look familiar to you. Definately have this box check marked to On and once again
the Filter I use is the Mitchell-Netravali filter as it does a great job of filtering my antialiasing settings to a nice smooth
edge. The Default blur and ringing work just fine for most things.
The next rollout down will change based on your selections in the Image Sampler rollout.
In our case it will be the Adaptive Subdivision image sampler, as I have chosen Adaptive Subdivision in the dropdown
above.
I find that I rarely need to increase these numbers, but do so as you need to. If your render has jagged or pixelated edges
in it, try increasing the rates a little higher but be warned ... every increase will also increase your render time
significantly.
Next rollout is the V-Ray:: Environment rollout and this is where we get to actually change our Ambient Light settings.
For a scene like ours with just a Teapot under the open sky and nothing else around it for miles we can check to turn on
the "GI Environment (skylight) override" AND the "Reflection/Refraction environment override" settings.
If however we have an indoor scene with no windows etc, these settings will not do anything for you. The first check box
turns on a skylight ... we don't have to create an icon in the scene like we did in mental ray. You can turn a skylight on
just by clicking the on box here. This is always where we will put things like our HDRI image maps to get photorealistic
lighting.
11
The Reflection override only needs enabled if you don't have a full scene of stuff for reflective objects to display in their
reflections. If you have a full scene jam packed with models, leave this check box off as you will definitely want the items
in your scene to reflect the scene around them. For our demo today which suits itself more towards a product
photoshoot kind of environment we are definately going to want to turn this on. So that whatever map we add to the
None channel button on the right will reflect in our teapot.
If we take a render after simply turning these two boxes on, the skylight will be that of a light blue as the color swatch
indicates and the scene will actually reflect the color black instead of what it was doing before ... the bright white of our
background and plane.
Already our teapot looks less washed out because it is no longer only reflecting white... we get the white plane
reflection, but everything else is now set to black.
In order to truly make use of this wonderful rollout, we are going to add an HDRI image to both of our channel buttons
in this rollout. Download the HDRI image I am going to use from here:
http://tutorials.diclementi.com/start_files/kitchen2.hdr
It is a very large and high resolution image of a Kitchen, 360 degrees all the way around and when applied to a spherical
environment map we can see the kitchen from all directions no matter where we point a camera.
12
In order to load in our HDRI image to be used as our Skylight and our Environment Reflections, we will click on the None
channel box in the Environment Rollout in the Render Settings.
In the Material Browser open the Maps --> Standard --> VRayHDRI. Then click the ok button.
Then click and drag the Map that is added to the None channel button in the render setup, to the Material Editor so we
can adjust its settings. When the Dialogue opens, make sure to select Instance. So that any change we make in the
Material Editor, will automatically change the version in the Render Setup.
Click on the Browse button and find the Image I had you
download.
13
Then you can go back to your Render Setup and copy the Map#1 down to the None channel button for Reflection
override as well.
Hitting the render button now will show that the environment HDRI image we added will now show up in the reflections
of our teapot!
14
Open up the V-Ray:: Color mapping rollout.
This will limit the amount of color bleeding via the light in the scene. I will stick to the Linear multiply type for this
demonstration, but there are 3 different types you can choose from. They will change how your final render looks like.
When using an HDRI light source it is recommended to clamp for better antialiasing of bright light sources.
Try out the other Types on your own, and see how we get subtle changes in light and hotspots.
This is where we can toggle on and adjust other wonderful settings like Depth of Field and Motion Blur. We will discuss
how those work in a different tutorial however. Just leave everything unchecked here for now, as we won't need any of
this for our teapot.
That's it for the V-Ray tab ... next we will move into the all important Indirect Illumination Tab to finalize our settings.
15
This setting controls the magic of
Global Illumination and Ambient
Occlusion. These are must haves
in any good rendering.
Also turn on Ambient Occlusion checkbox. This will give us shadows in places where light just can't reach, whether we
have a direct light source or not.
The Primary and Secondary bounces function just like our Final Gather settings for mental ray. I recommend leaving the
multiplier set to 1.0 which is full bounce unless you need to reduce render times and light quality. The GI engines will
calculate the global illumination using different techniques. I have set them to my favorites above, for Primary bounces I
am using an Irradiance map, and for Secondary bounces I have using a Light Cache. I find that this works out very nicely
for most of my renders.
I will go ahead and give you an explanation on the differences of these GI engines ... prepare yourself as this stuff gets a
little complicated.
Brute force - this is the simplest approach; indirect illumination is computed independently for each shaded surface
point by tracing a number of rays in different directions on the hemisphere above that point.
Advantages:
• this approach preserves all the detail (like small and sharp shadows) in the indirect lighting
• it is free from defects like flickering in animations
• no additional memory is required
• indirect illumination in the case of motion-blurred moving objects is computed correctly.
Disadvantages:
• the approach is very slow for complex images (e.g. interior lighting)
• it tends to produce noise in the images, which can be avoided only by shooting a larger number of rays, thus slowing it even
more.
16
Irradiance map - this approach is based on irradiance caching; the basic idea is to compute the indirect illumination only
at some points in the scene, and interpolate for the rest of the points.
Advantages:
• the irradiance map is very fast compared to direct computation, especially for scenes with large flat areas;
• the noise inherent to direct computation is greatly reduced
• the irradiance map can be saved an re-used to speed up calculations for different views in the same scene and of fly-
through animations
• the irradiance map can also be used to accelerate direct diffuse lighting from area light sources.
Disadvantages:
• some details in indirect lighting can be lost or blurred due to the interpolation
• if low settings are used, flickering may occur when rendering animations
• the irradiance map requires additional memory
• indirect illumination with motion-blurred moving objects is not entirely correct and may lead to noise (although in most
cases this is not noticeable)
Photon map - this approach is based on tracing particles starting from the light sources and bouncing around the scene.
This is useful for interior or semi-interior scenes with lots of lights or small windows. The photon map usually does not
produce good enough results to be used directly.
Advantages:
• the photon map can produce a rough approximation of the lighting in the scene very quickly;
• the photon map can be saved an re-used to speed up calculation for different views for the same scene and of fly-through
animations
Disadvantages:
Light cache - light caching is a technique for approximating the global illumination in a scene. It is very similar to photon
mapping, but without many of its limitations. The light map is built by tracing many viewpoint paths from the camera.
Each of the bounces in the path stores the illumination from the rest of the path into a 3d structure, very similar to the
photon map. The light map is a universal GI solution that can be used for both interior or exterior scenes, either directly
or as a secondary bounce approximation when used with the irradiance map or the brute force GI method.
Advantages:
• the light cache is easy to set up. We only have the camera to trace rays from, as opposed to the photon map, which must
process each light in the scene and usually requires separate setup for each light.
• the light-caching approach works efficiently with any lights - including skylight, self-illuminated objects, non-physical lights,
photometric lights etc. In contrast, the photon map is limited in the lighting effects it can reproduce - for example, the
photon map cannot reproduce the illumination from skylight or from standard omni lights without inverse-square falloff.
• the light cache produces correct results in corners and around small objects. The photon map, on the other hand, relies on
tricky density estimation schemes, which often produce wrong results, either darkening or brightening those areas.
17
• in many cases the light cache can be visualized directly for very fast and smooth previews of the lighting in the scene.
Disadvantages:
• like the irradiance map, the light cache is view-dependent and is generated for a particular position of the camera.
However, it generates an approximation for indirectly visible parts of the scene as well - for example, one light cache can
approximate completely the GI in a closed room;
• currently the light cache works only with V-Ray materials;
• like the photon map, the light cache is not adaptive. The irradiance is computed at a fixed resolution, which is determined
by the user;
• the light cache does not work very well with bump maps; use the irradiance map or brute force GI if you want to achieve
better results with bump maps.
• lighting involving motion-blurred moving objects is not entirely correct, but is very smooth since the light cache blurs GI in
time as well (as opposed to the irradiance map, where each sample is computed at a particular instant of time).
So, to sum up I will most often use an Irradiance Map for my primary bounces, and then switch to a Light Cache for my
secondary bounces which tends to fill everything in nicely and accommodate for the weaknesses of the different
methods.
It is a lot to think about, and a lot to experiment with. V-Ray tends to look so great because it does so many calculations
for light. This is a good way to take control over those calculations and see what a difference each choice makes. Then
settle on your favorites for most things like I have.
Then, depending on your choices you will have different rollouts appear below ... in our case the first rollout that
appears next will be the one for Irradiance Map adjustments.
18
The next rollout will be the one for our Light Cache which we set up for our secondary bounces.
The rest of the settings here can stay the way they are.
The last rollout on this tab will be the rollout for generating Caustic effects. We will leave this off for now, as Caustics is
going to have to be an entirely different tutorial.
The Global subdivs multiplier: will directly affect the amount of light bouncing around in your scene. Realistic light is
almost always set to a Gamma of 2.2, but in many 3D softwares it gets set down to 1.0 I like to defaultly change this
multiplier to increase the amount of light in my scene to more accurately match the real world.
If you need more light bouncing around in your scene to brighten things up, you might think about increasing this
multiplier rather than clicking and changing settings for all the lights in your scene. It may save you some time.
19
The last rollout we will talk about is the System rollout, we can leave the Default displacement rollout alone for now.
I just want to point out that in this rollout we have controls over the size of our buckets. VRay gives us a default size of
64 x 64. Which makes each bucket rather large, the larger your buckets ... the longer it will take to give you a finished
section of your image and when doing advanced lighting tests this can be a true inconvenience if all you want to do is
see how the light is acting in a small corner of your image.
I like to immediately set my buckets to have that size because it just feels like the render goes faster and I can see small
pieces of it more quickly without waiting for the renderer to calculate a larger chunk.
Now that we have made changes to all these amazing and wonderful things in our render setup, we can take another
render and see what we have.
20
Not bad at
all! And the best part is this is ONLY the ambient light source that we set up in our Environment rollout on the V-Ray tab
in the render setup! We don't even have any other lights in the scene and we are getting a level of detail that is truly
amazing.
Looking at this image I can decide if I need to make any adjustments to this render setup, and I do see at least one
problem that I don't like at all.
Look at the reflection on the teapot where there is a lot of light and we get those bright white hotspots.
21
Yuck, what are those nasty pixilated outlines doing in my image! This is a common problem with this render setup, and
when I first started out in V-Ray I spent hours trying to figure out why it was happening. I wanted to bring this up
specifically to save you that time I wasted on this disturbing little problem.
To solve it, go back to your Render Setup (F10) and back to the V-Ray tab.
While technically this check box actually makes light a little less accurate, I find that it takes care of my hotspot issues
with my V-Ray lights. In many a scene if you have a bright light source, or lighted texture you will see a nasty black
outline around the area of light ... it looks terrible.
22
Marking the Sub-pixel mapping checkbox will take care of this issue for you. A new render now shows our reflection as
it should be, no strange black outlines.
Just be warned as it will also pop up a warning in your V-Ray Messages window... I just like to ignore it as my renders
look fine no matter what it says. If you don't have any bright hotspot light in your scene, then you may be able to go
ahead and turn this off again but if you do run into those icky pixilated black outlines ... remember this
Ok, let's move on... at this point what I did was to save these render settings as a place to start all my other scenes from.
Rather than make all these settings changes over and over again ... we can save them for use again later.
Go down to the very bottom of your Render Setup (F10) and to the left of the big Render button you will see a
dropdown menu labeled Preset:
23
A save as dialogue window will open...
It should default for you to the renderpresets folder that 3D Studio Max comes installed with, simply give it a name and
click on the Save button.
Another dialogue will open asking what all you wish to save in the file.
I have just selected everything and hit the Save button again.
24
Next time you start up a new file, in your Render Setup (F10) click the Preset: dropdown again and your file name should
appear in the list. This way you can select it and then modify your settings as needed, rather than doing them all over
from scratch each time.
You can save presets for any renderer, any set up, etc.
I have some for outdoor scenes, mental ray scenes, vray scenes, specific
client set ups, etc.
Ok, now that we have saved all our hard work ... we can talk about one more thing before we close out this little project.
Go to your Create tab, under the lights button, and change the dropdown from Photometric or Standard, to VRay.
Just like VRay comes with its own set of textures and render settings ... we also
get brand new lights created to work with VRay specifically.
25
Toggle on the VRayLight button to create a normal VRay Light.
Before we create it, set the Type in the Parameters dropdown to Sphere.
Then click in your Front Viewport and drag to Create a spherical VRay Light.
26
Then go over to the Modify Tab to adjust the lights settings:
Just like any light you have used in 3D Studio before we have some similar settings.
the color swatch can be changed to change the color of the light.
The radius if increased will Increase two things.. the amount of light in the scene,
as well as the softness of your shadows.
27
So, a Multiplier of 30.0 will give us a decent brightness to our light, and a Radius of 20.0 will increase that light and make
the shadow of our teapot fairly soft.
If you wish for a very hard edged shadow like you are standing in directly sunlight, Increase the Multiplier but decrease
the Radius. A Multiplier of 3000, and a Radius of only 1.0 ... will give you similar light, but a sharper edged shadow.
28
That's really all you have to know to get the right kind of direct light and shadow out a normal V-Ray light. Just adjust the
two numbers and the color of your light until your heart is content!
That's it! I hope this tutorial gave you a better understanding of how V-Ray works, and how you can get yourself to a
decent starting point quickly without re-inventing the wheel every time.
29