User-Data API

User-defined data access on geometry. More...

User-Data parameter

This macro is used to retrieve the user-data parameter from within the shaders.

Parameters
_namea string with the name of the user-data value to query
Returns
the parameter for the user data, or NULL if not found
#define AiUDataGetParameter(_name)   AiUserGetParameterFunc(_name, sg)
 

User-Data Readers

These macros are used to retrieve user-data values from within shaders. If a varying-type user-data is requested, then the user-data will be correctly interpolated across the face of the primitive.

In the case of reading constant-type user-data, the usual node-parameter reading functions, such as AiNodeGetInt(), may also be used.

Parameters
_namea string with the name of the user-data value to read
_valthe value in which to store the contents of the read operation
Returns
a boolean indicating whether the operation was successful

Please refer to ai_shader_userdef.h for a description of the userdef-data reading functions called by these macros.

#define AiUDataGetBool(_name, _val)   AiUserGetBoolFunc (_name, sg, _val)
 
#define AiUDataGetByte(_name, _val)   AiUserGetByteFunc (_name, sg, _val)
 
#define AiUDataGetInt(_name, _val)   AiUserGetIntFunc (_name, sg, _val)
 
#define AiUDataGetUInt(_name, _val)   AiUserGetUIntFunc (_name, sg, _val)
 
#define AiUDataGetFlt(_name, _val)   AiUserGetFltFunc (_name, sg, _val)
 
#define AiUDataGetRGB(_name, _val)   AiUserGetRGBFunc (_name, sg, _val)
 
#define AiUDataGetRGBA(_name, _val)   AiUserGetRGBAFunc (_name, sg, _val)
 
#define AiUDataGetVec(_name, _val)   AiUserGetVecFunc (_name, sg, _val)
 
#define AiUDataGetVec2(_name, _val)   AiUserGetVec2Func (_name, sg, _val)
 
#define AiUDataGetStr(_name, _val)   AiUserGetStrFunc (_name, sg, _val)
 
#define AiUDataGetPtr(_name, _val)   AiUserGetPtrFunc (_name, sg, _val)
 
#define AiUDataGetNode(_name, _val)   AiUserGetNodeFunc (_name, sg, _val)
 
#define AiUDataGetArray(_name, _val)   AiUserGetArrayFunc (_name, sg, _val)
 
#define AiUDataGetMatrix(_name, _val)   AiUserGetMatrixFunc(_name, sg, _val)
 

User-Data Derivatives with respect to screen X and Y

These macros are used to retrieve user-data derivatives w.r.t. X and Y from within shaders. If a varying-type user-data is requested, then the user-data derivatives will be correctly interpolated across the face of the primitive. These derivatives can be useful in determining filter sizes to match pixel footprints, such as when texture mapping.

In the case of reading constant-type user-data, the derivatives are zero.

Parameters
_namea string with the name of the user-data value to read
_dx_valthe value in which to store the contents of the computed derivatives with respect to the X pixel direction
_dy_valthe value in which to store the contents of the computed derivatives with respect to the Y pixel direction
Returns
a boolean indicating whether the operation was successful

Please refer to ai_shader_userdef.h for a description of the userdef-data reading functions called by these macros.

#define AiUDataGetDxyDerivativesFlt(_name, _dx_val, _dy_val)   AiUserGetDxyDerivativesFltFunc (_name, sg, _dx_val, _dy_val)
 
#define AiUDataGetDxyDerivativesRGB(_name, _dx_val, _dy_val)   AiUserGetDxyDerivativesRGBFunc (_name, sg, _dx_val, _dy_val)
 
#define AiUDataGetDxyDerivativesRGBA(_name, _dx_val, _dy_val)   AiUserGetDxyDerivativesRGBAFunc (_name, sg, _dx_val, _dy_val)
 
#define AiUDataGetDxyDerivativesVec(_name, _dx_val, _dy_val)   AiUserGetDxyDerivativesVecFunc (_name, sg, _dx_val, _dy_val)
 
#define AiUDataGetDxyDerivativesVec2(_name, _dx_val, _dy_val)   AiUserGetDxyDerivativesVec2Func (_name, sg, _dx_val, _dy_val)
 
#define AiUDataGetDxyDerivativesArray(_name, _dx_val, _dy_val)   AiUserGetDxyDerivativesArrayFunc (_name, sg, _dx_val, _dy_val)
 
#define AiUDataGetDxyDerivativesMatrix(_name, _dx_val, _dy_val)   AiUserGetDxyDerivativesMatrixFunc(_name, sg, _dx_val, _dy_val)
 

Detailed Description

User-defined data access on geometry.

User-defined data (sometimes called "user-data") are new parameters that have been added to existing node-instances via AiNodeDeclare().

There are four kinds of user-defined data:


© 2020 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com