2
// Copyright ļæ½ 1997 - 2001, Paul C. Gregory
4
// Contact: pgregory@aqsis.com
6
// This library is free software; you can redistribute it and/or
7
// modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation; either
9
// version 2 of the License, or (at your option) any later version.
11
// This library is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
// General Public License for more details.
16
// You should have received a copy of the GNU General Public
17
// License along with this library; if not, write to the Free Software
18
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
\brief Interface classes for variable definitions
23
\author Paul C. Gregory (pgregory@aqsis.com)
26
//? Is .h included already?
27
#ifndef IVARDEF_H_INCLUDED
28
#define IVARDEF_H_INCLUDED 1
32
START_NAMESPACE( Aqsis )
54
Type_Uniform = 0x8000,
55
Type_Varying = 0x4000,
59
Type_Variable = 0x0400,
63
Type_VaryingFloat = Type_Float | Type_Varying,
64
Type_VaryingInteger = Type_Integer | Type_Varying,
65
Type_VaryingPoint = Type_Point | Type_Varying,
66
Type_VaryingString = Type_String | Type_Varying,
67
Type_VaryingColor = Type_Color | Type_Varying,
68
Type_VaryinghPoint = Type_hPoint | Type_Varying,
69
Type_VaryingNormal = Type_Normal | Type_Varying,
70
Type_VaryingVector = Type_Vector | Type_Varying,
71
Type_VaryingMatrix = Type_Matrix | Type_Varying,
73
Type_UniformFloat = Type_Float | Type_Uniform,
74
Type_UniformInteger = Type_Integer | Type_Uniform,
75
Type_UniformPoint = Type_Point | Type_Uniform,
76
Type_UniformString = Type_String | Type_Uniform,
77
Type_UniformColor = Type_Color | Type_Uniform,
78
Type_UniformhPoint = Type_hPoint | Type_Uniform,
79
Type_UniformNormal = Type_Normal | Type_Uniform,
80
Type_UniformVector = Type_Vector | Type_Uniform,
81
Type_UniformMatrix = Type_Matrix | Type_Uniform,
83
Type_VertexFloat = Type_Float | Type_Vertex,
84
Type_VertexInteger = Type_Integer | Type_Vertex,
85
Type_VertexPoint = Type_Point | Type_Vertex,
86
Type_VertexString = Type_String | Type_Vertex,
87
Type_VertexColor = Type_Color | Type_Vertex,
88
Type_VertexhPoint = Type_hPoint | Type_Vertex,
89
Type_VertexNormal = Type_hPoint | Type_Vertex,
90
Type_VertexVector = Type_hPoint | Type_Vertex,
91
Type_VertexMatrix = Type_Matrix | Type_Vertex,
93
Type_UniformFloatVariable = Type_Float | Type_Variable | Type_Uniform,
94
Type_UniformPointVariable = Type_Point | Type_Variable | Type_Uniform,
95
Type_UniformStringVariable = Type_String | Type_Variable | Type_Uniform,
96
Type_UniformColorVariable = Type_Color | Type_Variable | Type_Uniform,
97
Type_UniformNormalVariable = Type_Normal | Type_Variable | Type_Uniform,
98
Type_UniformVectorVariable = Type_Vector | Type_Variable | Type_Uniform,
99
Type_UniformMatrixVariable = Type_Matrix | Type_Variable | Type_Uniform,
101
Type_VaryingFloatVariable = Type_Float | Type_Variable | Type_Varying,
102
Type_VaryingPointVariable = Type_Point | Type_Variable | Type_Varying,
103
Type_VaryingStringVariable = Type_String | Type_Variable | Type_Varying,
104
Type_VaryingColorVariable = Type_Color | Type_Variable | Type_Varying,
105
Type_VaryingNormalVariable = Type_Normal | Type_Variable | Type_Varying,
106
Type_VaryingVectorVariable = Type_Vector | Type_Variable | Type_Varying,
107
Type_VaryingMatrixVariable = Type_Matrix | Type_Variable | Type_Varying,
109
Type_VertexFloatVariable = Type_Float | Type_Variable | Type_Vertex,
110
Type_VertexPointVariable = Type_Point | Type_Variable | Type_Vertex,
111
Type_VertexStringVariable = Type_String | Type_Variable | Type_Vertex,
112
Type_VertexColorVariable = Type_Color | Type_Variable | Type_Vertex,
113
Type_VertexNormalVariable = Type_Normal | Type_Variable | Type_Vertex,
114
Type_VertexVectorVariable = Type_Vector | Type_Variable | Type_Vertex,
115
Type_VertexMatrixVariable = Type_Matrix | Type_Variable | Type_Vertex,
117
Type_VaryingFloatArray = Type_Float | Type_Varying | Type_Array,
118
Type_VaryingIntegerArray = Type_Integer | Type_Varying | Type_Array,
119
Type_VaryingPointArray = Type_Point | Type_Varying | Type_Array,
120
Type_VaryingStringArray = Type_String | Type_Varying | Type_Array,
121
Type_VaryingColorArray = Type_Color | Type_Varying | Type_Array,
122
Type_VaryinghPointArray = Type_hPoint | Type_Varying | Type_Array,
123
Type_VaryingNormalArray = Type_Normal | Type_Varying | Type_Array,
124
Type_VaryingVectorArray = Type_Vector | Type_Varying | Type_Array,
125
Type_VaryingMatrixArray = Type_Matrix | Type_Varying | Type_Array,
127
Type_UniformFloatArray = Type_Float | Type_Uniform | Type_Array,
128
Type_UniformIntegerArray = Type_Integer | Type_Uniform | Type_Array,
129
Type_UniformPointArray = Type_Point | Type_Uniform | Type_Array,
130
Type_UniformStringArray = Type_String | Type_Uniform | Type_Array,
131
Type_UniformColorArray = Type_Color | Type_Uniform | Type_Array,
132
Type_UniformhPointArray = Type_hPoint | Type_Uniform | Type_Array,
133
Type_UniformNormalArray = Type_Normal | Type_Uniform | Type_Array,
134
Type_UniformVectorArray = Type_Vector | Type_Uniform | Type_Array,
135
Type_UniformMatrixArray = Type_Matrix | Type_Uniform | Type_Array,
137
Type_VertexFloatArray = Type_Float | Type_Vertex | Type_Array,
138
Type_VertexIntegerArray = Type_Integer | Type_Vertex | Type_Array,
139
Type_VertexPointArray = Type_Point | Type_Vertex | Type_Array,
140
Type_VertexStringArray = Type_String | Type_Vertex | Type_Array,
141
Type_VertexColorArray = Type_Color | Type_Vertex | Type_Array,
142
Type_VertexhPointArray = Type_hPoint | Type_Vertex | Type_Array,
143
Type_VertexNormalArray = Type_hPoint | Type_Vertex | Type_Array,
144
Type_VertexVectorArray = Type_hPoint | Type_Vertex | Type_Array,
145
Type_VertexMatrixArray = Type_Matrix | Type_Vertex | Type_Array,
148
Storage_Mask = 0xF000,
158
Type_Surface, ///< Surface shader
159
Type_Lightsource, ///< Lightsource shader.
160
Type_Volume, ///< Volume shader.
161
Type_Displacement, ///< Displacement shader.
162
Type_Transformation, ///< Transformation shader.
163
Type_Imager, ///< Image shader.
169
EnvVars_Cs, ///< Surface color.
170
EnvVars_Os, ///< Surface opacity.
171
EnvVars_Ng, ///< Geometric normal.
172
EnvVars_du, ///< First derivative in u.
173
EnvVars_dv, ///< First derivative in v.
174
EnvVars_L, ///< Incoming light direction.
175
EnvVars_Cl, ///< Light color.
176
EnvVars_Ol, ///< Light opacity.
177
EnvVars_P, ///< Point being shaded.
178
EnvVars_dPdu, ///< Change in P with respect to change in u.
179
EnvVars_dPdv, ///< Change in P with respect to change in v.
180
EnvVars_N, ///< Surface normal.
181
EnvVars_u, ///< Surface u coordinate.
182
EnvVars_v, ///< Surface v coordinate.
183
EnvVars_s, ///< Texture s coordinate.
184
EnvVars_t, ///< Texture t coordinate.
185
EnvVars_I, ///< Incident ray direction.
186
EnvVars_Ci, ///< Incident color.
187
EnvVars_Oi, ///< Incident opacity.
188
EnvVars_Ps, ///< Point being lit.
189
EnvVars_E, ///< Viewpoint position.
190
EnvVars_ncomps, ///< Number of color components.
191
EnvVars_time, ///< Frame time.
192
EnvVars_alpha, ///< Fractional pixel coverage.
194
EnvVars_Ns, ///< Normal at point being lit.
200
///----------------------------------------------------------------------
211
///----------------------------------------------------------------------
213
/// Structure storing a variable reference.
220
TqBool operator==( const SqVarRef& From ) const
222
return ( From.m_Type == m_Type && From.m_Index == m_Index );
229
virtual const IqParseNode* pInitialiser() const = 0;
230
virtual IqParseNode* pInitialiser() = 0;
231
virtual TqInt Type() const = 0;
232
virtual const char* strName() const = 0;
233
virtual void IncUseCount() = 0;
234
virtual TqInt UseCount() const = 0;
235
virtual TqInt ArrayLength() const = 0;
236
virtual TqBool fExtern() const = 0;
237
virtual SqVarRef vrExtern() const = 0;
238
virtual void SetParam( TqBool fParam = TqTrue ) = 0;
239
virtual void SetOutput( TqBool fOutput = TqTrue ) = 0;
240
virtual void SetDefaultStorage( TqInt Storage ) = 0;
242
static IqVarDef* GetVariablePtr( const SqVarRef& Ref );
245
//-----------------------------------------------------------------------
247
END_NAMESPACE( Aqsis )
249
#endif // !IVARDEF_H_INCLUDED