AOV (Arbitrary Ouput Values) writing from inside a shader. More...
AOV-writing Functions | |||||||
These functions allow the user to write AOVs. Shaders may write AOVs indiscriminately without hesitation because the system understands the "context" in which an AOV write is performed. This means Arnold can store AOVs when it "makes sense" and ignore writes when it doesn't. For example, Arnold will not store "deep" AOV values (AOVs which are written at different depths for a singe pixel-sample) unless a driver specifically requests "deep" AOV values. An example of a driver requiring "deep" AOV values would be one which writes deep-texture/volume-shadow files. Arnold will only perform AOV writes from within the main trunk of a pixel-sample ray-tree. AOV writes made from inside a side-branch of the primary ray's ray-tree (such as a reflection) will be ignored. Also, AOV writes are ignored during shadow evaluations.
| |||||||
AI_API AI_DEVICE bool | AiAOVSetBool (AtShaderGlobals *sg, const AtString name, bool val) | ||||||
AI_API AI_DEVICE bool | AiAOVSetInt (AtShaderGlobals *sg, const AtString name, int val) | ||||||
AI_API AI_DEVICE bool | AiAOVSetFlt (AtShaderGlobals *sg, const AtString name, float val) | ||||||
AI_API AI_DEVICE bool | AiAOVSetRGB (AtShaderGlobals *sg, const AtString name, AtRGB val) | ||||||
AI_API AI_DEVICE bool | AiAOVSetRGBA (AtShaderGlobals *sg, const AtString name, AtRGBA val) | ||||||
AI_API AI_DEVICE bool | AiAOVSetVec (AtShaderGlobals *sg, const AtString name, AtVector val) | ||||||
AI_API AI_DEVICE bool | AiAOVSetVec2 (AtShaderGlobals *sg, const AtString name, AtVector2 val) | ||||||
AI_API bool | AiAOVSetMatrix (AtShaderGlobals *sg, const AtString name, AtMatrix val) | ||||||
AI_API AI_DEVICE bool | AiAOVSetPtr (AtShaderGlobals *sg, const AtString name, void *val) | ||||||
AOV-reading Functions | |||||||
These functions allow the user to read AOVs.
| |||||||
AI_API AI_DEVICE bool | AiAOVGetBool (const AtShaderGlobals *sg, const AtString name, bool &val) | ||||||
AI_API AI_DEVICE bool | AiAOVGetInt (const AtShaderGlobals *sg, const AtString name, int &val) | ||||||
AI_API AI_DEVICE bool | AiAOVGetFlt (const AtShaderGlobals *sg, const AtString name, float &val) | ||||||
AI_API AI_DEVICE bool | AiAOVGetRGB (const AtShaderGlobals *sg, const AtString name, AtRGB &val) | ||||||
AI_API AI_DEVICE bool | AiAOVGetRGBA (const AtShaderGlobals *sg, const AtString name, AtRGBA &val) | ||||||
AI_API AI_DEVICE bool | AiAOVGetVec (const AtShaderGlobals *sg, const AtString name, AtVector &val) | ||||||
AI_API AI_DEVICE bool | AiAOVGetVec2 (const AtShaderGlobals *sg, const AtString name, AtVector2 &val) | ||||||
AI_API bool | AiAOVGetMatrix (const AtShaderGlobals *sg, const AtString name, AtMatrix &val) | ||||||
AI_API AI_DEVICE bool | AiAOVGetPtr (const AtShaderGlobals *sg, const AtString name, void *&val) | ||||||
AI_API bool | AiAOVEnabled (const AtString name, uint8_t type) | ||||||
Query whether an AOV is enabled (exists) or not. More... | |||||||
AI_API bool | AiAOVRegister (const char *name, uint8_t type, int blend_mode=AI_AOV_BLEND_NONE) | ||||||
Register a new AOV in the global AOV list. More... | |||||||
#define | AI_AOV_BLEND_NONE 0 | ||||||
#define | AI_AOV_BLEND_OPACITY 1 | ||||||
AOV (Arbitrary Ouput Values) writing from inside a shader.
Arnold can route any number of AOVs into any number of drivers that can write to any number of output files.
AI_API bool AiAOVEnabled | ( | const AtString | name, |
uint8_t | type | ||
) |
Query whether an AOV is enabled (exists) or not.
AOVs are only enabled if there is an output driver which depends on a specific AOV for its input. Writes to an AOV which is not "read" by any driver will be ignored.
For example, if a shader knows that a particular AOV isn't needed (not active), then it could conceivably save itself some work.
shader_evaluate
method. It won't work if called from the node_initialize
method.name | the name of the AOV |
type | the type of the AOV (AI_TYPE_INT , AI_TYPE_RGB , etc) |
AI_API bool AiAOVRegister | ( | const char * | name, |
uint8_t | type, | ||
int | blend_mode | ||
) |
Register a new AOV in the global AOV list.
node_update
method.name | the name of the AOV |
type | the type of the AOV (AI_TYPE_INT , AI_TYPE_RGB , etc) |
blend_mode | the blend operation used to compose semi-opaque layers of the AOV (AI_AOV_BLEND_NONE (default) or AI_AOV_BLEND_OPACITY ) |