©Anton Podvalny

Table of Contents

Introduction

In this chapter we'll talk about different types of BRDFs which V-Ray supports. We'll cover BRDFBlinn, BRDFWard, BRDFGGX, BRDFCookTorrance, BRDFGlass and BRDFMirror. As we've talked in Chapter 1 BRDF stands for Bidirectional reflectance distribution function. Generally these plugins are attached to MtlSingleBRDF (or one of the more advanced Mtl*BRDF plugins). They implement different types of shading and take different colors and textures as parameters. When shading a point from the object, we sample a point on the light in interest and trace the ray through them. After calculating the amount of light coming from this light in the point, the BRDF comes in place and tells us how this light is ditributed (reflected) in various directions.

BRDFBlinn

This shader implements the Blinn shading algorithm.

Parameters

  • color - Basic color of the surface
  • transparency - Transparency value
  • trace_depth - The maximum reflection depth (-1 is controlled by the global options)
  • affect_alpha - Specifies how render channels are propagated through the BRDF (0 - only the color channel; 1 - color and alpha; 2 - all channels
  • reflect_exit_color - The color to use when the maximum depth is reached
  • reflect_dim_distance_on - True to enable dim distance
  • reflect_dim_distance - How much to dim reflection as length of rays increases
  • reflect_dim_distance_falloff - Fall off for the dim distance
  • glossyAsGI - Determines if the glossy rays are treated by V-Ray as GI rays: 0 - never; 1 - only for rays that are already marked as GI rays; 2 - always
  • soften_edge - Soften edge of the BRDF at light/shadow transition
  • anisotropy - Reflection anisotropy in the range (-1, 1)
  • anisotropy_rotation - Anisotropy rotation in the range [0, 1]
  • fix_dark_edges - true to fix dark edges with glossy reflections; only set this to false for compatibility with older versions

 

Example

 

# Create a new BRDFBlinn
diffuseBRDF = renderer.classes.BRDFBlinn()
# Specify a golden color
diffuseBRDF.color = vray.Color(1.0, 1.0, 0.0)
 
newMaterial = renderer.classes.MtlSingleBRDF()
newMaterial.brdf = diffuseBRDF
// Create a new BRDFBlinn
BRDFBlinn newBRDF = renderer.newPlugin<BRDFBlinn>();
// Specify a golden color
newBRDF.set_color(Color(1.0f, 1.0f, 0.0f));
 
MtlSingleBRDF newMaterial = renderer.newPlugin<MtlSingleBRDF>();
newMaterial.set_brdf(newBRDF);
// Create a new BRDFBlinn
BRDFBlinn newBRDF = renderer.NewPlugin<BRDFBlinn>();
// Specify a golden color
newBRDF.Color = new Color(1.0f, 1.0f, 0.0f);
 
MtlSingleBRDF newMaterial = renderer.NewPlugin<MtlSingleBRDF>();
newMaterial.Brdf = newBRDF;
// Create a new BRDFBlinn
var diffuseBRDF = new renderer.classes.BRDFBlinn();
// Specify a golden color
diffuseBRDF.color = new vray.Color(1.0, 1.0, 0.0);
 
var newMaterial = new renderer.classes.MtlSingleBRDF();
newMaterial.brdf = diffuseBRDF;

BRDFWard

This shader implements the Ward shading algorithm.

Parameters

Main parameters are the same as the ones from BRDFBlinn.

Example

 

# Create a new BRDFWard
diffuseBRDF = renderer.classes.BRDFWard()
# Specify a golden color
diffuseBRDF.color = vray.Color(1.0, 1.0, 0.0)
 
newMaterial = renderer.classes.MtlSingleBRDF()
newMaterial.brdf = diffuseBRDF
// Create a new BRDFWard
BRDFWard newBRDF = renderer.newPlugin<BRDFWard>();
// Specify a golden color
newBRDF.set_color(Color(1.0f, 1.0f, 0.0f));
 
MtlSingleBRDF newMaterial = renderer.newPlugin<MtlSingleBRDF>();
newMaterial.set_brdf(newBRDF);
// Create a new BRDFWard
BRDFWard newBRDF = renderer.NewPlugin<BRDFWard>();
// Specify a golden color
newBRDF.Color = new Color(1.0f, 1.0f, 0.0f);
 
MtlSingleBRDF newMaterial = renderer.NewPlugin<MtlSingleBRDF>();
newMaterial.Brdf = newBRDF;
// Create a new BRDFWard
var diffuseBRDF = new renderer.classes.BRDFWard();
// Specify a golden color
diffuseBRDF.color = new vray.Color(1.0, 1.0, 0.0);
 
var newMaterial = new renderer.classes.MtlSingleBRDF();
newMaterial.brdf = diffuseBRDF;

BRDFGGX

This shader implements the Microfacet GGR shading algorithm (see TR75 - TROWBRIDGET. S., REITZK. P.: "Average irregularity representation of a rough surface for ray reflection.", J. Opt. Soc. Am. 65, 5 (May 1975), 531–536. and "Microfacet Models for Refraction through Rough Surfaces" by Bruce Walter et al.). It's useful for modelling light reflections from surfaces.

Parameters

Main parameters are the same as the ones from BRDFBlinn, in addition with these two:

  • gtr_gamma - How much to increase/decrease the tail of the glossy highlight when using GGX reflection model
  • gtr_oldGamma - true to use the old (and incorrect) method for computing shadow masking when GTR gamma is different from 2.0

Example

 

# Create a new BRDFGGX
diffuseBRDF = renderer.classes.BRDFGGX()
# Specify a golden color
diffuseBRDF.color = vray.Color(1.0, 1.0, 0.0)
 
newMaterial = renderer.classes.MtlSingleBRDF()
newMaterial.brdf = diffuseBRDF
// Create a new BRDFGGX
BRDFGGX newBRDF = renderer.newPlugin<BRDFGGX>();
// Specify a golden color
newBRDF.set_color(Color(1.0f, 1.0f, 0.0f));
 
MtlSingleBRDF newMaterial = renderer.newPlugin<MtlSingleBRDF>();
newMaterial.set_brdf(newBRDF);
// Create a new BRDFGGX
BRDFGGX newBRDF = renderer.NewPlugin<BRDFGGX>();
// Specify a golden color
newBRDF.Color = new Color(1.0f, 1.0f, 0.0f);
 
MtlSingleBRDF newMaterial = renderer.NewPlugin<MtlSingleBRDF>();
newMaterial.Brdf = newBRDF;
// Create a new BRDFGGX
var diffuseBRDF = new renderer.classes.BRDFGGX();
// Specify a golden color
diffuseBRDF.color = new vray.Color(1.0, 1.0, 0.0);
 
var newMaterial = new renderer.classes.MtlSingleBRDF();
newMaterial.brdf = diffuseBRDF;

BRDFCookTorrance

This shader implements the Microfacet Cook-Torrance shading algorithm.

Parameters

Main parameters are the same as the ones from BRDFBlinn

Example

 

# Create a new BRDFCookTorrance
diffuseBRDF = renderer.classes.BRDFCookTorrance()
# Specify a golden color
diffuseBRDF.color = vray.Color(1.0, 1.0, 0.0)
 
newMaterial = renderer.classes.MtlSingleBRDF()
newMaterial.brdf = diffuseBRDF
// Create a new BRDFCookTorrance
BRDFCookTorrance newBRDF = renderer.newPlugin<BRDFCookTorrance>();
// Specify a golden color
newBRDF.set_color(Color(1.0f, 1.0f, 0.0f));
 
MtlSingleBRDF newMaterial = renderer.newPlugin<MtlSingleBRDF>();
newMaterial.set_brdf(newBRDF);
// Create a new BRDFCookTorrance
BRDFCookTorrance newBRDF = renderer.NewPlugin<BRDFCookTorrance>();
// Specify a golden color
newBRDF.Color = new Color(1.0f, 1.0f, 0.0f);
 
MtlSingleBRDF newMaterial = renderer.NewPlugin<MtlSingleBRDF>();
newMaterial.Brdf = newBRDF;
// Create a new BRDFCookTorrance
var diffuseBRDF = new renderer.classes.BRDFCookTorrance();
// Specify a golden color
diffuseBRDF.color = new vray.Color(1.0, 1.0, 0.0);
 
var newMaterial = new renderer.classes.MtlSingleBRDF();
newMaterial.brdf = diffuseBRDF;

BRDFGlass

This BRDF implements glass material.

Parameters

  • color - basic color of the material
  • ior - IOR for the glass; this is ignored if the surface has a volume shader (the volume IOR is used).
  • affect_alpha - Specifies how render channels are propagated through the glass (0 - only the color channel; 1 - color and alpha; 2 - all channels
  • trace_depth - The maximum refraction bounces (-1 is controlled by the global options)
  • reflect_exit_color - The color to use when the maximum depth is reached
  • refract_exit_color - The color to use when maximum depth is reached when exit_color_on is true

Example

 

# Create a new BRDFGlass
diffuseBRDF = renderer.classes.BRDFGlass()
# Specify a golden color
diffuseBRDF.color = vray.Color(1.0, 1.0, 0.0)
 
newMaterial = renderer.classes.MtlSingleBRDF()
newMaterial.brdf = diffuseBRDF
// Create a new BRDFGlass
BRDFGlass newBRDF = renderer.newPlugin<BRDFGlass>();
// Specify a golden color
newBRDF.set_color(Color(1.0f, 1.0f, 0.0f));
 
MtlSingleBRDF newMaterial = renderer.newPlugin<MtlSingleBRDF>();
newMaterial.set_brdf(newBRDF);
// Create a new BRDFGlass
BRDFGlass newBRDF = renderer.NewPlugin<BRDFGlass>();
// Specify a golden color
newBRDF.Color = new Color(1.0f, 1.0f, 0.0f);
 
MtlSingleBRDF newMaterial = renderer.NewPlugin<MtlSingleBRDF>();
newMaterial.Brdf = newBRDF;
// Create a new BRDFGlass
var diffuseBRDF = new renderer.classes.BRDFGlass();
// Specify a golden color
diffuseBRDF.color = new vray.Color(1.0, 1.0, 0.0);
 
var newMaterial = new renderer.classes.MtlSingleBRDF();
newMaterial.brdf = diffuseBRDF;

BRDFMirror

This BRDF implements a perfect mirror.

Parameters

  • trace_depth - The maximum reflection depth (-1 is controlled by the global options)
  • affect_alpha - Specifies how render channels are propagated through the BRDF (0 - only the color channel; 1 - color and alpha; 2 - all channels
  • reflect_exit_color - The color to use when the maximum depth is reached
  • reflect_dim_distance_on - True to enable dim distance
  • reflect_dim_distance - How much to dim reflection as length of rays increases
  • reflect_dim_distance_falloff - Fall off for the dim distance

Example

 

# Create a new BRDFMirror
diffuseBRDF = renderer.classes.BRDFMirror()
# Specify a golden color
diffuseBRDF.color = vray.Color(1.0, 1.0, 0.0)
 
newMaterial = renderer.classes.MtlSingleBRDF()
newMaterial.brdf = diffuseBRDF
// Create a new BRDFMirror
BRDFMirror newBRDF = renderer.newPlugin<BRDFMirror>();
// Specify a golden color
newBRDF.set_color(Color(1.0f, 1.0f, 0.0f));
 
MtlSingleBRDF newMaterial = renderer.newPlugin<MtlSingleBRDF>();
newMaterial.set_brdf(newBRDF);
// Create a new BRDFMirror
BRDFMirror newBRDF = renderer.NewPlugin<BRDFMirror>();
// Specify a golden color
newBRDF.Color = new Color(1.0f, 1.0f, 0.0f);
 
MtlSingleBRDF newMaterial = renderer.NewPlugin<MtlSingleBRDF>();
newMaterial.Brdf = newBRDF;
// Create a new BRDFMirror
var diffuseBRDF = new renderer.classes.BRDFMirror();
// Specify a golden color
diffuseBRDF.color = new vray.Color(1.0, 1.0, 0.0);
 
var newMaterial = new renderer.classes.MtlSingleBRDF();
newMaterial.brdf = diffuseBRDF;
  • No labels
Was this helpful?