Go to the documentation of this file.
1 // Copyright 2020 Autodesk, Inc. All rights reserved.
2 //
3 // Use of this software is subject to the terms of the Autodesk license
4 // agreement provided at the time of installation or download, or which
5 // otherwise accompanies this software in either electronic or hard copy form.
12 #pragma once
13 #include "ai_array.h"
14 #include "ai_closure.h"
15 #include "ai_color.h"
16 #include "ai_matrix.h"
17 #include "ai_vector.h"
18 #include <stdint.h> // uint32_t etc
20 // forward declarations
21 struct AtShaderGlobals;
22 struct AtNode;
82 #define AiShaderEvalParamByte(pid) AiShaderEvalParamFuncByte (sg,node,pid)
83 #define AiShaderEvalParamInt(pid) AiShaderEvalParamFuncInt (sg,node,pid)
84 #define AiShaderEvalParamUInt(pid) AiShaderEvalParamFuncUInt (sg,node,pid)
85 #define AiShaderEvalParamBool(pid) AiShaderEvalParamFuncBool (sg,node,pid)
86 #define AiShaderEvalParamFlt(pid) AiShaderEvalParamFuncFlt (sg,node,pid)
87 #define AiShaderEvalParamRGB(pid) AiShaderEvalParamFuncRGB (sg,node,pid)
88 #define AiShaderEvalParamRGBA(pid) AiShaderEvalParamFuncRGBA (sg,node,pid)
89 #define AiShaderEvalParamVec(pid) AiShaderEvalParamFuncVec (sg,node,pid)
90 #define AiShaderEvalParamVec2(pid) AiShaderEvalParamFuncVec2 (sg,node,pid)
91 #define AiShaderEvalParamStr(pid) AiShaderEvalParamFuncStr (sg,node,pid)
92 #define AiShaderEvalParamPtr(pid) AiShaderEvalParamFuncPtr (sg,node,pid)
93 #define AiShaderEvalParamArray(pid) AiShaderEvalParamFuncArray (sg,node,pid)
94 #define AiShaderEvalParamMtx(pid) AiShaderEvalParamFuncMtx (sg,node,pid)
95 #define AiShaderEvalParamEnum(pid) AiShaderEvalParamFuncEnum (sg,node,pid)
96 #define AiShaderEvalParamClosure(pid) AiShaderEvalParamFuncClosure(sg,node,pid)
97 #define AiShaderEvalParamOpacity(pid) AiShaderEvalParamFuncOpacity(sg,node,pid)
98 /*\}*/
100 /*\}*/
102 /*
103  * Function form, only if you want to explicitly change shader globals and/or
104  * node yourself. Otherwise it is recommended that you use the macros provided
105  * above.
106  *
107  * \param sg A shader globals context
108  * \param node The shader node whose parameter we want to evaluate
109  * \param pid Index in the shader's parameter enum list
110  * \return Parameter value of the corresponding type
111  */
112 AI_API uint8_t AiShaderEvalParamFuncByte (AtShaderGlobals* sg, const AtNode* node, int pid);
113 AI_API int AiShaderEvalParamFuncInt (AtShaderGlobals* sg, const AtNode* node, int pid);
114 AI_API unsigned int AiShaderEvalParamFuncUInt (AtShaderGlobals* sg, const AtNode* node, int pid);
115 AI_API bool AiShaderEvalParamFuncBool (AtShaderGlobals* sg, const AtNode* node, int pid);
116 AI_API float AiShaderEvalParamFuncFlt (AtShaderGlobals* sg, const AtNode* node, int pid);
117 AI_API AtRGB AiShaderEvalParamFuncRGB (AtShaderGlobals* sg, const AtNode* node, int pid);
118 AI_API AtRGBA AiShaderEvalParamFuncRGBA (AtShaderGlobals* sg, const AtNode* node, int pid);
119 AI_API AtVector AiShaderEvalParamFuncVec (AtShaderGlobals* sg, const AtNode* node, int pid);
120 AI_API AtVector2 AiShaderEvalParamFuncVec2 (AtShaderGlobals* sg, const AtNode* node, int pid);
121 AI_API AtString AiShaderEvalParamFuncStr (AtShaderGlobals* sg, const AtNode* node, int pid);
122 AI_API void* AiShaderEvalParamFuncPtr (AtShaderGlobals* sg, const AtNode* node, int pid);
123 AI_API AtArray* AiShaderEvalParamFuncArray (AtShaderGlobals* sg, const AtNode* node, int pid);
124 AI_API AtMatrix* AiShaderEvalParamFuncMtx (AtShaderGlobals* sg, const AtNode* node, int pid);
125 AI_API int AiShaderEvalParamFuncEnum (AtShaderGlobals* sg, const AtNode* node, int pid);
126 AI_API AtClosureList AiShaderEvalParamFuncClosure(AtShaderGlobals* sg, const AtNode* node, int pid);
127 AI_API AtRGB AiShaderEvalParamFuncOpacity(AtShaderGlobals* sg, const AtNode* node, int pid);
RGB color.
Definition: ai_color.h:31
This represents a node in Arnold.
Vector math types, operators and utilities.
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
3D point (single precision)
Definition: ai_vector.h:29
Color types and utilities.
Definition: ai_matrix.h:30
2D point
Definition: ai_vector.h:254
Shader globals data structure.
Definition: ai_shaderglobals.h:45
Generic array data type and methods.
RGB color + alpha.
Definition: ai_color.h:266
Definition: ai_closure.h:84
Matrix math type and methods.
Closure type and utilities.

© 2020 Autodesk, Inc. · All rights reserved ·