0. Who this is for
These guidelines are for users of the AppSDK who want to use it to create a scene for rendering with V-Ray from the data in their host application scene. We will not discuss details on how to write code with the AppSDK here - there are separate docs for this. Rather we will cover what V-Ray plugins to add to the scene, how to link them and what parameters to set.
Note: This document will be updated and extended over time.
1. Introduction
1.1. A note on terminology
- plugin: We use the term plugin a lot. Technically it could mean a plugin DLL for V-Ray (even V-Ray itself is a kind of plugin) or the type defined in it, which is for example a class in the programming sense, or finally an instance of this class which resides in memory and can be saved to a scene file. We will be using the term plugin to refer to plugin instances.
- exporter/translator: We call the piece of software that translates some native scene format to the V-Ray scene format an exporter or a translator, interchangeably. Basically what it does is creating a bunch of V-Ray plugins and setting their parameters. Note that we also use the verb "to export" sometimes in reference to the act of saving out the scene (which was already translated) to a *.vrscene file.
1.2. V-Ray scene contents
We could informally define three kinds of plugins that build up a V-Ray scene.
One would be the so called "top-level" plugins, which can exist on their own, without being part of some plugin tree. Lights are top-level plugins for example. They can also receive input from other plugins of course, but they do not output to other plugins.
The plugins which are not top-level serve as input for parameter slots which require a plugin of certain type. For example a material plugin may require an optional texture input and you'd reference a texture plugin there. The texture plugin may receive input from a UVW generator and so on.
The third kind would be a special type of top-level plugins which only have one instance. These are basically settings plugins. Most of them have "Settings" in their name, but a few don't. The V-Ray camera is also defined by such a singleton settings plugin.
1.3. Parameter types
The following are the types recognized in a V-Ray scene (think .vrscene file). They have corresponding types in the different AppSDK language bindings. The SDK uses the respective basic language types wherever possible and defines custom type classes for the rest.
- Basic types:
int, bool, float, Color
(3float
RGB),AColor
(4float
ARGB),Vector
(3float
),string
,Matrix
(3Vector
s),Transform
(aMatrix
and aVector
for translation) - Objects: references to other plugin instances
- Lists: generic heterogenous lists and concrete typed lists
The AppSDK uses a generic type class calledValue
for items in a generic list. Note that generic lists can be nested. The typed lists areIntList, FloatList, ColorList
andVectorList
. - Output parameters
These are additional values generated by a given plugin which may be used as input by others. For example theTexAColorOp
plugin can be referenced directly as a texture, resulting in its default color texture output, but you can also refer to any of its other outputs, likesum, difference, maximum
etc. for different results.
Parameter polymorphism is an important feature of V-Ray. Texture parameters accept simple values, so instead of creating an additional texture plugin which generates a single color you just set a Color value to the texture slot. Same goes for float textures and single float values etc. You can also set the value of a texture parameter to an output parameter as described above.
1.4. V-Ray scene file format
V-Ray uses a text based scene file format (.vrscene). It is quite simple which makes it convenient to debug and modify by hand. The format is case-sensitive and a little similar to JSON. Large data values, such as geometry definitions can be compressed (and text encoded).
The main rules are:
- Each plugin instance is defined on a new line starting with its type name follow by a space, an instance name, another space and an opening curly brace.
- Each parameter is written on a new line with its name, an equals sign with no whitespace on both sides and a value. The line ends with a semicolon. A parameter definition line may be split into multiple lines for long values such as lists.
- References to other plugins are defined by writing out their instance names without quotation. Output parameters are specified the same way with additional double colon and parameter name (
instance_name::out_param_name
). - The end of the plugin definition is marked with a closing brace on a new line.
- C++ style single line comments are supported.
- Files can be stitched together with an
#include "another.vrscene"
directive like in C. - References can be made to plugins which will be defined further down the file.
1.5. Default values
Every parameter has a default value, so even after you create an "empty" plugin instance it is actually fully functional. Of course it might need data, as for example with geometry plugins, but a light will work right away (placed at 0 coordinates). That being said, some plugins have inconvenient default values, which almost always need to be changed (for example some settings plugins, such as the image sampler settings or some shadow parameters). We usually can't fix the defaults, because it would break existing user scenes. Nevertheless, unless you know what you're doing, it is recommended to stick to the default values. You are free to experiment, of course, but don't use values which you don't understand as they may have performance implications or quality implications or they may even break physical plausibility.
Note that when you export (save) a vrscene file it will always contain a bunch of settings plugins, even if you didn't create them. They will have default parameter values. This is how V-Ray always saves files.
1.6. Debugging and help
Apart from documentation included with the AppSDK and this guide, the help pages for 3dsMax and Maya on docs.chaosgroup.com are a good source of parameter information and examples, although they use the user-friendly UI names for things and not the actual scene parameter names.
A very useful tool for basic parameter information is plgparams.exe
included in the binary folder of the SDK. It lists all parameters for the specified plugin (or all plugins with -list
) and their types, default values and text comments. Similar information can be obtained using the ListAllPluginsAndProperties
example in the C++ folder (or equivalent code for another language).
It is often useful to save out your scene to a file to inspect if you did everything properly. For example you may have failed to set some parameter properly and you will see this in the file, although you can also check the result of the set operation in your code. You can try to pinpoint problems by deleting parts of the scene (parameters or whole plugins) and re-rendering.
It can be very helpful if you have a V-Ray for 3dsMax or Maya and use it to export vrscene files to see what plugins and parameters are written out. The exporters for 3dsMax and Maya can be considered "ground truth" (even though they may have an occasional bug or missing feature).
If you're getting a black render make sure your camera is positioned and oriented properly and not inside an object. Keep in mind the default up-axis is Z, but it can be set to something else, usually Y. You might also get invisible or black objects if something is wrong with the attached material.
Another thing to watch out for is V-Ray's errors and warnings, so always implement the DumpMessage
callback.
1.7. "subdiv" parameters
Note
2. Defining camera position
One of the first things you'd want to do is control your camera. This is done through the RenderView
plugin. You will always want to create and setup this plugin, exactly one, in your scenes. (The exception is when you are baking textures - then you'd use BakeView
.)
The main parameters are:
fov
- The vertical field of view in radians.orthographic
- Enable to have orthographic projection instead of perspective.transform
- A transformation (rotation + translation) which defines where the camera is and how it is rotated. The matrix is in column-major format and you will need to calculate it yourself. You can't set rotation angles as in most 3D software. The default camera orientation with identity matrix is so that +Z is pointing up and +Y is the view direction. If your scene uses +Y for up-axis, you will need to set V-Ray's scene up-axis accordingly - see the Units subsection in the settings section below.
For advanced camera effects, such as DoF, exposure etc. you will need to enable the physical camera. See the Physical camera subsection in the settings section below for details.
3. Creating lights
Good lighting is the most important thing for getting good photorealistic renders. It also affects image noise and performance. Some lights (generally the simpler ones, especially the first four in the list) render faster and with less noise than others. Things that may make affect noise and performance of lights are: having a texture instead of flat color; having a complex mesh; being an area light with small relative size.
Listed below are V-Ray's light plugins, ordered roughly by increasing photorealism. Common parameters are at the end and some specific parameters are described in the Reference at the end of this document. There are even more parameters that we will not mention here.
LightAmbient
- Do not use this one. Ambient lighting is a fake effect.LightOmni
- A point light source. Has parameters for the rate of decay and casting soft shadows (shadowRadius
below).LightDirect
- Infinite parallel light. Does not originate from its position, so only the rotation matrix matters.LightSpot
- Conical spot light, such as the light coming from a flashlight.LightRectangle
- Rectangular area light. Option for rounding to a disc shape. Can be textured.LightSphere
- Spherical area light. The geometric detail is parametrized by number of segments.LightMesh
- Turn a geometry plugin into a light source. Can be textured.LightDome
- A light emitting dome encompassing the scene at infinity. Usually used for HDR image based lighting (IBL) with a spherical texture file.LightIES
- Measured real world lights defined through an .IES file. Shape can be overriden.SunLight
- Mathematically approximated model of our Sun. The light varies according to its elevation. Usually coupled with aTexSky
environment texture. See the Environment settings section below for details.
Some of these plugins have versions from 3dsMax with additional parameters, such as LightOmniMax
, LightSpotMax
etc.
Common light parameters:
enabled
- Enabled by default. Use to turn lights on/off without having to recreate and reset parameters.transform
- Position and orientation. See notes on camera position above. Some lights can also be scaled.color
- The color of emitted light. Default is white (1.0, 1.0, 1.0). The value can be above 1 for larger intensity, but most lights have a separateintensity
parameter for this. Some lights such as rectangular and mesh lights can have textured color through additional parameters. For example you can make a stained glass window this way. The Sun light doesn't have this parameter, but it has others for color control.shadows
- Enabled by default. Set to false to cast no shadows. Not recommended.
Other parameters common to many, but not all of the lights (check respective parameter lists):
shadowRadius
- Can be used to make simple light sources like omni, spot, direct behave as area lights, casting soft shadows.intensity
(intensity_tex
) - Multiplier for the intensity of the light.invisible
- False by default. Enable to make the area light invisible to the camera. This includes the back side of rectangle lights for example.units
- Physical units for the intensity of photometric lights. Possible values are: 0 - default, 1 - lumens, 2 - lm/m/m/sr, 3 - Watts, 4 - W/m/m/sr
4. Creating geometry
4.1. The Node plugin
Before we get to defining your actual geometry data, there is a top-level plugin for non-light-emitting objects called Node. It links the geometry data (geometry
parameter) with a material plugin (material
parameter) and positions it in the world (transform
parameter). You could reference the same geometry in different nodes with different positions.
4.2. Geometry sources
V-Ray works with triangular geometry only, so if you have larger polygons, you will have to triangulate them. The simplest way would be the ear clipping method for convex polygons. The triangle vertex indices are specified in counter-clockwise order in the geometry arrays for V-Ray if you're looking at the front face of the triangle.
Lets look at the main geometry source plugins (we will ignore some others):
GeomStaticMesh
- The basic fixed geometry descriptor that you will use in most cases. Requires vertex and normal data plus optional UVW texture mapping coordinates.GeomStaticNURBS
- Defines a smooth NURBS surface using control vertices and weights.GeomStaticSmoothedMesh
- References another mesh plugin (usuallyGeomStaticMesh
) and generates a smooth, subdivided version.GeomDisplacedMesh
- References another mesh plugin (usuallyGeomStaticMesh
) and generates a displaced version using a texture map.GeomHair
- References another mesh plugin (usuallyGeomStaticMesh
) and generates hair (can be tweaked for fur, grass, shaggy rug etc.) on it. Has many parameters for the size, shape and distribution of strands.GeomMeshFile
- Loads geometry from a file, a so-called geometry Proxy. The geometry is only loaded on-demand as a ray hits it, so in some cases such as distributed bucket rendering it may prevent unnecessary calculations and memory usage. The currently supported formats are V-Ray's .vrmesh and Alembic .abc. If you have a file in another format, i.e. .obj, you need to convert it with the ply2vrmesh tool.GeomParticleSystem
- Generates many (usually small) particles.
4.3. Instancing
TODO: Instancer, Instancer2
5. Creating materials
Exporting materials is probably the most complicated part, because it may involve complex shader networks, especially in apps with high artistic control, such as the popular DCC tools from Autodesk. Nevertheless, you can get good results even by using only a few plugins.
There are two types of plugins involved - material (names start with "Mtl") and BRDF (names start with "BRDF") plugins. BRDFs describe what happens with light when it interacts with the surface, like refraction, diffuse scattering, etc. BRDFs get plugged into material plugins, which may extend their behavior or combine them. Finally the material plugin gets plugged into a Node
that links it to a geometric object in the scene.
You should always connect a MtlSingleBRDF
instance to the Node::material
slot. Despite its name, the MtlSingleBRDF::brdf
parameter accepts other Mtl plugins, so there is no problem with using any material before finally adding MtlSingleBRDF
.
There are some material and BRDF plugins that still exist for compatibility reasons, but we don't recommend you use them. For example instead of connecting MtlDiffuse
to a Node
, you should create BRDFDiffuse -> MtlSingleBRDF::brdf -> Node::material
. Plugins with names ending with "_ASGVIS" can also be ignored. We don't have an exhaustive list of deprecated plugins at the moment.
The workhorse of your material setups should be BRDFVRayMtl
. It combines three types of effects in one plugin - diffuse, reflection and refraction (we have them in separate plugins as BRDFDiffuse, BRDFMirror
and BRDFGlass
respectively). You can use only one of the layers, though, by setting the colors of the others to black. The plugin splits the incoming light energy according to the colors for the three layers. For example, by default the reflection and refraction have black color, so these layers are skipped. If you set a white reflection color you will get a mirror. If you set a white refraction color you will get glass. The layers are evaluated in this order: reflection, refraction, diffuse. The amount of energy that passes to the next layer is the complementary color to the color of the layer. If you have a (0.2, 0.2, 0.2) reflection color, 20% of light the energy will go into the specular reflection and 80% will pass on to the refraction layer. If your refraction layer has color (1.0, 1.0, 1.0) all of the remaining energy will continue as refracted light, so you will get the effect of a glass material (a little reflection and full refraction of the rest). If the refraction color is (0.5, 0.5, 0.5) instead, 50% of the remaining energy will refract and 50% will scatter off from the diffuse layer. If the diffuse color is white, all of that remaining energy is scattered around the scene and if it's black all of it is absorbed (that would heat the object in the real world). So lets summarize what happens with the incoming energy with a few examples:
- reflection=(0.1, 0.1, 0.1), refraction=(1.0, 1.0, 1.0), diffuse=(1.0, 0.0, 0.0) => 10% reflection, 90% refraction and 0% diffuse, so you won't see that red color anywhere
- reflection=(0.1, 0.1, 0.1), refraction=(0.5, 0.5, 0.5), diffuse=(1.0, 0.0, 0.0) => 10% reflection, 45% refraction and 15% diffuse, so you will see a semi-transparent object with some red. Note that 1/3 of the last 45% of the energy is red scattering, so actually 15% of the original energy is scattered, only in the red channel, and 30% is absorbed in the other channels.
- reflection=(1.0, 1.0, 1.0), refraction=(0.5, 0.5, 0.5), diffuse=(1.0, 0.0, 0.0) => 100% reflection, 0% refraction and 0% diffuse, so you will see a perfect mirror - nothing is seen through it and no red
- reflection=(0.1, 0.1, 0.1), refraction=(0.0, 0.0, 0.0), diffuse=(0.5, 1.0, 0.5) => 10% reflection, 0% refraction, 60% diffuse and 30% absorbed (no energy is absorbed in the green channel)
The absorption of energy in the diffuse layer matters for GI (global illumination). Having a closed room with pure white diffuse walls is like having a room of mirrors. V-Ray will bounce light around until it reaches its maximum GI depth and this may slow rendering down. If the walls were 88% white instead, only 7% of the original energy will remain after 20 bounces. At some point V-Ray will decide that the ray is too weak and insignificant and it will stop tracing it. V-Ray makes a lot of decisions based on light intensity, so this matters. Samples with intense light are considered more important than weak ones.
An important aspect of BRDFVRayMtl
is the Fresnel reflection parameter (which is off by default when you create an instance, while it's on by default in V-Ray for 3dsMax). When it's enabled reflection amount depends on the angle of incidence. Glazing angles produce more reflection than looking head-on at the surface. This changes the conclusions we made above about how energy is distributed in the layers of the material. Even with 100% reflection (white color) some of the energy will go through to the reflection and diffuse layer. Fresnel reflections are a must for physically plausible materials. For Fresnel you need to set a correct index of refraction (IOR), even if the material doesn't refract any light. For example metals have very high IORs.
BRDFVRayMtl
also has a translucency option, but you should use BRDFSSS2
instead for subsurface scattering.
5.1. Material and BRDF plugins
MtlSingleBRDF
- The main material type that needs to be connected toNode::material
.Mtl2Sided
- Defines a (possibly different) material for the back side of triangles, as well as the front sides.MtlMulti
- Use this together withGeomStaticMesh::face_mtlIDs
to set different materials for subsets of triangles on one geometric object.MtlVRmat
- Load a V-Ray shader from a .vrmat (formerly .vismat) file. Also supports loadingMtlSingleBRDF
materials from vrscene files. This is used for transferring materials between different host applications.MtlGLSL
- Loads a GLSL shader from file and provides some parameters for it. See this page for details.MtlOSL
- Loads an OSL shader from file and provides some parameters for it. See this page for details.MtlRoundEdges
- Smooths sharp edges within a given radius by modifying normals.
Some advanced materials:
MtlMaterialID
- Can be used to define a unique color for a specific base material to be used in compositing from a dedicated render channel.MtlOverride
- Allows you to override the base material for any of the following: reflections, refractions, GI, shadows, environment.MtlRenderStats
- Overrides visibility and shadow settings for the object using a base material. This material is not to be used nested in bump, wrapper, two-sided or blend materials.MtlWrapper
- (really advanced) Can be used to specify additional surface properties per material related to GI, render elements etc.
Below is a list of BRDF plugins for the materials. The difference between the Blinn, Phong, Ward, Cook-Torrance and GGX models is in how the specular highlight behaves and what parameters you have to control it. The respective BRDF plugins combine a diffuse and a glossy reflection component, while VRayMtl provides more options, like a Fresnel term, refraction, etc.
BRDFVRayMtl
- The one BRDF plugin to rule them all. Combines all of the following except Cook-Torrance (not all at the same time - you choose a type). This is the preferred choice for most cases.BRDFBlinn
- The Blinn BRDF model for glossy highlights. See Wikipedia article and VRayMtl#BRDF.BRDFCookTorrance
- The Cook-Torrance BRDF model for glossy highlights. See Wikipedia.BRDFGGX
- The new GGX (microfacet GTR) BRDF model for glossy highlights.BRDFPhong
- The Phong BRDF model for glossy highlights. See Wikipedia article.BRDFWard
- The Ward BRDF model for glossy highlights. See Wikipedia.BRDFDiffuse
- A basic diffuse BRDF.BRDFGlass
- A basic refractive BRDF.BRDFGlassGlossy
- An extension of BRDFGlass that enables glossy refraction, meaning that rays with equal incoming angle refract at slightly different angles.BRDFLight
- Self-illumination BRDF. Consider usingLightMesh
instead.BRDFMirror
- A basic specular reflection BRDF.BRDFLayered
- A weighted combination of any number of BRDF plugins. (This is also known as Blend material in the UI of V-Ray for 3dsMax and Maya.)
Some BRDFs simulating specific real world materials:
BRDFCarPaint
- Simulation of metallic paint with base color, random metallic flakes and a coating layer.BRDFFlakes
- Only the flake part of the car paint BRDF.BRDFHair3
- A BRDF optimized for hair. Use withGeomHair.
BRDFSSS2
- Subsurface scattering for materials like wax, milk, resin, marble, etc. UseBRDFSkinComplex
instead for skin.BRDFSSS2Complex
- SSS with even more parameters.BRDFScanned
- This loads a real world material sample scanned to a file by our custom hardware. Email us for details.BRDFSkinComplex
- A skin-specific SSS plugin.BRDFStochasticFlakes
- A new plugin for randomly generated tiny sparkly particles. This produces a glittery material like ones found on some clothing and footwear.
And bump maps:
BRDFBump
- Applies a bump map to some base BRDF.BRDFMultiBump
- Combines up to 4 bump maps.
5.2. Textures and UVW generators
The BRDFs (and some lights) have many Color, AColor and Float parameter slots that can be textured. You will usually just load texture files, but V-Ray also offers many procedural textures, as well as texture plugins that serve as modifiers (i.e. apply some simple function, combine textures, extract data from one of the channels etc.). There are over 200 hundred texture plugins, so we will only look at the most important ones. Many of the plugins are made for specific host applications. Apart from the texture data itself, V-Ray uses UVW generator plugins to generate UVW mapping coordinates or modify the original data from the geometry source. Using a UVWGen plugin is not obligatory.
For texture files:
TexBitmap
- Uses the data from a bitmap buffer (see next two points) with some additional parameters, like color multipliers, tiling etc.BitmapBuffer
- Loads an image file. A large number of formats are supported - lossy/lossless, from 8-bit to 32-bit. This is not a texture plugin and its only purpose is to feed data toTexBitmap
. It has some options for filtering and gamma.RawBitmapBuffer
- Same asBitmapBuffer
, but uses uncompressed data from memory, instead of a file on disk.- TexPtex - Texture loaded from a PTex file. This doesn't use BitmapBuffer.
Textures that modify and combine colors:
- TexAColorOp - One of the most used combination plugins. It has two input AColor textures, two optional multiplier textures, an optional separate alpha channel input texture and a lot of output textures: sum, difference, product, division, min, max, intensity, power and single color channel outputs.
- TexBlend - Blend two input AColor textures using another float texture for weighting (or a constant value, of course).
- TexClamp - Clamp an input texture between some min and max values.
- TexCondition - Switch between two AColor textures depending on some type of comparison between two float textures.
- TexFloatOp - Similar to TexAColorOp for floats.
- TexGradient, TexGradRamp, TexRamp - Gradient textures.
- TexHSVToRGB - Convert HSV input texture to RGB.
- TexInvert - Returns the input texture's complementary color.
- TexLayered - Combine an unlimited number of textures.
- TexLuminance - Returns a single float luminance (0.3R + 0.59G + 0.11B) from input color texture. Note that in V-Ray terms this is different from the "intensity" term, which is (0.33R + 0.33G + 0.33B).
- TexMulti - Similarly to MtlMulti, choose a texture from a list by indexing with face material ID or object ID or randomized.
- TexRaySwitch - Use a different texture for different types of rays: shadow, GI, reflection, refraction and default.
- TexRemap -
- TexUserColor and TexUserScalar - Advanced usage with user attributes.
Some procedural textures:
- TexChecker - A checkerboard pattern. The two alternating colors are also texturable.
- TexCloth - A weaved cloth pattern (as the one in Autodesk Maya)
- TexCellular - Procedural cellular noise pattern. Different types of cells are supported, including fractal.
- TexCurvature - A value proportional to local curvature at shading point.
- TexDirt - An ambient occlusion effect around concave edges and dents in the geometry (with an inversion option).
- TexDistance - Generates a color gradient according to distance from a specified list of objects.
TexEdges - Generates wireframe color along polygon edges.
TexFalloff - Generates a falloff gradient depending on the angle between surface normal and camera view direction or some other axis.
TexFresnel - Used to generate Fresnel reflection color if you're not using BRDFVRayMtl.
- TexLeather - Procedural leather imitation.
- TexMarble - Procedural marble imitation.
- TexNoise, TexNoiseMax, TexNoiseMax - Different types of configurable procedural noise.
- TexRock - Procedural stone imitation.
- TexSmoke - Procedural 2d smoke texture.
- TexSnow - Procedural snow imitation. Covers surface in snow color down to some normal vector threshold.
- TexSoftbox -
- TexTiles - Procedural tiles with different layout options.
- TexWater - Procedural wave texture.
- TexWood - Procedural wood imitation.
Finally, the UVW generators:
UVWGenChannel
- Modifier for UVW data coming from the geometry source. Has transform, wrap and crop parameters as well as the option to get UVW data from another UVWGen plugin.UVWGenEnvironment
- Used to map spherical, cube, etc. textures on the environment color slot or on dome lights.UVWGenExplicit
- Define explicit UVW data from a texture.UVWGenMayaPlace2dTexture
- Similar toUVWGenChannel
, but with more options.UVWGenObject
-UVWGenPlanarWorld
-
6. Scene and render settings
6.1. Image and region size
These are controlled from the SettingsOutput plugin, but it is one of the few exceptions where you should not touch the plugin directly. The AppSDK has APIs for setting image and region size.
6.2. Image sampling and filtering
V-Ray has several types of image samplers. These are algorithms that determine how many samples to take for each pixel. This is combined with an image filter, which can soften or sharpen the final image.
The image sampler is controlled from SettingsImageSampler. These are the four types of its type parameter:
- type=0, Fixed sampler - It simply uses a fixed number of samples for each pixel. This is controlled by the fixed_subdivs parameter. This sampler type is not recommended.
- type=1, Adaptive sampler
- type=2, Adaptive subdivision sampler
- type=3, Progressive sampler
The progressive sampler produces whole images iteratively, refining them with each pass. The other samplers work on small "buckets" and only return an image when it is complete.
For details on the adaptive and progressive sampler see this page. You can also see what our CTO has to say about sampling: https://www.youtube.com/watch?v=tKaKvWqTFlw.
Some of the default values when you create (or if you don't) the SettingsImageSampler plugin are not optimal. They are currently kept for compatibility reasons. Here are some guidelines for changing them:
- min_shade_rate - Use a value between 6 and 8.
For Adaptive sampler: - dmc_minSubdivs - Keep at value 1.
- dmc_maxSubdivs - Start with 24 and increase if noise doesn't go away.
- dmc_threshold - Start with 0.005 and decrease it if increasing dmc_maxSubdivs doesn't help with noise. You could keep it higher like 0.01 of course, if you want fast renders.
Progressive sampler: - progressive_minSubdivs - Keep at value 1.
- progressive_maxSubdivs - Use between 60 and 100.
- progressive_threshold - Similarly to dmc_threshold, start at 0.005 and reduce if noise persists. Don't go below 0.001.
- progressive_maxTime - This is a render time limit in minutes, so unless you want a safety limit, leave it at 0.
Most filters have just one size parameter for the kernel radius. Catmull-Rom has no parameters.
- FilterBox
- FilterArea
- FilterTriangle
- FilterGaussian
- FilterSinc
- FilterLanczos (currently default in V-Ray for 3dsMax and Maya)
- FilterCatmullRom
- FilterCookVariable
- FilterMitNet - Mitchell-Netravali filter. It has additional blur and ringing parameters.
6.3. Global illumination
SettingsDMCSampler - use_local_subdivs=0
6.3.1. Irradiance map
6.3.2. Light cache
6.4. Environment
6.5. Units (scale)
Some calculations in V-Ray based on physics require accurate scaling of scene units to real world units like meters, Watts, seconds, etc. This is controlled through the SettingsUnitsInfo plugin with the properties listed below. This affects the physical camera, IES lights, volumetric effects, etc.
- meters_scale - Multiplying scene sizes by this value should yield object sizes in meters.
- photometric_scale - Scale for photometric lights.
- seconds_scale - When doing animation, this is the reciprocal of the framerate
- scene_upDir - This needs to be set if the scene has an up-axis different from the default, which is +Z.
6.6. Physical camera
6.7. Color mapping
6.8. Stereo and panorama rendering
For stereo rendering you need to add a VRayStereoscopicSettings plugin to the scene (if there wasn't one already). It's recommended to change the focus_method parameter to 1 for panorama or 2 for normal camera. The rest of the default parameters should be ok.
If you're doing this on the GPU, don't create VRayStereoscopicSettings and just set SettingsRTEngine::stereo_mode=1 (boolean) and SettingsRTEngine::stereo_focus as you would set VRayStereoscopicSettings::focus_method.
Also remember to set a double horizontal resolution for stereo. So if your normal render resolution is 640x480, make that 640x960. The left half of the image will be the left eye view and the right half is the right eye.
For spherical panorama rendering you need to:
- Change the type parameter of SettingsCamera to 9.
- Set the field of view to 360 degrees or rather 2*pi, because the fov parameter is in radians. You need to do this with the RenderView plugin and with SettingsCamera - both have an fov parameter. Also if you're using PhysicalCamera with specify_fov=1, set fov there too.
- Set the vertical field of view to 180 degrees. This may be a bit confusing: it is set through the height parameter of SettingsCamera. Also the value is not in radians, but in degrees.
For cubic (6x1) panorama rendering you need to:
- Change the type parameter of SettingsCamera to 10.
- Set a resolution with aspect ratio 6:1 or 12:1 if you are doing stereo. So for a stereo cubic panorama with 1000x1000 pixel cube sides you will render at 12000x1000.
6.9. Miscellaneous
The SettingsRaycaster plugin has one parameter of interest: embreeUse. You'd want to set this to 1 (default is 0), because it increases raytracing performance.
6.10. RT Engine
7. Minimal renderable scene
This is a diagram of the most simple possible scene that will render an object. These are the plugins and parameters you will need to create and set.
A. Brief plugin reference
This reference does not list all of V-Ray's plugins, but most users will rarely need the ones that are not mentioned here.
Also only some of the parameters are explained here. As a general rule, follow the advice in Debugging and help when looking for info on plugins.
A.1. Common plugins
Light plugins (see also section 3 above)
LightOmni
decay
- The exponent for intensity decay. Default value is 2.0 which corresponds to the inverse square law.
LightSpot
coneAngle
- Full cone angle in radians.penumbraAngle
- The size of an additional partly lit area around the cone in radians. If negative it's inside the cone.dropOff
- Attenuation proportional to off-axis angle. Larger values dim the light toward the wide angles of the cone.falloffType
- The type of transition in the penumbra region. 0 - linear; 1 - smooth cubicdecay
- The exponent for intensity decay. Default value is 2.0 which corresponds to the inverse square law.
LightRectangle
noDecay
- If set to true, light intensity will not fall off with distance. By default the inverse square law applies.doubleSided
- Whether to emit light from the back sides of the rectangle.u_size
- Width of the light in scene units.v_size
- Length of the light in scene units.directional
- Larger values make the light more concentrated along the +W axis in local UVW space.is_disc
- True to round the rectangle to a disc (ellipse).rect_tex
- A texture plugin to map onto the rectangle for light color.use_rect_tex
- You also have to set this to true to actually use therect_tex
parameter.tex_resolution
- The texture is actually resampled at this resolution. The default is 512, so even if you have a high resolution image, it may look pixelated if you don't increase this. This will consume more memory.
LightSphere
noDecay
- If set to true, light intensity will not fall off with distance. By default the inverse square law applies.radius
- Radius of the generated sphere in scene units.sphere_segments
- Number of flat segments composing the sphere. Increase from the default 20 if you want a smoother shape.
LightMesh
noDecay
- If set to true, light intensity will not fall off with distance. By default the inverse square law applies.doubleSided
- Whether to emit light from the back sides of the triangles.geometry
- A geometry plugin that will define the shape of the light. Note that complex geometries may make mesh lights slower and noisier.tex
- A texture plugin to map onto the geometry for light color. This requires that the geometry plugin has valid UV data.use_tex
- You also have to set this to true to actually use thetex
parameter.tex_resolution
- The texture is actually resampled at this resolution. The default is 256, so even if you have a high resolution image, it may look pixelated if you don't increase this. This will consume more memory.
LightDome
dome_spherical
- Set to true to extend the dome to a full sphere. By default it is only a half-dome centered at the scene zenith.SettingsUnitsInfo::scene_upDir
needs to be properly set.dome_tex
- A texture plugin to use for IBL. Note that this usually requires spherical mapping.use_dome_tex
- You also have to set this to true to use thedome_tex
.tex_resolution
- The texture is actually resampled at this resolution. The default is 512, so even if you have a high resolution image, it may look pixelated if you don't increase this. This will consume more memory.
LightIES
ies_file
- Path to the file describing the light sourcefilter_color
- Use to tint the light. The default is white (1.0, 1.0, 1.0). Light color is defined by color temperature in the IES file.soft_shadows
- Set to 0 (default) to cast hard shadows as point light; 1 to use the shape of the light for shadows; 2 to also use the shape for illuminationpower
- Overrides the power specified in the file if > 0. The unit is lumens.ies_light_shape
- Overrides the shape in the file if set to >= 0. Possible enumerated values: see table below.ies_light_width
- Used ifies_light_shape
override is on.ies_light_length
- Used ifies_light_shape
override is on.ies_light_height
- Used ifies_light_shape
override is on.ies_light_diameter
- Used ifies_light_shape
override is on.shape width length height diameter 0=point 0 0 0 0 1=rectangle >= 0 >= 0 0 0 2=circle 0 0 0 < 0 3=sphere 0 0 0 < 0 4=vertical cylinder 0 0 > 0 < 0 5=horizontal cylinder (length) 0 > 0 0 < 0 6=horizontal cylinder (width) > 0 0 0 < 0 7=ellipse (length) < 0 > 0 0 0 8=ellipse (width) > 0 < 0 0 0 9=ellipsoid (length) < 0 > 0 < 0 0 10=ellipsoid (width) > 0 < 0 < 0 0
SunLight
transform
- Similarly to the direct light plugin, the position doesn't matter as the light comes from infinity. The rotation matrix has to be set correctly, even though in theory the Sun is omnidirectional. The identity matrix results in light directed along the -Z axis, thus a noon Sun.target_transform
- Currently doesn't make a difference. Don't leave uninitialized - set an identity transform.turbidity
- See VRaySunozone
- See VRaySunwater_vapour
- See VRaySunsize_multiplier
- See VRaySuncolor_mode
- See VRaySun. Values are 0, 1, 2 respectively for Filter, Direct, Override mode.intensity_multiplier
- Relative intensity of the Sun (default 1.0). Try setting correct scales in SettingsUnitsInfo first.filter_color
- Force a color tint. It's probably better to leave this white. See also thecolor_mode
parameter.ground_albedo
- Sky parameter, unused if there is no sky attached. Account for light reflected off an imaginary ground and scattered back in the sky. Default is (0.2, 0.2, 0.2).horiz_illum
- Sky parameter, unused if there is no sky attached. Specifies the intensity (in lx) of the illumination on horizontal surfaces coming from the sky ifsky_model
is 1 or 2.sky_model
- Sky parameter, unused if there is no sky attached. Selects the mathematical model approximating sky illumination. Values: 0=Preetham et al; 1=CIE Clear; 2=CIE Overcast; 3=Hosek et al.up_vector
- Set to (0.0, 1.0, 0.0) if your scene up-axis is +Y to have correct lighting.
Geometry plugins
Node
transform
- World transformation applied to the geometry vertices which are defined in object space.geometry
- Reference to a geometry source plugin, such asGeomStaticMesh
for example.material
- Reference to a material plugin. This should always be aMtlSingleBRDF
. (Note that you can plug other Mtl plugins in thebrdf
slot ofMtlSingleBRDF
)visible
- Set to false to disable the object. It will not be included in the raytracing intersection tree.
GeomStaticMesh
vertices
- VectorList with the vertex coordinates in object space.faces
- IntList with indices in thevertices
array. Every three indices make a triangle. The same vertex index may be used multiple times (for the different triangles it is part of).normals
- VectorList with normal vectors in object space. These can have a different count fromvertices
.faceNormals
- IntList with indices in thenormals
array. Every index defines the normal for the corresponding vertex in thefaces
array.map_channels
- An optional list of lists, where each inner list is generic and has three elements. The first element is the channel index (usually starting from 1), followed by a VectorList with UVW coordinates (leave W at 0.0 when you're only mapping 2D). The third element is an IntList with indices in the UVW array. Each index corresponds to a vertex defined in thefaces
array.map_channels_names
- An optional list of strings with names for the corresponding elements of themap_channels
list.face_mtlIDs
- An optional IntList with material indices for each triangle. The number of indices is equal to the length of thefaces
array divided by 3.dynamic_geometry
- If set to true, the geometry will not become part of the static intersection tree. Only its bounding box will be used and if that's intersected a separate local tree will be intersected. This may boost performance for real-time rendering of moving objects.
GeomStaticNURBS
cvs
- List of lists of Vectors. Each inner lists contains the control vertices for one NURBSweights
- Lists of lists of floats with weights for each CV in the correspondingcvs
list.uKnots
- List of floats with knot values in the U direction.vKnots
- List of floats with knot values in the V direction.generateStatic
- Set to true to generate explicit static triangles in memory instead of the implicit NURBS surface.
GeomStaticSmoothedMesh
mesh
- The base mesh, usually aGeomStaticMesh
.static_subdiv
- If set to true, the new generated triangles will be saved in the static rayserver tree. This will increase memory usage.use_globals
- Whether to use the global settings fromSettingsDefaultDisplacement
. Default is true.view_dep
- Ifuse_globals
is false, whether the amount of tesselation is view-dependent. The global default is true.edge_length
- If the view-dependent option is on (globally or locally), this is the target edge size to subdivide to in pixels. Otherwise it is in scene units.max_subdivs
- Ifuse_globals
is false, the maximum number of triangle subdivisions for this mesh.
GeomDisplacedMesh
mesh
- The base mesh, usually aGeomStaticMesh
.static_displacement
- If set to true, the new generated triangles will be saved in the static rayserver tree. This will increase memory usage.use_globals
- Whether to use the global settings fromSettingsDefaultDisplacement
. Default is true.view_dep
- Ifuse_globals
is false, whether the amount of tesselation is view-dependent. The global default is true.edge_length
- If the view-dependent option is on (globally or locally), this is the target edge size of the generated triangles in pixels. Otherwise it is in scene units.max_subdivs
- Ifuse_globals
is false, the maximum number of triangle subdivisions for one original triangle of this mesh.
For the rest of the parameters refer to VRayDisplacementMod.- displacement_tex_color
- displacement_tex_float
- displacement_amount
- displacement_shift
- keep_continuity
- map_channel
- object_space_displacement
- use_bounds
- min_bound
- max_bound
- resolution
- precision
GeomHair
- TODO
GeomMeshFile
file
- Path to the vrmesh or abc file to load.object_path
- When using Alembic, the starting object path string.
Material and BRDF plugins
MtlSingleBRDF
- TODO
Mtl2Sided
- TODO
MtlMulti
- TODO
MtlVRmat
- TODO
MtlGLSL
- TODO
MtlOSL
- TODO
MtlRoundEdges
- TODO
MtlMaterialID
- TODO
MtlOverride
- TODO
MtlRenderStats
- TODO
MtlWrapper
- TODO
BRDFVRayMtl
- TODO
BRDFBlinn
- TODO
BRDFCookTorrance
- TODO
BRDFGGX
- TODO
BRDFPhong
- TODO
BRDFWard
- TODO
BRDFDiffuse
- TODO
BRDFGlass
- TODO
BRDFGlassGlossy
- TODO
BRDFLight
- TODO
BRDFMirror
- TODO
BRDFCarPaint
- TODO
BRDFFlakes
- TODO
BRDFHair3
- TODO
BRDFLayered
- TODO
BRDFSSS2
- TODO
BRDFSSS2Complex
- TODO
BRDFScanned
- TODO
BRDFSkinComplex
- TODO
BRDFStochasticFlakes
- TODO
BRDFBump
- TODO
BRDFMultiBump
- TODO
Textures and UVWGenerators
A.2. Other plugins
CameraDome
EffectLens
GeomParticleSystem
mesh
- A mesh plugin to use for some types of instances, depending onrender_type
.render_type
- 3=multipoints; 4=multistreak; 6=points; 7=spheres; 8=sprites; 9=streak. The default is 7.colors
- ColorList with a color for each particle.positions
- VectorList with the particle positions.velocities
- VectorList with velocities for motion blur. The values are in world units per frame.
For the rest of the parameters for particular particle types, check the parameter list as described in Debugging and help.
VRayClipper