| GL Studio C++ Runtime API

effect_diff_norm_spec_refl.h
Go to the documentation of this file.
1/*! \file
2 \brief Render effect that supports diffuse, normal, specular, and reflection maps
3
4 \par Copyright Information
5
6 Copyright (c) 2017 by The DiSTI Corporation.<br>
7 11301 Corporate Blvd; Suite 100<br>
8 Orlando, Florida 32817<br>
9 USA<br>
10 <br>
11 All rights reserved.<br>
12
13 This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19
20 NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26
27 LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35
36 The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America. Use, distribution,
38 duplication, or disclosure by the U. S. Government is subject to
39"Restricted Rights" as set forth in DFARS 252.227-7014(c)(1)(ii).
40
41*/
42
43#ifndef INCLUDED_EFFECT_DIFF_NORM_SPEC_REF_H
44#define INCLUDED_EFFECT_DIFF_NORM_SPEC_REF_H
45
46#include "gls_matrix_affine.h"
47#include "gls_render_effect.h"
48
49#ifdef GLES
50# include "gls_state_manager.h"
51#endif
52
53//////////////////// Provides support for creating DLLs ////////////////////////
54#if( defined( GLSGEN_EXPORT_GLSADVANCEDMESH ) || defined( GLSGEN_IMPORT_GLSADVANCEDMESH ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
55 && defined( _MSC_VER )
56# if defined( GLSGEN_EXPORT_GLSADVANCEDMESH ) || defined( GLS_EXPORT_GENERATED )
57# define GLSGEN_GlsAdvancedMesh_EXPORT __declspec( dllexport )
58# else
59# define GLSGEN_GlsAdvancedMesh_EXPORT __declspec( dllimport )
60# endif
61#else
62# define GLSGEN_GlsAdvancedMesh_EXPORT
63#endif
64///////////////////////////////////////////////////////////////////////////////
65
66 namespace disti
67{
68#ifndef GLES
69 class MaxLike_Shader;
70#endif
71
72/** Render effect that supports diffuse, normal, specular, and reflection maps. */
73 class Effect_DiffNormSpecRefl : public GlsRenderEffect
74{
75 public:
76 static const std::string EFFECT_TYPE_NAME; ///< Backing storage for the human readable string for this effect type.
77
78 /// \details The TextureUVWMatrix class. Describes a texture transformation.
79 class TextureUVWMatrix
80 {
81 bool _isIdentity; ///< Is true if the matrix is identity.
82
83 float _uOffset; ///< Texture U (X) offset.
84 float _vOffset; ///< Texture V (Y) offset.
85 float _uTiling; ///< Texture scaling on U (X) axis.
86 float _vTiling; ///< Texture scaling on V (Y) axis.
87 float _angle; ///< Texture rotation angle in degrees.
88
89 GlsMatrixAffineF _matrix; ///< Texture transform matrix.
90
91 public:
92 TextureUVWMatrix();
93
94 /// Equality operator
95 /// \param rhs The object to compare.
96 /// \return Whether or not the objects are equal.
97 bool operator==( const TextureUVWMatrix& rhs ) const;
98
99 /// Sets the U offset for this texture.
100 /// \param val The new U offset to set.
101 void UOffset( float val ) { _uOffset = val; }
102
103 /// \return The U offset for this texture.
104 float UOffset() const { return _uOffset; }
105
106 /// Sets the V offset for this texture.
107 /// \param val The new V offset to set.
108 void VOffset( float val ) { _vOffset = val; }
109
110 /// \return The V offset for this texture.
111 float VOffset() const { return _vOffset; }
112
113 /// Sets the U scale for this texture.
114 /// \param val The new U scale to set.
115 void UTiling( float val ) { _uTiling = val; }
116
117 /// \return The U scale for this texture.
118 float UTiling() const { return _uTiling; }
119
120 /// Sets the V scale for this texture.
121 /// \param val The new V scale to set.
122 void VTiling( float val ) { _vTiling = val; }
123
124 /// \return The V scale for this texture.
125 float VTiling() const { return _vTiling; }
126
127 /// Set the rotation angle in degrees for this texture.
128 /// \param val The new rotation angle to set.
129 void Angle( float val ) { _angle = val; }
130
131 /// \return The rotation angle for this texture.
132 float Angle() const { return _angle; }
133
134 /// Should be called after changing the parameters.
135 void RecalcTransformMatrix();
136
137 /// \return True if the matrix is identity.
138 inline bool IsIdentity() { return _isIdentity; }
139
140 /// \note Matrix must be an array of [16].
141 /// \return The underlying matrix data.
142 inline float* GetTransformMatrix() { return _matrix.Data(); }
143 };
144
145 protected:
146 unsigned int _ref_count; ///< Reference count
147
148#ifdef GLES20
149 GlsEffect* _shader; /**< The current active effect in the system. If NULL, then no effect is active.
150 * Effects are retrieved from the GlsEffectFactory class. */
151 bool _userHasCustomShader; /** whether or not the user already had a custom shader set up */
152#elif !defined( GLES )
153 MaxLike_Shader* _shader; ///< shader program to use (if any)
154#endif
155
156 unsigned int _materialIndex; ///< The material index to use
157 int _diffuseTextureIndex; ///< INVALID_INDEX, or the texture index to use
158 int _normalTextureIndex; ///< INVALID_INDEX, or the texture index to use
159 int _specularTextureIndex; ///< INVALID_INDEX, or the texture index to use
160 int _reflectionTextureIndex; ///< INVALID_INDEX, or the texture index to use
161
162 float _diffuseAmount; ///< [0.0,1.0] "Weight" of the diffuse map
163 float _normalAmount; ///< [0.0,1.0] "Weight" of the normal map
164 float _specularAmount; ///< [0.0,1.0] "Weight" of the specular map
165 float _reflectionAmount; ///< [0.0,1.0] "Weight" of the reflection map
166
167 bool _useVertexColors; ///< true: use vertex color for diffuse rather than material diffuse
168
169 /// true: expect 'DirectX' format normal maps (positive Green points down)
170 /// false: expect 'OpenGL' format normal maps (positive Green points up)
171 /// Note: the sense is backwards from the Max 'Normal Bump' 'Flip Green' option because
172 /// Max defaults to 'DirectX' format and GL Studio defaults to 'OpenGL' format
173 bool _normalMapFlipGreen;
174
175 DistiAttribDict* _attribDict; ///< The attribute dictionary for this object.
176
177 TextureUVWMatrix _diffuseUVWMatrix; ///< The texture transform for the diffuse texture.
178 TextureUVWMatrix _normalUVWMatrix; ///< The texture transform for the normal texture.
179 TextureUVWMatrix _specularUVWMatrix; ///< The texture transform for the specular texture.
180
181 /// Called to add this object's attributes to the dictionary.
182 /// \note Not normally called by users.
183 void SetupAttribDict();
184
185 public:
186#ifdef GLES20
187 static const GLenum NORMAL_MAP_TEXTURE_UNIT = GL_TEXTURE1; ///< the texture unit that the normal map should be bound to, \see glActiveTexture
188 static const GLenum SPECULAR_MAP_TEXTURE_UNIT = GL_TEXTURE2; ///< the texture unit that the specular map should be bound to, \see glActiveTexture
189 static const GLenum REFLECTION_MAP_TEXTURE_UNIT = GL_TEXTURE3; ///< the texture unit that the reflection map should be bound to, \see glActiveTexture
190
191 /** Get the index for the sampler uniform for the given texture unit
192 * \param textureUnit the texture unit (e.g. GL_TEXTURE1)
193 * \return the index for the sampler uniform
194 */
195 static inline unsigned int TextureUnitIndex( GLenum textureUnit ) { return textureUnit - GL_TEXTURE0; }
196#endif // GLES20
197
198 static const int INVALID_INDEX = -1; ///< Value to represent an invalid texture index.
199
200 GLSGEN_GlsAdvancedMesh_EXPORT Effect_DiffNormSpecRefl();
201 GLSGEN_GlsAdvancedMesh_EXPORT ~Effect_DiffNormSpecRefl();
202
203 /// Copy constructor
204 GLSGEN_GlsAdvancedMesh_EXPORT Effect_DiffNormSpecRefl( const Effect_DiffNormSpecRefl& );
205
206 /// Assignment operator
207 /// \return the resulting object (this)
208 GLSGEN_GlsAdvancedMesh_EXPORT const Effect_DiffNormSpecRefl& operator=( const Effect_DiffNormSpecRefl& );
209
210 /// Equality operator
211 /// \return Whether or not the objects are equal.
212 GLSGEN_GlsAdvancedMesh_EXPORT bool operator==( const Effect_DiffNormSpecRefl& ) const;
213
214 /// Inequality operator
215 /// \param o The object to compare.
216 /// \return Whether or not the objects are not equal.
217 inline bool operator!=( const Effect_DiffNormSpecRefl& o ) const { return !( *this == o ); }
218
219 /// Set the material index for this effect.
220 /// \param materialIndex The new material index for this effect.
221 inline void SetMaterialIndex( unsigned int materialIndex ) { _materialIndex = materialIndex; }
222
223 /// \return The current material index for this effect.
224 inline unsigned int GetMaterialIndex() const { return _materialIndex; }
225
226 /// Set whether or not to use vertex colors, rather than material colors.
227 /// \param value The new value to set.
228 inline void SetUseVertexColor( bool value )
229 {
230 _useVertexColors = value;
231#ifndef GLES
232 SelectShader();
233#endif
234 }
235
236 /// \return Whether the effect is using vertex colors, rather than material colors.
237 inline bool GetUseVertexColor() const { return _useVertexColors; }
238
239 /// Set the texture index that will provide the diffuse color for the effect.
240 /// \param textureIndex The new texture index to set.
241 inline void SetDiffuseTextureIndex( int textureIndex )
242 {
243 _diffuseTextureIndex = textureIndex;
244#ifndef GLES
245 SelectShader();
246#endif
247 }
248
249 /// \return The current diffuse color texture index for this effect.
250 inline int GetDiffuseTextureIndex() const { return _diffuseTextureIndex; }
251
252 /// Set the texture index that will provide normals for the effect
253 /// \param textureIndex The new texture index to set.
254 inline void SetNormalTextureIndex( int textureIndex )
255 {
256 _normalTextureIndex = textureIndex;
257#ifndef GLES
258 SelectShader();
259#endif
260 }
261
262 /// \return The current normal texture index for this effect.
263 inline int GetNormalTextureIndex() const { return _normalTextureIndex; }
264
265 /// Set the texture index that will provide specular for this effect.
266 /// \param textureIndex The new texture index to set.
267 inline void SetSpecularTextureIndex( int textureIndex )
268 {
269 _specularTextureIndex = textureIndex;
270#ifndef GLES
271 SelectShader();
272#endif
273 }
274
275 /// \returns The current specular texture index for this effect.
276 inline int GetSpecularTextureIndex() const { return _specularTextureIndex; }
277
278 /// Set the texture index that will provide reflections for this effect.
279 /// \param textureIndex The new texture index to set.
280 inline void SetReflectionTextureIndex( int textureIndex )
281 {
282 _reflectionTextureIndex = textureIndex;
283#ifndef GLES
284 SelectShader();
285#endif
286 }
287
288 /// \returns The current reflection texture index for this effect.
289 inline int GetReflectionTextureIndex() const { return _reflectionTextureIndex; }
290
291 /// Set the weight of the diffuse texture from 0.0 to 1.0.
292 /// \param value The new weight to set.
293 inline void SetDiffuseAmount( float value )
294 {
295 _diffuseAmount = value;
296#ifndef GLES
297 SelectShader();
298#endif
299 }
300
301 /// \return The current weight for the diffuse texture.
302 inline float GetDiffuseAmount() const { return _diffuseAmount; }
303
304 /// Set the weight of the normal texture from 0.0 to 1.0.
305 /// \param value The new weight to set.
306 inline void SetNormalAmount( float value )
307 {
308 _normalAmount = value;
309#ifndef GLES
310 SelectShader();
311#endif
312 }
313
314 /// \return The current weight for the normal texture.
315 inline float GetNormalAmount() const { return _normalAmount; }
316
317 /// Set the weight of the specular texture from 0.0 to 1.0.
318 /// \param value The new weight to set.
319 inline void SetSpecularAmount( float value )
320 {
321 _specularAmount = value;
322#ifndef GLES
323 SelectShader();
324#endif
325 }
326
327 /// \return The current weight for the specular texture.
328 inline float GetSpecularAmount() const { return _specularAmount; }
329
330 /// Set the weight of the reflection texture from 0.0 to 1.0.
331 /// \param value The new weight to set.
332 inline void SetReflectionAmount( float value )
333 {
334 _reflectionAmount = value;
335#ifndef GLES
336 SelectShader();
337#endif
338 }
339
340 /// \return The current weight for the reflection texture.
341 inline float GetReflectionAmount() const { return _reflectionAmount; }
342
343 /// Set flipping the normal map green channel for DirectX textures (true) or OpenGL textures (false).
344 /// \param value The new flip value.
345 inline void SetNormalMapFlipGreen( bool value )
346 {
347 _normalMapFlipGreen = value;
348#ifndef GLES
349 SelectShader();
350#endif
351 }
352
353 /// \return The current normal map green channel flip: true for DirectX textures, false for OpenGL textures.
354 inline bool GetNormalMapFlipGreen() const { return _normalMapFlipGreen; }
355
356 /// Set Diffuse Map UV transform parameters.
357 /// \note Scaling and rotation are performed from the center of the texture.
358 /// \param uOffset U axis translation.
359 /// \param vOffset V axis translation.
360 /// \param uTiling U axis scaling.
361 /// \param vTiling V axis scaling.
362 /// \param angle X axis rotation in degrees.
363 GLSGEN_GlsAdvancedMesh_EXPORT void SetDiffuseUVWSettings( float uOffset, float vOffset, float uTiling, float vTiling, float angle );
364
365 /// Get Diffuse Map UV transform parameters.
366 /// \param uOffset Returned u axis translation.
367 /// \param vOffset Returned v axis translation.
368 /// \param uTiling Returned u axis scaling.
369 /// \param vTiling Returned v axis scaling.
370 /// \param angle Returned x axis rotation in degrees.
371 GLSGEN_GlsAdvancedMesh_EXPORT void GetDiffuseUVWSettings( float& uOffset, float& vOffset, float& uTiling, float& vTiling, float& angle );
372
373 /// Set Normal Map UV transform parameters.
374 /// \note Scaling and rotation are performed from the center of the texture.
375 /// \param uOffset U axis translation.
376 /// \param vOffset V axis translation.
377 /// \param uTiling U axis scaling.
378 /// \param vTiling V axis scaling.
379 /// \param angle W-axis rotation in degrees.
380 GLSGEN_GlsAdvancedMesh_EXPORT void SetNormalUVWSettings( float uOffset, float vOffset, float uTiling, float vTiling, float angle );
381
382 /// Get Normal Map UV transform parameters.
383 /// \param uOffset Returned u axis translation.
384 /// \param vOffset Returned v axis translation.
385 /// \param uTiling Returned u axis scaling.
386 /// \param vTiling Returned v axis scaling.
387 /// \param angle Returned W-axis rotation in degrees.
388 GLSGEN_GlsAdvancedMesh_EXPORT void GetNormalUVWSettings( float& uOffset, float& vOffset, float& uTiling, float& vTiling, float& angle );
389
390 /// Set Specular Map UV transform parameters.
391 /// \note Scaling and rotation are performed from the center of the texture.
392 /// \param uOffset U axis translation.
393 /// \param vOffset V axis translation.
394 /// \param uTiling U axis scaling.
395 /// \param vTiling V axis scaling.
396 /// \param angle W-axis rotation in degrees.
397 GLSGEN_GlsAdvancedMesh_EXPORT void SetSpecularUVWSettings( float uOffset, float vOffset, float uTiling, float vTiling, float angle );
398
399 /// Get Specular Map UV transform parameters.
400 /// \param uOffset Returned u axis translation.
401 /// \param vOffset Returned v axis translation.
402 /// \param uTiling Returned u axis scaling.
403 /// \param vTiling Returned v axis scaling.
404 /// \param angle Returned W-axis rotation in degrees.
405 GLSGEN_GlsAdvancedMesh_EXPORT void GetSpecularUVWSettings( float& uOffset, float& vOffset, float& uTiling, float& vTiling, float& angle );
406
407 /// Selects the shader to use based on the current effect parameters.
408 /// \note Not normally called by users.
409 GLSGEN_GlsAdvancedMesh_EXPORT void SelectShader();
410
411 /// Recalculate the texture transform matrices.
412 /// \note Not normally called by users.
413 GLSGEN_GlsAdvancedMesh_EXPORT void TextureUVWSettingsChanged();
414
415 /// \return true if the effect has non-default texture transform settings
416 /// \note Not normally called by users.
417 GLSGEN_GlsAdvancedMesh_EXPORT bool UsesTextureTransforms();
418
419 /// \return A reference to the effect's attribute dictionary.
420 inline DistiAttribDict& Attributes() DISTI_METHOD_OVERRIDE
421 {
422 if( !_attribDict )
423 {
424 SetupAttribDict();
425 }
426 return *_attribDict;
427 }
428
429 /// \return This effect's type as a readable string.
430 inline const std::string& EffectTypeName() DISTI_METHOD_OVERRIDE
431 {
432 return EFFECT_TYPE_NAME;
433 }
434
435 /////////////////////////////////////////////
436 // VertexAttribIndexLookup Interface
437 /////////////////////////////////////////////
438
439 /// \copydoc VertexAttribIndexLookup::GetVertexAttribIndexForSemantic
440 virtual GLint GetVertexAttribIndexForSemantic( int semanticEnum ) DISTI_METHOD_OVERRIDE;
441
442 ///////////////////////////////////////////////////////////////////////////
443 // GlsRenderEffect overrides
444 ///////////////////////////////////////////////////////////////////////////
445 /// \copydoc GlsRenderEffect::AddRef
446 virtual void AddRef() DISTI_METHOD_OVERRIDE;
447
448 /// \copydoc GlsRenderEffect::Release
449 virtual void Release() DISTI_METHOD_OVERRIDE;
450
451 /// \copydoc GlsRenderEffect::GlsRenderEffect_ClassID
452 virtual unsigned int GlsRenderEffect_ClassID() const DISTI_METHOD_OVERRIDE;
453
454 /// \copydoc GlsRenderEffect::SetupEffect
455 virtual void SetupEffect(
456 DynamicArray<Material>& materialPalette,
457 TexturePalette* texturePalette,
458 const TextureSettings& textureSettings,
459 float* viewToWorld3x3, // 3x3 matrix (float[9])
460 unsigned int maxLightNum,
461 unsigned int activeLightMask ) DISTI_METHOD_OVERRIDE;
462
463 /// Remove the effect from the OpenGL state.
464 virtual void CleanupEffect();
465
466 /// \copydoc GlsRenderEffect::Compare
467 virtual int Compare( const GlsRenderEffect* other ) const DISTI_METHOD_OVERRIDE;
468
469 /// \copydoc GlsRenderEffect::Clone
470 virtual GlsRenderEffect* Clone() const DISTI_METHOD_OVERRIDE;
471
472 /// \copydoc GlsRenderEffect::GetReferencedTextures
473 virtual void GetReferencedTextures( ReferencedTextureArray& referencedTextures ) DISTI_METHOD_OVERRIDE;
474
475 /// \copydoc GlsRenderEffect::GetReferencedMaterials
476 virtual void GetReferencedMaterials( ReferencedMaterialArray& referencedMaterials ) DISTI_METHOD_OVERRIDE;
477};
478
479} // namespace disti
480
481#endif
disti::DistiAttribDict
Definition: disti_metadata.h:750
disti::DynamicArray
Definition: dynamic_array.h:79
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix
Definition: effect_diff_norm_spec_refl.h:80
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::RecalcTransformMatrix
void RecalcTransformMatrix()
Should be called after changing the parameters.
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::IsIdentity
bool IsIdentity()
Definition: effect_diff_norm_spec_refl.h:138
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::VOffset
float VOffset() const
Definition: effect_diff_norm_spec_refl.h:111
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::UTiling
void UTiling(float val)
Definition: effect_diff_norm_spec_refl.h:115
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::operator==
bool operator==(const TextureUVWMatrix &rhs) const
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::UOffset
float UOffset() const
Definition: effect_diff_norm_spec_refl.h:104
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::VOffset
void VOffset(float val)
Definition: effect_diff_norm_spec_refl.h:108
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::VTiling
void VTiling(float val)
Definition: effect_diff_norm_spec_refl.h:122
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::GetTransformMatrix
float * GetTransformMatrix()
Definition: effect_diff_norm_spec_refl.h:142
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::UOffset
void UOffset(float val)
Definition: effect_diff_norm_spec_refl.h:101
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::VTiling
float VTiling() const
Definition: effect_diff_norm_spec_refl.h:125
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::UTiling
float UTiling() const
Definition: effect_diff_norm_spec_refl.h:118
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::Angle
void Angle(float val)
Definition: effect_diff_norm_spec_refl.h:129
disti::Effect_DiffNormSpecRefl::TextureUVWMatrix::Angle
float Angle() const
Definition: effect_diff_norm_spec_refl.h:132
disti::Effect_DiffNormSpecRefl
Definition: effect_diff_norm_spec_refl.h:74
disti::Effect_DiffNormSpecRefl::GetNormalUVWSettings
void GetNormalUVWSettings(float &uOffset, float &vOffset, float &uTiling, float &vTiling, float &angle)
disti::Effect_DiffNormSpecRefl::SetSpecularAmount
void SetSpecularAmount(float value)
Definition: effect_diff_norm_spec_refl.h:319
disti::Effect_DiffNormSpecRefl::_reflectionTextureIndex
int _reflectionTextureIndex
INVALID_INDEX, or the texture index to use.
Definition: effect_diff_norm_spec_refl.h:160
disti::Effect_DiffNormSpecRefl::TextureUVWSettingsChanged
void TextureUVWSettingsChanged()
disti::Effect_DiffNormSpecRefl::_specularAmount
float _specularAmount
[0.0,1.0] "Weight" of the specular map
Definition: effect_diff_norm_spec_refl.h:164
disti::Effect_DiffNormSpecRefl::CleanupEffect
virtual void CleanupEffect()
Remove the effect from the OpenGL state.
disti::Effect_DiffNormSpecRefl::SetSpecularUVWSettings
void SetSpecularUVWSettings(float uOffset, float vOffset, float uTiling, float vTiling, float angle)
disti::Effect_DiffNormSpecRefl::SetDiffuseAmount
void SetDiffuseAmount(float value)
Definition: effect_diff_norm_spec_refl.h:293
disti::Effect_DiffNormSpecRefl::SetNormalUVWSettings
void SetNormalUVWSettings(float uOffset, float vOffset, float uTiling, float vTiling, float angle)
disti::Effect_DiffNormSpecRefl::UsesTextureTransforms
bool UsesTextureTransforms()
disti::Effect_DiffNormSpecRefl::_materialIndex
unsigned int _materialIndex
The material index to use.
Definition: effect_diff_norm_spec_refl.h:156
disti::Effect_DiffNormSpecRefl::GetSpecularTextureIndex
int GetSpecularTextureIndex() const
Definition: effect_diff_norm_spec_refl.h:276
disti::Effect_DiffNormSpecRefl::_normalTextureIndex
int _normalTextureIndex
INVALID_INDEX, or the texture index to use.
Definition: effect_diff_norm_spec_refl.h:158
disti::Effect_DiffNormSpecRefl::Attributes
DistiAttribDict & Attributes() DISTI_METHOD_OVERRIDE
Definition: effect_diff_norm_spec_refl.h:420
disti::Effect_DiffNormSpecRefl::SetMaterialIndex
void SetMaterialIndex(unsigned int materialIndex)
Definition: effect_diff_norm_spec_refl.h:221
disti::Effect_DiffNormSpecRefl::SetDiffuseTextureIndex
void SetDiffuseTextureIndex(int textureIndex)
Definition: effect_diff_norm_spec_refl.h:241
disti::Effect_DiffNormSpecRefl::_normalUVWMatrix
TextureUVWMatrix _normalUVWMatrix
The texture transform for the normal texture.
Definition: effect_diff_norm_spec_refl.h:178
disti::Effect_DiffNormSpecRefl::_useVertexColors
bool _useVertexColors
true: use vertex color for diffuse rather than material diffuse
Definition: effect_diff_norm_spec_refl.h:167
disti::Effect_DiffNormSpecRefl::_normalAmount
float _normalAmount
[0.0,1.0] "Weight" of the normal map
Definition: effect_diff_norm_spec_refl.h:163
disti::Effect_DiffNormSpecRefl::_ref_count
unsigned int _ref_count
Reference count.
Definition: effect_diff_norm_spec_refl.h:146
disti::Effect_DiffNormSpecRefl::GetMaterialIndex
unsigned int GetMaterialIndex() const
Definition: effect_diff_norm_spec_refl.h:224
disti::Effect_DiffNormSpecRefl::GetDiffuseTextureIndex
int GetDiffuseTextureIndex() const
Definition: effect_diff_norm_spec_refl.h:250
disti::Effect_DiffNormSpecRefl::_normalMapFlipGreen
bool _normalMapFlipGreen
Definition: effect_diff_norm_spec_refl.h:173
disti::Effect_DiffNormSpecRefl::SetReflectionAmount
void SetReflectionAmount(float value)
Definition: effect_diff_norm_spec_refl.h:332
disti::Effect_DiffNormSpecRefl::SetupAttribDict
void SetupAttribDict()
disti::Effect_DiffNormSpecRefl::SelectShader
void SelectShader()
disti::Effect_DiffNormSpecRefl::SetUseVertexColor
void SetUseVertexColor(bool value)
Definition: effect_diff_norm_spec_refl.h:228
disti::Effect_DiffNormSpecRefl::SetSpecularTextureIndex
void SetSpecularTextureIndex(int textureIndex)
Definition: effect_diff_norm_spec_refl.h:267
disti::Effect_DiffNormSpecRefl::EFFECT_TYPE_NAME
static const std::string EFFECT_TYPE_NAME
Backing storage for the human readable string for this effect type.
Definition: effect_diff_norm_spec_refl.h:76
disti::Effect_DiffNormSpecRefl::GetNormalTextureIndex
int GetNormalTextureIndex() const
Definition: effect_diff_norm_spec_refl.h:263
disti::Effect_DiffNormSpecRefl::SetDiffuseUVWSettings
void SetDiffuseUVWSettings(float uOffset, float vOffset, float uTiling, float vTiling, float angle)
disti::Effect_DiffNormSpecRefl::SetReflectionTextureIndex
void SetReflectionTextureIndex(int textureIndex)
Definition: effect_diff_norm_spec_refl.h:280
disti::Effect_DiffNormSpecRefl::GetNormalAmount
float GetNormalAmount() const
Definition: effect_diff_norm_spec_refl.h:315
disti::Effect_DiffNormSpecRefl::_diffuseUVWMatrix
TextureUVWMatrix _diffuseUVWMatrix
The texture transform for the diffuse texture.
Definition: effect_diff_norm_spec_refl.h:177
disti::Effect_DiffNormSpecRefl::GetDiffuseAmount
float GetDiffuseAmount() const
Definition: effect_diff_norm_spec_refl.h:302
disti::Effect_DiffNormSpecRefl::_reflectionAmount
float _reflectionAmount
[0.0,1.0] "Weight" of the reflection map
Definition: effect_diff_norm_spec_refl.h:165
disti::Effect_DiffNormSpecRefl::Compare
virtual int Compare(const GlsRenderEffect *other) const DISTI_METHOD_OVERRIDE
disti::Effect_DiffNormSpecRefl::_diffuseAmount
float _diffuseAmount
[0.0,1.0] "Weight" of the diffuse map
Definition: effect_diff_norm_spec_refl.h:162
disti::Effect_DiffNormSpecRefl::GetReflectionTextureIndex
int GetReflectionTextureIndex() const
Definition: effect_diff_norm_spec_refl.h:289
disti::Effect_DiffNormSpecRefl::SetNormalMapFlipGreen
void SetNormalMapFlipGreen(bool value)
Definition: effect_diff_norm_spec_refl.h:345
disti::Effect_DiffNormSpecRefl::GetReferencedTextures
virtual void GetReferencedTextures(ReferencedTextureArray &referencedTextures) DISTI_METHOD_OVERRIDE
disti::Effect_DiffNormSpecRefl::SetNormalTextureIndex
void SetNormalTextureIndex(int textureIndex)
Definition: effect_diff_norm_spec_refl.h:254
disti::Effect_DiffNormSpecRefl::GetNormalMapFlipGreen
bool GetNormalMapFlipGreen() const
Definition: effect_diff_norm_spec_refl.h:354
disti::Effect_DiffNormSpecRefl::Release
virtual void Release() DISTI_METHOD_OVERRIDE
Release a reference to this object.
disti::Effect_DiffNormSpecRefl::GlsRenderEffect_ClassID
virtual unsigned int GlsRenderEffect_ClassID() const DISTI_METHOD_OVERRIDE
disti::Effect_DiffNormSpecRefl::INVALID_INDEX
static const int INVALID_INDEX
Value to represent an invalid texture index.
Definition: effect_diff_norm_spec_refl.h:198
disti::Effect_DiffNormSpecRefl::operator==
bool operator==(const Effect_DiffNormSpecRefl &) const
disti::Effect_DiffNormSpecRefl::_diffuseTextureIndex
int _diffuseTextureIndex
INVALID_INDEX, or the texture index to use.
Definition: effect_diff_norm_spec_refl.h:157
disti::Effect_DiffNormSpecRefl::GetVertexAttribIndexForSemantic
virtual GLint GetVertexAttribIndexForSemantic(int semanticEnum) DISTI_METHOD_OVERRIDE
disti::Effect_DiffNormSpecRefl::_attribDict
DistiAttribDict * _attribDict
The attribute dictionary for this object.
Definition: effect_diff_norm_spec_refl.h:175
disti::Effect_DiffNormSpecRefl::GetSpecularUVWSettings
void GetSpecularUVWSettings(float &uOffset, float &vOffset, float &uTiling, float &vTiling, float &angle)
disti::Effect_DiffNormSpecRefl::GetDiffuseUVWSettings
void GetDiffuseUVWSettings(float &uOffset, float &vOffset, float &uTiling, float &vTiling, float &angle)
disti::Effect_DiffNormSpecRefl::AddRef
virtual void AddRef() DISTI_METHOD_OVERRIDE
Add to this object's reference count.
disti::Effect_DiffNormSpecRefl::SetupEffect
virtual void SetupEffect(DynamicArray< Material > &materialPalette, TexturePalette *texturePalette, const TextureSettings &textureSettings, float *viewToWorld3x3, unsigned int maxLightNum, unsigned int activeLightMask) DISTI_METHOD_OVERRIDE
disti::Effect_DiffNormSpecRefl::SetNormalAmount
void SetNormalAmount(float value)
Definition: effect_diff_norm_spec_refl.h:306
disti::Effect_DiffNormSpecRefl::GetSpecularAmount
float GetSpecularAmount() const
Definition: effect_diff_norm_spec_refl.h:328
disti::Effect_DiffNormSpecRefl::Clone
virtual GlsRenderEffect * Clone() const DISTI_METHOD_OVERRIDE
disti::Effect_DiffNormSpecRefl::operator=
const Effect_DiffNormSpecRefl & operator=(const Effect_DiffNormSpecRefl &)
disti::Effect_DiffNormSpecRefl::operator!=
bool operator!=(const Effect_DiffNormSpecRefl &o) const
Definition: effect_diff_norm_spec_refl.h:217
disti::Effect_DiffNormSpecRefl::GetReflectionAmount
float GetReflectionAmount() const
Definition: effect_diff_norm_spec_refl.h:341
disti::Effect_DiffNormSpecRefl::_specularTextureIndex
int _specularTextureIndex
INVALID_INDEX, or the texture index to use.
Definition: effect_diff_norm_spec_refl.h:159
disti::Effect_DiffNormSpecRefl::GetUseVertexColor
bool GetUseVertexColor() const
Definition: effect_diff_norm_spec_refl.h:237
disti::Effect_DiffNormSpecRefl::GetReferencedMaterials
virtual void GetReferencedMaterials(ReferencedMaterialArray &referencedMaterials) DISTI_METHOD_OVERRIDE
disti::Effect_DiffNormSpecRefl::EffectTypeName
const std::string & EffectTypeName() DISTI_METHOD_OVERRIDE
Definition: effect_diff_norm_spec_refl.h:430
disti::Effect_DiffNormSpecRefl::_specularUVWMatrix
TextureUVWMatrix _specularUVWMatrix
The texture transform for the specular texture.
Definition: effect_diff_norm_spec_refl.h:179
disti::GlsEffect
Definition: gls_es20_effect.h:60
disti::GlsMatrixAffine< float >
disti::GlsMatrix::Data
Type * Data()
Definition: gls_matrix.h:128
disti::GlsRenderEffect::TextureSettings
Definition: gls_render_effect.h:136
disti::GlsRenderEffect
Definition: gls_render_effect.h:116
disti::Material
Definition: material.h:56
disti::TexturePalette
Definition: texture_palette.h:186
DISTI_METHOD_OVERRIDE
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:222
gls_matrix_affine.h
The GlsMatrixAffine class.
gls_render_effect.h
The disti::GlsRenderEffect class.
gls_state_manager.h
The disti::GlsStateManager factory class. Creates an instance of a state manager that manages the GL ...
disti
Definition: bmpimage.h:47