43 #ifndef _EFFECT_DIFF_NORM_SPEC_REF_H_INCLUDED
44 #define _EFFECT_DIFF_NORM_SPEC_REF_H_INCLUDED
50 #pragma warning( push )
51 #pragma warning( disable: 4244 )
55 #pragma warning( pop )
59 #include "gls_state_manager.h"
63 #if (defined(GLSGEN_EXPORT_GLSADVANCEDMESH) || \
64 defined(GLSGEN_IMPORT_GLSADVANCEDMESH) || \
65 defined(GLS_EXPORT_GENERATED) || \
66 defined(GLS_IMPORT_GENERATED)) \
68 # if defined(GLSGEN_EXPORT_GLSADVANCEDMESH) || defined(GLS_EXPORT_GENERATED)
69 # define GLSGEN_GlsAdvancedMesh_EXPORT __declspec(dllexport)
71 # define GLSGEN_GlsAdvancedMesh_EXPORT __declspec(dllimport)
74 # define GLSGEN_GlsAdvancedMesh_EXPORT
89 static const std::string EFFECT_TYPE_NAME;
109 void UOffset(
float val) { _uOffset = val; }
110 float UOffset()
const {
return _uOffset; }
111 void VOffset(
float val) { _vOffset = val; }
112 float VOffset()
const {
return _vOffset; }
113 void UTiling(
float val) { _uTiling = val; }
114 float UTiling()
const {
return _uTiling; }
115 void VTiling(
float val) { _vTiling = val; }
116 float VTiling()
const {
return _vTiling; }
117 void Angle(
float val) { _angle = val; }
118 float Angle()
const {
return _angle; }
121 void RecalcTransformMatrix();
124 inline bool IsIdentity() {
return _isIdentity; }
127 inline float* GetTransformMatrix() {
return _matrix.
Data(); }
137 bool _userHasCustomShader;
138 #elif !defined( GLES )
167 void SetupAttribDict();
171 static const GLenum NORMAL_MAP_TEXTURE_UNIT = GL_TEXTURE1;
172 static const GLenum SPECULAR_MAP_TEXTURE_UNIT = GL_TEXTURE2;
173 static const GLenum REFLECTION_MAP_TEXTURE_UNIT = GL_TEXTURE3;
179 static inline unsigned int TextureUnitIndex( GLenum textureUnit ) {
return textureUnit - GL_TEXTURE0; }
181 static const int INVALID_INDEX = -1;
193 inline void SetMaterialIndex(
unsigned int materialIndex) { _materialIndex = materialIndex; }
194 inline unsigned int GetMaterialIndex()
const {
return _materialIndex; }
196 inline void SetUseVertexColor(
bool value)
198 _useVertexColors = value;
205 inline void SetDiffuseTextureIndex(
int textureIndex)
207 _diffuseTextureIndex = textureIndex;
214 inline void SetNormalTextureIndex(
int textureIndex)
216 _normalTextureIndex = textureIndex;
223 inline void SetSpecularTextureIndex(
int textureIndex)
225 _specularTextureIndex = textureIndex;
232 inline void SetReflectionTextureIndex(
int textureIndex)
234 _reflectionTextureIndex = textureIndex;
241 inline void SetDiffuseAmount(
float value)
243 _diffuseAmount = value;
250 inline void SetNormalAmount(
float value)
252 _normalAmount = value;
257 inline float GetNormalAmount()
const {
return _normalAmount; }
259 inline void SetSpecularAmount(
float value)
261 _specularAmount = value;
268 inline void SetReflectionAmount(
float value)
270 _reflectionAmount = value;
277 inline void SetNormalMapFlipGreen(
bool value)
279 _normalMapFlipGreen = value;
294 GLSGEN_GlsAdvancedMesh_EXPORT
void SetDiffuseUVWSettings(
float uOffset,
float vOffset,
float uTiling,
float vTiling,
float angle);
295 GLSGEN_GlsAdvancedMesh_EXPORT
void GetDiffuseUVWSettings(
float& uOffset,
float& vOffset,
float& uTiling,
float& vTiling,
float& angle);
305 GLSGEN_GlsAdvancedMesh_EXPORT
void SetNormalUVWSettings(
float uOffset,
float vOffset,
float uTiling,
float vTiling,
float angle);
306 GLSGEN_GlsAdvancedMesh_EXPORT
void GetNormalUVWSettings(
float& uOffset,
float& vOffset,
float& uTiling,
float& vTiling,
float& angle);
316 GLSGEN_GlsAdvancedMesh_EXPORT
void SetSpecularUVWSettings(
float uOffset,
float vOffset,
float uTiling,
float vTiling,
float angle);
317 GLSGEN_GlsAdvancedMesh_EXPORT
void GetSpecularUVWSettings(
float& uOffset,
float& vOffset,
float& uTiling,
float& vTiling,
float& angle);
321 GLSGEN_GlsAdvancedMesh_EXPORT
void SelectShader();
325 GLSGEN_GlsAdvancedMesh_EXPORT
void TextureUVWSettingsChanged();
329 GLSGEN_GlsAdvancedMesh_EXPORT
bool UsesTextureTransforms();
332 inline DistiAttribDict& Attributes()
334 if (!_attribDict) { SetupAttribDict(); }
339 inline const std::string& EffectTypeName()
341 return EFFECT_TYPE_NAME;
354 virtual void Release();
355 virtual unsigned int GlsRenderEffect_ClassID()
const;
357 DynamicArray<Material, false>& materialPalette,
358 TexturePalette* texturePalette,
359 const TextureSettings& textureSettings,
360 float* viewToWorld3x3
361 #
if !((GLS_VERSION_MAJOR == 4 && (GLS_VERSION_MINOR == 1 || GLS_VERSION_MINOR == 0)) || GLS_VERSION_MAJOR <= 3)
363 unsigned int maxLightNum,
364 unsigned int activeLightMask
369 virtual int Compare(
const GlsRenderEffect*)
const;
370 virtual GlsRenderEffect*
Clone()
const;
Definition: effect_diff_norm_spec_refl.h:91
Definition: effect_diff_norm_spec_refl.h:85
unsigned int _ref_count
Reference count.
Definition: effect_diff_norm_spec_refl.h:132
float _normalAmount
[0.0,1.0] "Weight" of the normal map
Definition: effect_diff_norm_spec_refl.h:149
The GlsMatrixAffine class.
bool _useVertexColors
true: use vertex color for diffuse rather than material diffuse
Definition: effect_diff_norm_spec_refl.h:153
virtual GlsRenderEffect * Clone() const
virtual void SetupEffect(DynamicArray< Material, false > &materialPalette, TexturePalette *texturePalette, const TextureSettings &textureSettings, float *viewToWorld3x3)
virtual void GetReferencedTextures(ReferencedTextureArray &referencedTextures)
virtual void CleanupEffect()
Remove the effect trom the OpenGL state.
virtual int Compare(const GlsRenderEffect *) const
float _specularAmount
[0.0,1.0] "Weight" of the specular map
Definition: effect_diff_norm_spec_refl.h:150
float _reflectionAmount
[0.0,1.0] "Weight" of the reflection map
Definition: effect_diff_norm_spec_refl.h:151
MaxLike_Shader * _shader
shader program to use (if any)
Definition: effect_diff_norm_spec_refl.h:139
int _diffuseTextureIndex
INVALID_INDEX, or the texture index to use.
Definition: effect_diff_norm_spec_refl.h:143
Type * Data()
Definition: gls_matrix.h:132
unsigned int _materialIndex
The material index to use.
Definition: effect_diff_norm_spec_refl.h:142
virtual GLint GetVertexAttribIndexForSemantic(int semanticEnum)
int _specularTextureIndex
INVALID_INDEX, or the texture index to use.
Definition: effect_diff_norm_spec_refl.h:145
Definition: disti_metadata.h:676
bool _normalMapFlipGreen
Definition: effect_diff_norm_spec_refl.h:159
int _reflectionTextureIndex
INVALID_INDEX, or the texture index to use.
Definition: effect_diff_norm_spec_refl.h:146
float _diffuseAmount
[0.0,1.0] "Weight" of the diffuse map
Definition: effect_diff_norm_spec_refl.h:148
int _normalTextureIndex
INVALID_INDEX, or the texture index to use.
Definition: effect_diff_norm_spec_refl.h:144
Definition: gls_render_effect.h:119
Definition: bmpimage.h:46
virtual void GetReferencedMaterials(ReferencedMaterialArray &referencedMaterials)
The disti::GlsRenderEffect class.