6 #include "VectorMath.h"
12 #define EFFECTMANAGER_MAX_EFFECTS (8)
23 kGraphicsEffectLightTex = 0,
24 kGraphicsEffectPrelitTex,
29 static std::vector <Effect*> m_effectList;
30 static s32 m_nCurrentEffect;
47 static float m_fScale;
49 static u32 m_numBoneMatrices;
54 static s32 m_anTextureIndex[4];
58 static float m_fShadowExtrudedHeightAdjust;
59 static float m_fAlpha;
61 static void UpdateModelViewProjectionMatrix ();
62 static void UpdateModelBoneMatrices ();
63 static void UpdateModelViewMatrix ();
64 static void UpdateModelWorldOffset ();
65 static void UpdateLightDirection ();
66 static void UpdateLightColor ();
67 static void UpdateLightAmbient ();
68 static void UpdateTextureIndex (u32 channel);
69 static void UpdateEyePosition ();
70 static void UpdateScale ();
71 static void UpdateAnimUVSettings ();
72 static void UpdateShadowExtrudedHeightAdjust ();
74 static void UpdateAlpha ();
76 static void CalculateModelViewProjectionMatrix ();
77 static void CalculateInvModelMatrix ();
78 static void CalculateInvModelMatrixUniformScale ();
79 static void CalculateModelViewMatrix ();
81 static u32 m_effectIndexList [kGraphicsNumEffects];
87 static void Initialise ();
88 static void Shutdown ();
91 static s32 AddEffect (
Effect* effect);
92 static Effect* GetEffect (u32 effectIndex);
94 static void CreateEffects();
95 static void DestroyEffects();
96 static void AddEffectByType(GraphicsEffect effectType,
Effect* effect);
97 static Effect* GetEffectByType(GraphicsEffect effectType);
99 static void PreWarmEffects ();
101 static void UseEffectByType_GlState(GraphicsEffect effectType,
Rendering::GLState& glState);
103 static void SetModelMatrix (
const Eegeo::m44& matrix);
104 static void SetModelMatrixUniformScale(
const Eegeo::m44& matrix);
105 static void SetViewMatrix (
const Eegeo::m44& matrix);
106 static void SetProjectionMatrix (
const Eegeo::m44& matrix);
108 static void SetModelWorldOffset (
const Eegeo::v4& offset);
110 static void SetEyePosition (
const Eegeo::v3& position);
111 static void SetScale (
float scale);
113 static void SetAnimUVSettings (
const Eegeo::v4& settings);
114 static void SetLightDirection (u32 lightIndex,
const Eegeo::v3& direction);
115 static void SetLightColor (u32 lightIndex,
const Eegeo::v3& colour);
116 static void SetLightAmbient (
const Eegeo::v3& ambient);
118 static void SetShadowExtrudedHeightAdjust (
float fValue);
119 static void SetAlpha (
float fValue);
121 static void SetTexture (u32 channel, u32 textureIndex);
122 static void SetDirty ();
124 static const Eegeo::m44* GetModelViewProjectionMatrix ();
126 static const Eegeo::v4* GetAnimUVSettings ();
127 static const Eegeo::v3* GetLightDirection (u32 lightIndex);
128 static const Eegeo::v3* GetLightColor (u32 lightIndex);
129 static const Eegeo::v3* GetLightAmbient ();
131 static void SetNumSkinMatrices ( u32 munSkinMatrices ) { m_numBoneMatrices = munSkinMatrices; }
132 static void SetSkinMatrix (
const Eegeo::m44& bone, u32 index ) { m_boneMatrices[index] = bone; }
136 static void SetPerModelFogState(
const Eegeo::v3& cameraRelativeModelOrigin);