ai_shader_parameval.h
Go to the documentation of this file.
1// Copyright 2021 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.
6
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
19
20// forward declarations
21struct AtShaderGlobals;
22struct AtNode;
23
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/*\}*/
99
100/*\}*/
101
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 */
112AI_API uint8_t AiShaderEvalParamFuncByte (AtShaderGlobals* sg, const AtNode* node, int pid);
113AI_API int AiShaderEvalParamFuncInt (AtShaderGlobals* sg, const AtNode* node, int pid);
114AI_API unsigned int AiShaderEvalParamFuncUInt (AtShaderGlobals* sg, const AtNode* node, int pid);
115AI_API bool AiShaderEvalParamFuncBool (AtShaderGlobals* sg, const AtNode* node, int pid);
116AI_API float AiShaderEvalParamFuncFlt (AtShaderGlobals* sg, const AtNode* node, int pid);
117AI_API AtRGB AiShaderEvalParamFuncRGB (AtShaderGlobals* sg, const AtNode* node, int pid);
118AI_API AtRGBA AiShaderEvalParamFuncRGBA (AtShaderGlobals* sg, const AtNode* node, int pid);
119AI_API AtVector AiShaderEvalParamFuncVec (AtShaderGlobals* sg, const AtNode* node, int pid);
120AI_API AtVector2 AiShaderEvalParamFuncVec2 (AtShaderGlobals* sg, const AtNode* node, int pid);
121AI_API AtString AiShaderEvalParamFuncStr (AtShaderGlobals* sg, const AtNode* node, int pid);
122AI_API void* AiShaderEvalParamFuncPtr (AtShaderGlobals* sg, const AtNode* node, int pid);
123AI_API AtArray* AiShaderEvalParamFuncArray (AtShaderGlobals* sg, const AtNode* node, int pid);
124AI_API AtMatrix* AiShaderEvalParamFuncMtx (AtShaderGlobals* sg, const AtNode* node, int pid);
125AI_API int AiShaderEvalParamFuncEnum (AtShaderGlobals* sg, const AtNode* node, int pid);
126AI_API AtClosureList AiShaderEvalParamFuncClosure(AtShaderGlobals* sg, const AtNode* node, int pid);
127AI_API AtRGB AiShaderEvalParamFuncOpacity(AtShaderGlobals* sg, const AtNode* node, int pid);
Generic array data type and methods.
Closure type and utilities.
Color types and utilities.
Matrix math type and methods.
Vector math types, operators and utilities.
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
Definition: ai_closure.h:85
Definition: ai_matrix.h:30
This represents a node in Arnold.
RGB color + alpha.
Definition: ai_color.h:267
RGB color.
Definition: ai_color.h:32
Shader globals data structure.
Definition: ai_shaderglobals.h:45
2D point
Definition: ai_vector.h:255
3D point (single precision)
Definition: ai_vector.h:30

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