VRay SDK for C++
|
Helper class that wraps a plugin instance enabling a certain render element. More...
#include <vraysdk.hpp>
Classes | |
struct | GetDataOptions |
Controls what the buffer returned by getData() contains. More... | |
struct | Info |
This structure is used to return information about a particular channel in the VFB. More... | |
Public Member Functions | |
RenderElement () | |
Default construct an invalid object. | |
BinaryFormat | getBinaryFormat () const |
Get the binary format of pixels in this render element. | |
size_t | getData (void **data, const GetDataOptions &options) const |
size_t | getDataIntoBuffer (const GetDataOptions &options, void *data) const |
PixelFormat | getDefaultPixelFormat () const |
Get the default format used by the getData method for this render element. | |
VRayImage * | getImage (const GetImageOptions &options, int layerIndex=0) const |
VRayImage * | getImage (const ImageRegion *rgn=NULL, int layerIndex=0) const |
std::string | getMetadata () const |
Get render element metadata. Currently works only for Cryptomatte render element and returns manifest and metadata. | |
std::string | getName () const |
Get the display name of this render element. | |
Plugin | getPlugin () const |
Get the plugin instance in the scene that enables this render element. Might be invalid for special channels like EffectsResult. | |
Type | getType () const |
Get the type of the render element. | |
operator bool () const | |
Static Public Member Functions | |
static void | releaseData (void *data) |
Call this to release data allocated by the getData method. | |
Friends | |
class | RenderElements |
Helper class that wraps a plugin instance enabling a certain render element.
Render channel binary format / storage data type.
This describes the desired data format for getData().
The render channal types/aliases are used to identify some common channels.
Enumerator | |
---|---|
NONE | Unspecified channel. |
ATMOSPHERE | Atmospheric effects channel. |
DIFFUSE | Diffuse filter VFB channel. This channel is generated by V-Ray. |
REFLECT | Reflection VFB channel. This channel must be generated by shaders. |
REFRACT | Refraction VFB channel. This channel must be generated by shaders. |
SELFILLUM | Self-illumination VFB channel. This channel must be generated by shaders. |
SHADOW | Shadow VFB channel. This channel is generated by V-Ray. |
SPECULAR | Specular VFB channel. This channel is generated by V-Ray. |
LIGHTING | Lighting VFB channel. This channel is generated by V-Ray. |
GI | GI VFB channel. This channel is generated by V-Ray. |
CAUSTICS | Caustics VFB channel. This channel is generated by V-Ray. |
RAWGI | Raw GI VFB channel. This channel is generated by V-Ray. |
RAWLIGHT | Raw light VFB channel. This channel is generated by V-Ray. |
RAWSHADOW | Raw shadow VFB channel. This channel is generated by V-Ray. |
VELOCITY | Velocity VFB channel. This channel is generated by V-Ray. |
RENDERID | Render ID VFB channel. This channel is generated by V-Ray. |
MTLID | Mtl ID VFB channel. This channel is generated by V-Ray. |
NODEID | Node ID VFB channel. This channel is generated by V-Ray. |
ZDEPTH | Z-Depth VFB channel. This channel is generated by V-Ray. |
REFLECTION_FILTER | Reflection filter VFB channel. This channel must be generated by shaders. |
RAW_REFLECTION | Raw reflection VFB channel. This channel must be generated by shaders. |
REFRACTION_FILTER | Refraction filter VFB channel. This channel must be generated by shaders. |
RAW_REFRACTION | Raw refraction VFB channel. This channel must be generated by shaders. |
REALCOLOR | Real color VFB channel. |
NORMALS | Normals VFB channel. This channel is generated by V-Ray. |
BACKGROUND | Background VFB channel. This channel is generated by V-Ray. |
ALPHA | Alpha VFB channel. This is always created by V-Ray and there can't be multiple instances. It's easier to use getImage() for Alpha. |
COLOR | RGB VFB channel. This is always created by V-Ray and there can't be multiple instances. It's easier to use getImage() for RGB. |
WIRECOLOR | Wire color channel where each object appears with a solid color. This channel is generated by V-Ray. |
MATTESHADOW | Matte shadow channel where full shadows are white and areas not in shadow are black; essentially this is (rawShadow)/(rawLight+rawShadow). This channel is generated by V-Ray. |
TOTALLIGHT | The total diffuse lighting (direct+indirect) falling on a surface. This channel is generated by V-Ray. |
RAWTOTALLIGHT | The raw total diffuse lighting (direct+indirect) falling on a surface. This channel is generated by V-Ray. |
BUMPNORMALS | The normals modified with bump map. This channel must be generated by shaders. |
SAMPLERATE | The sample rate for the image samplers. |
SSS | A channel used for VRayFastSSS2 material sub-surface portion. |
DRBUCKET | A channel that keeps track of which DR server rendered a particular bucket (it is a Color buffer that stores server name strings prerendered, as text, white on black) |
VRMTL_REFLECTGLOSS | A VRayMtl reflection glossiness VFB channel. This channel is generated by V-Ray. |
VRMTL_REFLECTHIGLOSS | A VRayMtl reflection hilight glossiness VFB channel. This channel is generated by V-Ray. |
VRMTL_REFRACTGLOSS | A VRayMtl reflection glossiness VFB channel. This channel is generated by V-Ray. |
SHADEMAP_EXPORT | A channel that keeps the fragment coordinates in camera space. |
REFLECT_ALPHA | Used by matte materials to store the alpha of the reflections. |
VRMTL_REFLECTIOR | A VRayMtl reflection IOR VFB channel. This channel is generated by V-Ray. |
MTLRENDERID | Mtl render ID VFB channel. This channel is generated by V-Ray. |
NOISE_LEVEL | The noise level as estimated by the Adaptive and Progressive image samplers. Used for denoising purposes. |
WORLD_POSITION | The position in world space. Used for denoising purposes. |
DENOISED | A denoised version of the image. Adding this render element enables denoising. |
WORLD_BUMPNORMAL | Normal with bump mapping in world space. |
DEFOCUS_AMOUNT | Pixel blur, combination of DOF and moblur. Used for denoising purposes. |
EFFECTS_RESULT | Channel for all post effects. |
TOON | Toon effect channel. |
RENDERTIME | Per-pixel render time. |
CRYPTOMATTE | Used for Cryptomatte render channel output. |
LIGHTING_ANALYSIS | The lighting analysis overlay. |
LIGHT_SELECT | Link this in the channels parameters of your lights. |
VRMTL_METALNESS | VRayMtl metalness parameter. |
TOON_LIGHTING | Direct toon diffuse lighting. |
TOON_SPECULAR | Direct toon specular lighting. |
VRMTL_SHEEN_COLOR | VRayMtl sheen color parameter (sheen filter uninfluenced by Fresnel weight, reflection and refraction color). |
RAW_SHEEN_REFLECTION | Raw sheen indirect reflection VFB channel. |
SHEEN_FILTER | Sheen filter VFB channel. |
VRMTL_SHEEN_GLOSSINESS | VRayMtl sheen glossiness parameter. |
SHEEN_REFL_ALPHA | Used by matte materials to store the alpha of the sheen reflections. |
COAT_REFL_ALPHA | Used by matte materials to store the alpha of the coat reflections. |
VRMTL_COAT_COLOR | VRayMtl coat highlight color (coat filter uninfluenced by Fresnel weight, reflection and refraction color). |
RAW_COAT_REFLECTION | Raw coat indirect reflection VFB channel. |
COAT_FILTER | Coat filter VFB channel. |
VRMTL_COAT_GLOSSINESS | VRayMtl coat glossiness parameter. |
LAST | not a type, just a delimiter |
USER | User defined channel indices start from here. |
COVERAGE | Pixel coverage. |
MATERIAL_SELECT | Material select. |
MULTIMATTE | RGB matte for up to 3 objects. |
MULTIMATTE_ID | RGB matte using material IDs. |
OBJECT_SELECT | Selects by object/material ID. |
EXTRA_TEX | A single texture override is applied to the whole scene (e.g. Dirt) |
EXTRA_TEX_INT | A single texture override is applied to the whole scene (e.g. Dirt) |
EXTRA_TEX_FLOAT | A single texture override is applied to the whole scene (e.g. Dirt) |
size_t VRay::RenderElement::getData | ( | void ** | data, |
const GetDataOptions & | options | ||
) | const |
Retrieves the render element raw data. The returned memory buffer must be freed with releaseData(data)! WARNING: If Nvidia AI upscaling is enabled, then the returned image/data will have even dimentions.
[out] | data | a pointer to a void pointer which will receive the address of the raw data buffer. Free it with releaseData() when done. |
size_t VRay::RenderElement::getDataIntoBuffer | ( | const GetDataOptions & | options, |
void * | data | ||
) | const |
Retrieves the render element raw data into the buffer. WARNING: If Nvidia AI upscaling is enabled, then the returned image/data will have even dimentions.
options | Image options (crop, color correct, etc.). |
buf | The output data buffer. If nullptr - returns required buffer size. |
VRayImage * VRay::RenderElement::getImage | ( | const GetImageOptions & | options, |
int | layerIndex = 0 |
||
) | const |
Allocate a new copy of the channel data as a VRayImage instance WARNING: If Nvidia AI upscaling is enabled, then the returned image/data will have even dimentions.
options | Use to modify behavior compared to getImage(void) - crop, color correct, etc. |
layerIndex | For multi-layer elements only. The Cryptomatte layer index (between 0 and num_level/2). For ObjectSelect value 1=filter layer and 2=alpha layer. |
VRayImage * VRay::RenderElement::getImage | ( | const ImageRegion * | rgn = NULL , |
int | layerIndex = 0 |
||
) | const |
Allocate a new copy of the channel data as a VRayImage instance WARNING: If Nvidia AI upscaling is enabled, then the returned image/data will have even dimentions.
rgn | an optional image region rectange; NULL means the whole image. |
layerIndex | For multi-layer elements only. The Cryptomatte layer index (between 0 and num_level/2). For ObjectSelect value 1=filter layer and 2=alpha layer. |
|
inline |
Check if there is a valid plugin representing this render element in the scene. If false, creation failed. Exception: COLOR, ALPHA and EFFECTS_RESULT will return false as they are implicit (without a corresponding instance), but they can still be used with getImage/getData. EFFECTS_RESULT may fail getImage/getData if there are no post effects.