Page History
...
There is an example tiny scene in section 7. Its contents should become understandable by reading the following sections.
...
The following are the types recognized in a V-Ray scene (think .vrscene file). They have corresponding types in the different AppSDK App SDK 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
(UTF-8),Matrix
(3Vector
s),Transform
(aMatrix
and aVector
for translation). - Objects: references to other plugin instances.
- Typed lists: The typed lists in App SDK are
IntList
,FloatList
,ColorList
,VectorList
,TransformList
andVectorList
.PluginList
- Generic heterogeneous lists: The In C++, the App SDK uses a generic type class called
Value
for items in a generic list. In C#, Python and Node.js, native language types are used (lists or arrays). Note that generic lists can be nested. - Output parameters
: These are additional values generated by a given plugin which may be used as input by others. For example theTexAColorOp
plugin plugin (described in section 5.2) 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 (Note: in some cases connecting an output parameter to an input parameter may not work directly, so you'd have to make the connection through a wrapper plugin likeTexAColor
orTexFloat
).
In App SDK output parameters are represented by thePluginRef
type which combines a plugin reference and an output name.
Parameter polymorphism is an important feature of V-Ray. Texture parameters accept simple (basic) 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.
...
Apart from documentation included with the App SDK and SDK and this guide, the help pages for 3dsMax and Maya on docs.chaosgroupchaos.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 as a missing or incorrect value, 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. In this case you can still the object in the alpha channel, especially if there is nothing behind it.
Another thing to watch out for is V-Ray's errors and warnings, so always implement the DumpMessage
callback.
1.7. "subdivs" parameters
UI Text Box | ||
---|---|---|
| ||
Information on all V-Ray plugins is available in the header file of the C++ vrayplugins.hpp and for C# in the VRayPlugins.cs file. If renderer is a
|
1.7. "subdivs" parameters
You will see subdivs
(subdivisions) parameters on many light and BRDF plugins. They control the number of new rays spawned for You will see subdivs
(subdivisions) parameters on many light and BRDF plugins. They control the number of new rays spawned for calculating glossy and diffuse effects on materials or the number of light and shadow evaluations and so on. The number of actual rays is proportional to the square of the parameter value. These can be used to increase or decrease sampling for the respective light or material, but we highly recommend leaving these at default values. We also recommend disabling local subdivs values altogether - see the DMC sampler section for details. Some of the settings plugins also have subdivs parameters which are ok to change, like the Irradiance Map and Light Cache for example.
Note: The reason the renderer uses the square of the parameter value is the property of the Monte Carlo integration method that to reduce noise (variance) by half (1/2 noise), you need four times as many samples (4x), to get 1/10 the variance you need 100x more samples... This way we get linear results from linear increases in the subdivs parameters.
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
.)
...
fov
- The horizontal field of view in radians.orthographic
- Enable to have orthographic projection instead of perspective .(RenderView::fov
doesn’t matter in this case, in favor ofRenderView::orthographicWidth
).transform
- A transformation (rotation + translation)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 +Y is pointing up and -Z 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, distortion, vignetting, etc. you will need to enable the physical camera in addition to RenderView
. See the Physical camera subsection in the settings section below for details. You can also use SettingsCameraDof
instead, if you only need depth of field (see 6.11. Miscellaneous).
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 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.
...
Node => Instancer2 => N * Node (invisible) -> GeomSomething
and evenNode => Instancer2 => Nodes => Instancer2 => etc.
...
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.
...
A general note on settings plugins: when you create a new Renderer object there are no instances of them, so you will need to create them before changing parameters. If you start rendering the AppSDK App SDK will create a SettingsOutput
and if the render mode is RT it will create SettingsRTEngine
. On the other hand, if you're loading a scene from file, it will have instances of most (but not all) settings plugins and you need to use them. This is because every time V-Ray exports a vrscene file it automatically writes out the settings even if they are at default values.
...
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 App SDK has APIs for setting image and region size (i.e. renderer.setRenderRegion
, depends on language).
...
min_shade_rate
- Use a value between 6 and 8.
For Adaptive sampler:dmc_minSubdivs
- In general, keep at value 1 to avoid unnecessary sampling. There may be some exception cases (such as fog) where 1 is not enough and leads to visual artifacts.dmc_maxSubdivs
- Start with 24 and increase if noise doesn't go away.dmc_threshold
- Start with 0.005 and decrease it if increasingdmc_maxSubdivs
doesn't help with noise. You could keep it higher like 0.01 of course, if you want fast renders.dmc_adaptive_method
- We recommend you enable this (the default is 0 for the legacy sampler) to use the improved sampling algorithm that samples the image according to noise, leading to an even noise distribution per unit of render time.
Progressive sampler:progressive_minSubdivs
- Keep at value 1.progressive_maxSubdivs
- Use between 60 and 100.progressive_threshold
- Similarly todmc_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.
...
FilterBox
- All samples within a box with sides2*size
are taken with equal weight.FilterArea
- All samples within a circle with radiussize
are taken with equal weight.FilterTriangle
- Sample weight falls off as a triangular function of off-center distance.FilterGaussian
- The classical blur filter.FilterSinc
- Less blurry low-pass filter. See Wikipedia.FilterLanczos
(currently default in V-Ray for 3dsMax and Maya) - See Wikipedia.FilterCatmullRom
- A cubic edge-enhancing filter.FilterCookVariable
FilterMitNet
- Mitchell-Netravali cubic filter with subjectively optimized compromise of blurring and detail in the additionalblur
andringing
parameters which correspond to B and C from the original paper.
To apply a filter, just create an instance of one of those plugins. You can use only one at a time.
Info |
---|
See See 3dsMax docs or or Maya docs for more info on filters. |
...
Info |
---|
For parameter descriptions see the Maya docs. |
The default values when you create a SettingsColorMapping
plugin are different from the recommended values in 3dsMax and Maya for legacy reasons. These are the values you should use for new scenes:
...
If you save the rendered image from the VFB and not from an AppSDK App SDK API, the corresponding Settings{JPEG|PNG|EXR|TIFF}
plugin controls compression quality and bits per channel. You may need to change these according to your needs.
If you want to enable motion blur, set the SettingsMotionBlur
plugin on
parameter to 1. It also has the geom_samples
parameter that affect quality, but may cost a lot of render time if increased. It should equal the number of geometry samples in the geometry data if it is non-static. Note that this plugin (SettingsMotionBlur
) conflicts with CameraPhysical
.
The SettingsLightLinker
plugin allows you to define include or exclude lists for lights and objects, so that for example specific lights do not affect some objects etc. Refer to the plugin parameter metadata for explanations.
...
If you are not using CameraPhysical
for depth of field, you can use SettingsCameraDof
instead. Note that this plugin (SettingsCameraDof
) conflicts with CameraPhysical
.
on
- Set to true to enable DoF.aperture
- The size of the camera aperture in scene units. Note that increasing this number corresponds to decreasing the physical camera's F-number.focal_dist
- Distance from the camera to the focus plane in scene units.
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.
The .vrscene can store multiple cameras, where only one can be set as ‘renderable’ at a time. The rest of the cameras can be chosen for rendering, for example in V-Ray Standalone, by using the -camera
command flag. This is useful, as oftentimes a project requires rendering different sequences from different cameras, while nothing else changes in the scene - a simple example would be to render two different views of the same visualization and in this way, the same scene can be rendered twice with V-Ray Standalone. An example scene with two cameras would have one them to render by default while the other will have dont_affect_settings
flag raised.
In shading setups, textures can be projected from cameras. This can either be the same camera used for rendering, or another camera in the scene, used only for projecting a texture. In both cases, an extra SettingsCamera
and RenderView
plugin is exported for the camera projection with the dont_affect_settings
flag raised. This is similar to the Multiple Cameras setup. In all cases, it’s a good idea to export one camera for rendering, and another one for the texture projection, even if it’s the same camera, as different properties apply for each.
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
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 trianglesrectangle.u_size
- Width of the light in scene units.v_size
- Lengthgeometry
- A geometry plugin that will define the shape of the light . Note that complex geometries may make mesh lights slower and noisier.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 geometry rectangle for light color. This requires that the geometry plugin has valid UV data.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 256512, 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
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.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 mappingmap onto the geometry for light color. This requires that the geometry plugin has valid UV data.use_dome_tex
- You also have to set this to true to actually use thedome_tex
tex
parameter.tex_resolution
- The texture is actually resampled at this resolution. The default is 512256, 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
LightDome
iesdome_filespherical
- Path Set to true to the file describing the light sourceextend 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 shadowsfilter_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
...
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
- 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.
Textures and UVWGenerators
...
VRayClipper
Volumetric plugins
...
The information from this page is also available at User Guide V-Ray Application SDK.