All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InteriorsCubeMappedAnimatedUVShader.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 
6 #include "Interiors.h"
7 #include "Shader.h"
8 #include "ShaderMacros.h"
9 #include <string>
10 
11 namespace Eegeo
12 {
13  namespace Resources
14  {
15  namespace Interiors
16  {
18  {
19  public:
20  static InteriorsCubeMappedAnimatedUVShader* Create(const Rendering::TShaderId shaderId);
21 
22  virtual void SetMVP(const m44& mvp) const {;}
23  void SetUnpackModelViewProjectionMatrix(const m44& unpackModelViewProjectionMatrix) const;
24  void SetUnpackModelMatrix(const m44& unpackModelMatrix) const;
25  void SetNormalToWorldMatrix(const m44& normalToWorldMatrix) const;
26  void SetDiffuseColor(const v4& color) const;
27  void SetReflectionColor(const v3& color) const;
28  void SetSaturation(float saturation) const;
29  void SetLightColors(const m44& colors) const;
30  void SetWorldToLightDirections(const m44& worldSpaceToLightDirections) const;
31  void SetUVBounds(const Eegeo::v2& min, const Eegeo::v2& max) const;
32  void SetAnimatedUV(const Eegeo::v2& animatedUV) const;
33  void SetWorldToEcefTangentMatrix(const m44& worldToEcefTangentMatrix) const;
34  void SetViewOffset(const v3& viewDirection, float offsetParam) const;
35 
36  void Use(Rendering::GLState& glState) const;
37 
38  GLuint GetDiffuseSamplerId() const { return m_diffuseSamplerId; }
39 
40  GLuint GetCubeMapSamplerId() const { return m_cubeMapSamplerId; }
41 
42 
43 
44  protected:
45  InteriorsCubeMappedAnimatedUVShader(const Rendering::TShaderId shaderId,
46  const std::string& vertexShaderCode,
47  const std::string& fragmentShaderCode);
48 
49  private:
50  GLuint m_unpackModelViewProjectionMatrixUniformLocation;
51  GLuint m_unpackModelMatrixUniformLocation;
52  GLuint m_normalToWorldMatrixUniformLocation;
53 
54  GLuint m_lightColorsUniformLocation;
55  GLuint m_worldToLightDirectionsUniformLocation;
56  GLuint m_minUVRangeUniformLocation;
57  GLuint m_maxUVRangeUniformLocation;
58  GLuint m_animatedUVUniformLocation;
59  GLuint m_diffuseTextureSamplerUniformLocation;
60 
61  GLuint m_diffuseColorUniformLocation;
62  GLuint m_reflectionColorUniformLocation;
63  GLuint m_saturationParamUniformLocation;
64 
65  GLuint m_cubeMapSamplerUniformLocation;
66  GLuint m_worldToEcefTangentMatrixUniformLocation;
67 
68  GLuint m_viewOffsetUniformLocation;
69 
70  const GLuint m_diffuseSamplerId;
71  const GLuint m_cubeMapSamplerId;
72  };
73  }
74  }
75 }