V-Ray 2 Sided Material
V-Ray 2 Sided Material is translucent material intended to simulate thin bodies - little or no volume. It's not a separate material but a utility node - it allows other materials to inherit its qualities. It will enable the light to flow bidirectionally through the object. The types of objects simulated with it include paper, thin fabric, curtains, blinds, and leaves. It's pretty fast to render, making it useful for translucent objects.
Opaque
See the comments in the "2Sided Simple.vrscene" file from the scene bundle.
Translucent
See the comments in the "2Sided Translucent.vrscene" file from the scene bundle.
Parameters
The main plugin of interest is called Mtl2Sided.
- front - this material will be used for front-side faces as defined by the object normals.
- back - this is the material V-Ray will use for back side faces as defined by their normals.
- translucency determines which side (front or back) relative to the camera is more visible in the rendering process. By default, this value is 0.5, which means that both the side facing the camera and the one facing away from it will be visible to the same degree. When this parameter is closer to 0.0, more of the material facing the camera will be seen. When closer to 1.0, more of the back material is seen.
- force_1sided - when it is on (the default), the sub-materials will be rendered as one-sided materials. Turning this option off is not recommended.
V-Ray Blend Material
BRDFLayered can be used to layer several V-Ray compatible materials efficiently. It can be used to create complex materials like car paints, human skin (when used with VRayFastSSS, which we'll discuss later as a base material), etc.
An advantage of BRDFLayered is that you can use the VRayMtl Select render element to split the different sub-materials of BRDFLayered into different render elements.
BRDFLayered takes a base material and applies other materials (coatings) on top of it. This works like a stack, where each coat material blends between its shading and that of the materials below it in the stack.
To use it, we need the BRDFLayered plugin, which contains a collection of brdfs and weights to blend them.
Parameters
- brdfs - List of BRDFs to blend.
- weights - List of weights to multiply the contribution of each BRDF. The indices in this list correspond to the indices in the previous one.
- opacities – The opacity of each coat texture.
- additive_mode - Whether to enable Additive (Shellac) mode. Shellac material mixes two materials by superimposing one over the other. We can produce an over-burnt color in this mode, and the results are not physically realistic.
- channels - List of render channels the result of this BRDF will be written to
Examples
Here's an example of the Shellac mode mixing:
Code example
# Load scene from a file. renderer.load(os.path.join(SCENE_PATH, 'material.vrscene')) # Create a bitmap buffer which can load data from a file newBitmap = renderer.classes.BitmapBuffer() newBitmap.file = os.path.join('assets', 'bricks01.jpg') # TexBitmap is used for file-based texturing. Other Tex{*} plugins offer procedural and combination textures newTexture = renderer.classes.TexBitmap() # Set the texture to use the loaded buffer newTexture.bitmap = newBitmap # Create a new BRDFVRayMtl diffuseBRDF = renderer.classes.BRDFVRayMtl() # We specify a bricks texture diffuseBRDF.diffuse = newTexture # Create a new BRDFVRayMtl reflectBRDF = renderer.classes.BRDFVRayMtl() # We also make the material reflective with white color, semi-transparent reflectBRDF.diffuse = vray.AColor(1.0, 0.0, 0.0, 0.5) reflectBRDF.reflect = vray.AColor(1.0, 1.0, 1.0, 0.5) # Create a new BRDFLayered material newMaterial = renderer.classes.BRDFLayered() # Assign the previously created BRDFs newMaterial.brdfs = [diffuseBRDF, reflectBRDF] # Assign equal weights for blending them newMaterial.weights = [vray.AColor(0.5, 0.5, 0.5), vray.AColor(0.5, 0.5, 0.5)] newNode = renderer.classes.Node() newNode.material = newMaterial newNode.geometry = renderer.plugins['CubeShape@mesh2'] newNode.transform = vray.Transform(vray.Matrix(1), vray.Vector(-15, 0, 0))
// Load scene from a file. renderer.load("material.vrscene"); // Create a bitmap buffer which can load data from a file BitmapBuffer newBitmap = renderer.newPlugin<BitmapBuffer>(); newBitmap.set_file("assets" PATH_DELIMITER "bricks01.jpg"); // TexBitmap is used for file-based texturing. Other Tex{*} plugins offer procedural and combination textures TexBitmap newTexture = renderer.newPlugin<TexBitmap>(); // Set the texture to use the loaded buffer newTexture.set_bitmap(newBitmap); // Create a new BRDFVRayMtl BRDFVRayMtl diffuseBRDF = renderer.newPlugin<BRDFVRayMtl>(); // We specify a bricks texture diffuseBRDF.set_diffuse(newTexture); // Create a new BRDFVRayMtl BRDFVRayMtl reflectBRDF = renderer.newPlugin<BRDFVRayMtl>(); // We also make the material reflective with white color, semi-transparent reflectBRDF.set_diffuse(AColor(1.0f, 0.0f, 0.0f, 0.5f)); reflectBRDF.set_reflect(AColor(1.0f, 1.0f, 1.0f, 0.5f)); // Create a new BRDFLayered material BRDFLayered newMaterial = renderer.newPlugin<BRDFLayered>(); ValueList brdfsList; brdfsList.push_back(Value(diffuseBRDF)); brdfsList.push_back(Value(reflectBRDF)); // Assign the previously created BRDFs newMaterial.set_brdfs(brdfsList); ValueList weightsList; weightsList.push_back(Value(AColor(0.5f, 0.5f, 0.5f))); weightsList.push_back(Value(AColor(0.5f, 0.5f, 0.5f))); // Assign equal weights for blending them newMaterial.set_weights(weightsList); Node newNode = renderer.newPlugin<Node>(); newNode.set_material(newMaterial); newNode.set_geometry(renderer.getPlugin("CubeShape@mesh2")); newNode.set_transform(Transform(Matrix(1), Vector(-15, 0, 0)));
// Load scene from a file. renderer.Load("material.vrscene"); // Create a bitmap buffer which can load data from a file BitmapBuffer newBitmap = renderer.NewPlugin<BitmapBuffer>(); newBitmap.File = Path.Combine("assets", "bricks01.jpg"); // TexBitmap is used for file-based texturing. Other Tex{*} plugins offer procedural and combination textures TexBitmap newTexture = renderer.NewPlugin<TexBitmap>(); // Set the texture to use the loaded buffer newTexture.Bitmap = newBitmap; // Create a new BRDFVRayMtl BRDFVRayMtl diffuseBRDF = renderer.NewPlugin<BRDFVRayMtl>(); // We specify a bricks texture diffuseBRDF.Diffuse = newTexture; // Create a new BRDFVRayMtl BRDFVRayMtl reflectBRDF = renderer.NewPlugin<BRDFVRayMtl>(); // We also make the material reflective with white color, semi-transparent reflectBRDF.Diffuse = new AColor(1.0f, 0.0f, 0.0f, 0.5f); reflectBRDF.Reflect = new AColor(1.0f, 1.0f, 1.0f, 0.5f); // Create a new BRDFLayered material BRDFLayered newMaterial = renderer.NewPlugin<BRDFLayered>(); // Assign the previously created BRDFs newMaterial.Brdfs = new object[] { diffuseBRDF, reflectBRDF }; // Assign equal weights for blending them newMaterial.Weights = new object[] { new AColor(0.5f, 0.5f, 0.5f), new AColor(0.5f, 0.5f, 0.5f) }; Node newNode = renderer.NewPlugin<Node>(); newNode.Material = newMaterial; newNode.Geometry = renderer.GetPlugin("CubeShape@mesh2"); newNode.Transform = new Transform(new Matrix(1), new Vector(-15, 0, 0));
// Load scene from a file synchronously. renderer.loadSync("material.vrscene"); // Create a bitmap buffer which can load data from a file var newBitmap = renderer.classes.BitmapBuffer(); newBitmap.file = path.join("assets", "bricks01.jpg"); // TexBitmap is used for file-based texturing. Other Tex{*} plugins offer procedural and combination textures var newTexture = renderer.classes.TexBitmap(); // Set the texture to use the loaded buffer newTexture.bitmap = newBitmap; // Create a new BRDFVRayMtl var diffuseBRDF = new renderer.classes.BRDFVRayMtl(); // We specify a bricks texture diffuseBRDF.diffuse = newTexture; // Create a new BRDFVRayMtl var reflectBRDF = new renderer.classes.BRDFVRayMtl(); // We also make the material reflective with white color, semi-transparent reflectBRDF.diffuse = new vray.AColor(1.0, 0.0, 0.0, 0.5); reflectBRDF.reflect = new vray.AColor(1.0, 1.0, 1.0, 0.5); // Create a new BRDFLayered material var newMaterial = new renderer.classes.BRDFLayered(); // Assign the previously created BRDFs newMaterial.brdfs = [diffuseBRDF, reflectBRDF]; // Assign equal weights for blending them newMaterial.weights = [new vray.AColor(0.5, 0.5, 0.5), new vray.AColor(0.5, 0.5, 0.5)]; var newNode = renderer.classes.Node(); newNode.material = newMaterial; newNode.geometry = renderer.plugins["CubeShape@mesh2"]; newNode.transform = vray.Transform(vray.Matrix(1), vray.Vector(-15, 0, 0));
MtlMulti (V-Ray Switch Material)
MtlMulti can switch between different materials based on a value sampled from a texture.
- mtls (deprecated) – A list of two-element lists with the material id and the material plugin.
- mtls_list – Materials to be used based on the switch texture's value.
- volumes_list – A list of volumes.
- ids_list – A list of material IDs for the matching elements of mtls_list.
- shader_sets_list – A list of shader set names to be matched to the materials. On GPU, this only works with one geometry per material.
- use_shader_set_patterns – Allow the use of wildcard patterns in shader_sets_list. On GPU, this only works with one geometry per material.
- mtlid_gen – An integer texture that generates material ids; if not present, neither mtlid_gen_float is present then surface material id will be used.
- mtlid_gen_float – A float texture that generates material ids; if not present, neither mtlid_gen is present then surface material id will be used.
- mtlid_gen_float_round_mode – Use this option to round the values returned by 'mtlid_gen_float' when converting them to an integer.
- wrap_id – True to wrap the material ID's to the largest specified ID for the material.
- scene_name – A list of string identifying the original scene node name for which this VRay Plugin was generated. The first string is directly the node name.
- channels – Render channels in which the result of this BRDF will be written to.
MtlWrapper
The VRayMtlWrapper can be used to specify additional surface properties per material.
- base_material – Specifies the actual surface material.
- use_irrad_map – When enabled, the Irradiance Map approximates diffuse indirect illumination for the material. If this is off, brute force GI is used. You can use this for objects in the scene which have small details and are not approximated very well by the Irradiance Map.
- generate_gi – Controls the GI generated by the material.
- receive_gi – Controls the GI received by the material.
- generate_caustics – When disabled, the material does not generate caustics.
- receive_caustics – When disabled, the material does not receive caustics.
- alpha_contribution – Determines the appearance of the object in the alpha channel of the rendered image. A value of 1.0 means the alpha channel is derived from the transparency of the base material. A value of 0.0 means the object does not appear in the alpha channel at all and shows the alpha of the objects behind it. A value of -1.0 means that the transparency of the base material cuts out from the alpha of the objects behind. Matte objects are typically given an alpha contribution of -1.0. Note that this option is independent of the Matte surface option (i.e. a surface can have an alpha contribution of -1.0 without being a matte surface). V-Ray GPU works with a value of either 1 or -1.
- matte_surface – Makes the material appear as a matte material, which shows the background, instead of the base material, when viewed directly. Note that the base material is still used for things like GI, caustics, reflections etc.
- shadows – When enabled, makes shadow visible on the matte surface.
- affect_alpha – When enabled, makes shadows affect the alpha contribution of the matte surface. Areas in perfect shadow produce white alpha, while completely unoccluded areas produce black alpha. Note that GI shadows (from skylight) are also computed, however GI shadows on matte objects are not supported by the light cache GI engine, when used as primary engine. You can safely use it with matte surfaces as secondary engines.
- shadow_tint_color – An optional tint for the shadows on the matte surface.
- shadow_brightness – An optional brightness parameter for the shadows on the matte surface. A value of 0.0 makes the shadows completely invisible, while a value of 1.0 show the full shadows.
- reflection_amount – Shows the reflections from the base material. V-Ray GPU always renders this parameter with a value of 1.
- refraction_amount – Shows the refractions from the base material. V-Ray GPU always renders this parameter with a value of 1.
- gi_amount – Determines the amount of GI shadows. V-Ray GPU always renders this parameter with a value of 0.
- no_gi_on_other_mattes – Causes the object to appear as a matte object in reflections, refractions, GI etc for other matte objects. Note that if this is on, refractions for the matte object might not be calculated (the object appears a matte object to itself and is not able to "see" the refractions on the other side). Not available with V-Ray GPU.
- matte_for_secondary_rays – Normally the base material is used when an object with a VRayMtlWrapper is seen through reflections/refractions. Turn this option on, if you want the VRayMtlWrapper to show the environment when seen through reflections/refractions. V-Ray can also do projection mapping to increase the realism.
- gi_surface_id – This number can be used to prevent the blending of light cache samples across different surfaces. If two objects have different GI surface IDs, the light cache samples of the two objects are not blended. This can be useful for preventing light leaks between objects of vastly different illumination.
- gi_quality_multiplier – A multiplier for the amount GI generated by the material.
- maya_background_shader_compatibility – Setting this to True will make the matte alpha opaque, so that the alpha of objects behind the matte won't be seen.
- alpha_contribution_tex – Same as alpha_contribution but used for the Maya's useBackground shader which supports textures as alpha contribution.
- shadow_brightness_tex – An optional brightness parameter for the shadows on the matte surface. A value of 0.0 makes the shadows completely invisible, while a value of 1.0 show the full shadows.
- reflection_filter_tex –
- trace_depth – The maximum reflection depth (-1 is controlled by the global options).
- channels – Render channels the result of this BRDF will be written to.
- generate_render_elements – When enabled, V-Ray will generate zDepth, velocity, extra tex and multi matte render element for matte objects. When this checkbox is disabled V-Ray does not generate any render elements for matte objects.
- reflection_exclude – A list of plugins that will be excluded from reflections.
- reflection_list_is_inclusive – Setting this to true will turn the reflection exclude list into inclusive (inverted).
- refraction_exclude – A list of plugins that will be excluded from refractions.
- refraction_list_is_inclusive – Setting this to true will turn the refraction exclude list into inclusive (inverted).