This page contains information for controlling the V-Ray Frame Buffer through environment variables and MaxScript.

 

Page Contents

 

Overview


The V-Ray Frame Buffer can be controlled programmatically in two ways: the first is using various environment variables, and the second is using the vfbControl() MaxScript command.


From MaxScript


The vfbControl() MaxScript function modifies the various aspects of the VFB. These commands can be used in the MAXScript Listener or in an executable script. Commands follow this structure:

vfbControl (parameter) 
vfbControl (parameter) (argument)

For example, to turn off the red channel in the VFB, type

vfbControl #red false

To see a list of available options, type one of the following:

vfbControl()
vfbControl #help


To read more on MaxScript available commands with V-Ray, see the MAXScript page.

Parameter Tables


Below is a list of available options. Note the following about these commands:

  • Arguments listed as Boolean can only receive true/false values. These options turn a feature on (true) or off (false).
  • Remember that float values include a decimal while integers do not. This means that integers can be used when a float is required, but float values cannot be used where integers are required.
  • String values must be enclosed in double quotes.
  • Available values from enumerated lists are presented with a pipe (|) separator. For example, 0 | 1 | 2 means the argument value can only be a 0, 1, or 2. String values of this argument type are input with quote marks. For example, #setregion "reset"
  • Successfully loading a file or setting a numerical value implicitly enables the corresponding option. For example, using #setregion to set a region for rendering automatically turns on region rendering. If you want to disable a feature, do it after running the load/set command. 
  • Many commands will return the current values for the parameter when used without arguments. This feature has been enabled for all commands for which it makes sense to do so.

 

VFB Toolbar Options

ParameterDescriptionArgumentsExamples
#helpDisplays options for the vfbControl commandNone 
#showOpens (true) or closes (false) the VFB window or returns its current display state if called without a valueBoolean 

#rgb
#red
#green
#blue
#alpha
#mono

Enables/disables the corresponding VFB toolbar featureBooleanvfbControl #alpha true
#trackmouseEnables/disables the Track mouse while rendering featureBoolean 
#linkpdpEnables/disables the Link VFB to PDPlayer featureBoolean 
#swapabEnables/disables the Swap A/B featureBoolean 
#setcompareabEnables/disables Compare horizontal and Compare vertical features

"h" | "hor" | "horizontal"
"v" | "ver" | "vertical"

vfbControl #setcompareab "h"
#loadimageLoads the specified image in VFBString (filename) 
#saveimageSaves the VFB RGB color channel as an imageString (filename) 
#saveallimageSaves all VFB render channels to separate images or a single vrimg fileString (filename) 
#savemultiimageSaves a multichannel .exr or .vrimg file with all VFB render channels insideString (filename)vfbcontrol #savemultiimage "D:\output\image.exr"
#setregionSets the render region in pixels, or resets to entire image

Integers: left top right bottom
"reset" 

vfbControl #setregion 0 0 640 480
vfbControl #setregion "reset" 
#getregionReturns the current left, top, right, and bottom settings for region renderingNonevfbControl #getregion
#clearimageClears the VFB imageNone 
#duplicateDuplicates the VFBNone 
#hideHides the VFBNone 
#getchannelReturns the index of the currently selected render element channel.None 
#getchannelnamesReturns a list of the channels available in the current imageNone 
#setchannelSelects the render element channel with an indexIntegervfbControl #setchannel 0
#clamp

Enables/disables Force color clamping

BooleanvfbControl #clamp true
#viewclampEnables/disables View clamped colors Boolean 
#infoEnables/disables Show Pixel information Boolean 
#pixelaspectEnables/disables Use pixel aspectBoolean 
#stereoSets the Stereo value using an integer:
0 - Inactive
1 - Red/cyan mode
2 - Green/magenta mode
0 | 1 | 2vfbControl #stereo 1
#pos

Controls the position of the  VFB window:
<top> - the vertical coordinates of the VFB window
<left> - the horizontal coordinates of the VFBwindow
"reset" - returns the VFB window to its default position
Note: Running without any arguments will return the current position of the VFB window.

Integers: top left
"reset"

vfbControl #pos 100 150
vfbControl #pos "reset"

 

VFB Color Correction Options

ParameterDescriptionArgumentsExamples
#showccShows/hides the Color Corrections panelBoolean 
#exposure

Enables/disables Exposure correction

Boolean 
#whitebalanceEnables/disables White Balance correctionBoolean 
#huesatEnables/disables Hue / Saturation correctionBoolean 
#colorbalanceEnables/disables Color Balance correctionBoolean 
#levelsEnables/disables Levels correctionBoolean 
#curveEnables/disables Curve correctionBoolean 
#bkgrEnables/disables Background Image correctionBoolean 
#lutEnables/disables LUT correctionBoolean 
#ocioEnables/disables OCIO correctionBoolean 
#iccEnables/disables ICC correctionBoolean 
#srgbEnables/disables sRGB gamma correctionBoolean 
#ccociovtSets OCIO View Transform by number in the dropdown listInteger 
#ccocioicsSets OCIO Input Colorspace by number in the dropdown listInteger 
#ccocioddSets OCIO Display Device by number in the dropdown listInteger 
#ocioinputcolorspaceSets OCIO Input Colorspace by nameString 
#ociodisplaydeviceSets OCIO Display Device by nameString 
#ocioviewtransformSets OCIO View Transform by nameString 
#itemsociocsReturns a list of all available OCIO Input Colorspace valuesNone 
#itemsocioddReturns a list of all available OCIO Display Device valuesNone 
#itemsociovtReturns a list of all available OCIO View Transform valuesNone 
#itemsiccriReturns a list of all available ICC Rendering Intent valuesNone 
#colorbalancemode

Sets the Color Balance mode with an integer:
0 - All
1 - Shadows
2 - Midtones
3 - Highlights

0 | 1 | 2 | 3vfbControl #colorbalancemode 3
#colorbalancevalueSets the Color Balance values
for Cyan, Magenta, Yellow
# # #
Where each # is an
integer or float
vfbControl #colorbalancevalue 0.2 0 0.1
#huesaturationvalueSets the Hue/Saturation values
for
Hue, Saturation, Brightness
# # #
Where each # is an
integer or float
 
#cclevels_rgb
#cclevels_red
#cclevels_green
#cclevels_blue
Enables/disables color components in Levels correctionBoolean 
#bkgrimgasforegrEnables/disables the use of Background correction image as foregroundBoolean 
#lutconverttologEnables/disables Log space conversion before applying LUTBoolean 
#cciccblackpointEnables/disables ICC black point compressionBoolean 
#cciccrenderintent1 - Perceptual 
2 - Relative colorimetric
3 - Saturation
4 - Absolute colorimetric
1 | 2 | 3 | 4 

#setexposure

Sets Exposure value Float 
#setcontrastSets Contrast value Float 
#setlevelsminSets Levels min valueFloat 
#setlevelsmaxSets Levels max valueFloat 
#setwhitebalancevalSets White Balance Temperature valueFloat 
#getexposureReturns the current Exposure float value None 
#getcontrastReturns the current Contrast float value None 
#getlevelsminReturns the current Levels min float valueNone 
#getlevelsmaxReturns the current Levels max float valueNone 
#getwhitebalancevalReturns the current White Balance Temperature float valueNone 
#loadbkgrimageSpecifies file for Background image correctionString (filename) 
#loadlutSpecifies file for LUT correctionString (filename) 
#loadocioSpecifies file for OCIO correctionString (filename) 
#loadiccSpecifies file for ICC correctionString (filename) 
#loadcurveLoad Curve shape from the specified .bcurve file String (filename) 
#savecurveSave Curve shape in the specified .bcurve fileString (filename) 
#saveglobalccpreset



Save Global preset for the Corrections control panel to a specified .vccglb file


String (filename) 
#loadglobalccpresetLoad Global preset for the Corrections control panel from a specified .vccglb fileString (filename) 
#saveccpresetSave preset for corrections control rollout to a specified file.
Presets for each separate Correction control rollout use different file extensions.
String (filename) 
#loadccpresetLoad preset in corrections control rollout from a specified file.
Presets for each separate Correction control rollout use different file extensions.
String (filename) 
#resetcc
#resetccexp
#resetccwb
#resetcchsl
#resetccbal
#resetcclvl
#resetcccrv
#resetcclut
#resetccicc
#resetccocio
#resetccbgimg
Resets parameters from corresponding
Correction Control rollouts to default values.
Nonevfbcontrol #resetcc - Resets all correction control parameters
vfbcontrol #resetccbal - Resets only parameters in Color Balance rollout

#bkgrimgfile
#lutfile
#iccfile
#ociofile

Returns the filename (string) used in the corresponding Correction Control rolloutNone 

 

VFB History

ParameterDescriptionArgumentsExamples
#showhistoryShows/Hides History panelBoolean 
#historytemppathReturns the path used for History DirectoryNone 
#historymaxsizeSize of VFB History in MBInteger 
#historyselectSelects a History image based on index.
Selection is used in conjunction with the commands that follow.
First image has 0 index.
IntegervfbControl #historyselect 2
#historyload
#historysave
#historyseta
#historysetb
#historyremove
Performs an operation on the History image
that was selected with #historyselect on the previous line
NonevfbControl #historyselect 0 (required before next command)
vfbControl #historyseta 
#historyclearDeletes all images from historyNone 
#historycommentAdds a comment to the History image
that was selected with #historyselect on the previous line
StringvfbControl #historyselect 1
vfbControl #historycomment "Rendered with GI off" 

 

Lens Effects

ParameterDescriptionArgumentsExamples

#bloom

Turns on/off BloomBooleanvfbControl #bloom true
#glareTurns on/off GlareBoolean 
#bloomfillTurns on/off Bloom Fill EdgesBoolean 
#glarefillTurns on/off Glare Fill EdgesBoolean 
#bloommodeSets the Bloom mode"image" | "both" | "renderelem"vfbControl #bloommode "image"
#glaremode Sets the Glare mode"image" | "both" | "renderelem" 
#glaretypeSets the Glare type"image" | "rendercam" | "camparams" 
#bloomweightSets Bloom Weight valueFloat 
#bloomsizeSets Bloom Size valueFloat 
#bloomshapeSets Bloom Shape valueFloat 
#glareweightSets Glare Weight valueFloat 
#glaresizeSets Glare Size valueFloat 
#bloomintensityEnables/disables Bloom Mask by Intensity
Boolean 
#bloomobjectEnables/disables Bloom Mask by Object IDBoolean 
#bloommaterialEnables/disables Bloom Mask by Material IDBoolean 
#glareintensityEnables/disables Glare Mask by IntensityBoolean 
#glareobjectEnables/disables Glare Mask by Object IDBoolean 
#glarematerialEnables/disables Glare Mask by Material ID Boolean 
#bloomsetintensitySets Bloom Intensity mask value
Float 
#glaresetintensitySets Glare Intensity mask valueFloat 
#bloomgetintensityReturns Bloom Intensity mask float valueNone 
#glaregetintensityReturns Glare Intensity mask float valueNone 
#bloomsetobjectSets Bloom Object ID mask valueInteger 
#bloomsetmaterialSets Bloom Material ID valueInteger 
#glaresetobjectSets Glare Object ID mask valueInteger 
#glaresetmaterialSets Glare Material ID valueInteger 
#bloomgetobjectReturns Bloom Object ID mask integer valueNone 
#bloomgetmaterialReturns Bloom Material ID integer valueNone 
#glaregetobjectReturns Glare Object ID mask integer valueNone 
#glaregetmaterialReturns Glare Material ID integer valueNone 
#glarediffractionEnables/disables Glare DifractionBoolean 
#glareuseobstacleEnables/disables Use Obstacle imageBoolean 
#glarebladesEnables/disables BladesBoolean 
#glaresetbladesSets Glare Blades numberFloat 
#glarebladesrotSets Glare Blades rotationFloat 
#glarefnumberSets Glare F-Number valueFloat 
#glaregetbladesReturns Glare Blades number float valueNone 
#glareimage
Specifies Glare ImageString (filename) 
#glareobstacleimageSpecifies Glare Obstacle imageString (filename) 

 

Stamps

ParameterDescriptionValue OptionsExamples
#stampEnables/disables the stampBooleanvfbControl #stamp true
#stamphalignSets horizontal alignment for stamp"left" | "center" | "right" 
#stampvalignSets vertical alignment for stamp"top" | "bottom" 
#stamptextSets the text string to appear on the stampStringvfbControl #stamptext "Test rendering"

 


Environment Variables


Some aspects of the VFB can also be controlled with various environment variables:


Variable NameDescription
VRAY_VFB_SRGBTurn On (1) or Off (2) sRGB option of V-Ray VFB by default.
VRAY_VFB_PIXEL_ASPECTTurn On (1) or Off (2) Use pixel aspect option of V-Ray VFB by default.
VRAY_VFB_GLOBAL_PRESET_FILE_USEEnable (1) or Disable (0) automatic loading of a global .vccglb preset for the VFB.
VRAY_VFB_GLOBAL_PRESET_FILESpecify default .vccglb filename (string) to be used when loading automatic global preset.
VRAY_VFB_ICC Enable (1) or Disable (2) the ICC correction in VFB by default.
VRAY_VFB_ICC_FILESpecify default ICC correction file for V-Ray VFB. It will be automatically loaded when ICC is enabled.
VRAY_VFB_OCIOEnable (1) or Disable (2) the OCIO correction in V-Ray VFB by default.
VRAY_VFB_OCIO_INPUT_COLORSPACESpecify default input OCIO color space. A default OCIO configuration can be specified by the OCIO environment variable.
VRAY_VFB_OCIO_DISPLAY_DEVICESpecify default OCIO display device. A default OCIO configuration can be specified by the OCIO environment variable.
VRAY_VFB_OCIO_VIEW_TRANSFORMSpecify default OCIO view transform. A default OCIO configuration can be specified by the OCIO environment variable.
VRAY_VFB_LUTEnable (1) or Disable (2) the LUT correction in V-Ray VFB by default.
VRAY_VFB_LUT_FILE Specify default LUT correction file for V-Ray VFB. It will be automatically loaded when LUT is enabled.
VRAY_VFB_AFFECT_SWATCHESApply VFB corrections to swatches in the Material Editor:
0 - none
1 - OCIO only
2 - all corrections except sRGB
3 - all corrections including sRGB
VRAY_VFB_ALWAYS_ON_TOPSpecify a ALWAYS ON TOP behavior:
0 - disabled
1 - force enable always on top
2 - force disable always on top