7 #ifndef __arnold_ShaderVariablesArnold_h__ 8 #define __arnold_ShaderVariablesArnold_h__ 26 m_pAtShaderGlobals(NULL) {}
30 virtual String string(I32 a_channel)
const 32 if(a_channel<paramOffset())
34 return (
char*)((
char*)&m_pAtShaderGlobals->x+
37 const String value=AiShaderEvalParamFuncStr(
38 m_pAtShaderGlobals,m_pAtNode,
39 a_channel-paramOffset());
43 virtual I32 integer(I32 a_channel)
const 45 if(a_channel<paramOffset())
48 ((
char*)&m_pAtShaderGlobals->x+
51 const I32 value=AiShaderEvalParamFuncInt(
52 m_pAtShaderGlobals,m_pAtNode,
53 a_channel-paramOffset());
57 virtual Real real(I32 a_channel)
const 59 if(a_channel<paramOffset())
62 ((
char*)&m_pAtShaderGlobals->x+
65 const Real value=AiShaderEvalParamFuncFlt(
66 m_pAtShaderGlobals,m_pAtNode,
67 a_channel-paramOffset());
73 if(a_channel<paramOffset())
76 ((
char*)&m_pAtShaderGlobals->x+
79 const AtVector atVector=AiShaderEvalParamFuncVec(
80 m_pAtShaderGlobals,m_pAtNode,
81 a_channel-paramOffset());
83 atVector[1],atVector[2]);
86 virtual Color color(I32 a_channel)
const 88 if(a_channel<paramOffset())
91 ((
char*)&m_pAtShaderGlobals->x+
94 const AtRGBA atRGBA=AiShaderEvalParamFuncRGBA(
95 m_pAtShaderGlobals,m_pAtNode,
96 a_channel-paramOffset());
97 return Color(atRGBA[0],atRGBA[1],
101 virtual void set(
String a_string)
103 m_pAtShaderGlobals->out.STR=a_string.c_str();
106 virtual void set(I32 a_integer)
108 m_pAtShaderGlobals->out.INT=a_integer;
111 virtual void set(Real a_real)
113 m_pAtShaderGlobals->out.FLT=a_real;
118 AtVector& rAtVector=m_pAtShaderGlobals->out.VEC;
119 rAtVector.x=a_spatialVector[0];
120 rAtVector.y=a_spatialVector[1];
121 rAtVector.z=a_spatialVector[2];
124 virtual void set(
Color a_color)
126 AtRGBA& rAtRGBA=m_pAtShaderGlobals->out.RGBA;
127 rAtRGBA.r=a_color[0];
128 rAtRGBA.g=a_color[1];
129 rAtRGBA.b=a_color[2];
130 rAtRGBA.a=a_color[3];
133 static I32 variableOffset(
String a_variable);
134 static I32 paramOffset(
void) {
return 1000; }
137 void setAtNode(AtNode* a_pAtNode)
138 { m_pAtNode=a_pAtNode; }
140 void setAtShaderGlobals(AtShaderGlobals* a_pAtShaderGlobals)
141 { m_pAtShaderGlobals=a_pAtShaderGlobals; }
146 AtShaderGlobals* m_pAtShaderGlobals;
Surface Variable Access.
Definition: ShaderVariablesI.h:19
kernel
Definition: namespace.dox:3
Shader Variable Access.
Definition: ShaderVariablesArnold.h:20
Special vector for color (RGBA)
Definition: Color.h:21
Automatically reference-counted string container.
Definition: String.h:128