All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InteriorsDiffuseSpecularShader.h
1 // Copyright eeGeo Ltd (2012-2015), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Interiors.h"
6 #include "Shader.h"
7 #include "ShaderMacros.h"
8 #include <string>
9 
10 namespace Eegeo
11 {
12  namespace Resources
13  {
14  namespace Interiors
15  {
17  {
18  public:
19  static InteriorsDiffuseSpecularShader* Create(const Rendering::TShaderId shaderId);
20 
21  virtual void SetMVP(const m44& mvp) const {;}
22  void SetUnpackModelViewProjectionMatrix(const m44& unpackModelViewProjectionMatrix) const;
23  void SetUnpackModelMatrix(const m44& unpackModelMatrix) const;
24  void SetNormalToWorldMatrix(const m44& normalToWorldMatrix) const;
25 
26  void SetDiffuseColor(const v4& color) const;
27  void SetSpecularColor(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 SetSpecularPower(float specularPower) const;
33  void SetSpecularModulateTexture(float specularModulateTexture) const;
34  void SetSpecularityFromTextureLuminance(float specularityFromTextureLuminance) const;
35  void SetViewOffset(const v3& viewDirection, float offsetParam) const;
36 
37  void Use(Rendering::GLState& glState) const;
38 
39  GLuint GetDiffuseSamplerId() const { return 0; }
40 
41 
42 
43 
44  protected:
46  const Rendering::TShaderId shaderId,
47  const std::string& vertexShaderCode,
48  const std::string& fragmentShaderCode);
49 
50  private:
51  GLuint m_unpackModelViewProjectionMatrixUniformLocation;
52  GLuint m_unpackModelMatrixUniformLocation;
53  GLuint m_normalToWorldMatrixUniformLocation;
54 
55  GLuint m_lightColorsUniformLocation;
56  GLuint m_worldToLightDirectionsUniformLocation;
57  GLuint m_minUVRangeUniformLocation;
58  GLuint m_maxUVRangeUniformLocation;
59  GLuint m_diffuseTextureSamplerUniformLocation;
60 
61  GLuint m_diffuseColorUniformLocation;
62  GLuint m_specularColorUniformLocation;
63  GLuint m_specularPowerUniformLocation;
64  GLuint m_specularModulateTextureUniformLocation;
65  GLuint m_specularityFromTextureLuminanceUniformLocation;
66  GLuint m_saturationParamUniformLocation;
67 
68  GLuint m_viewOffsetUniformLocation;
69  };
70  }
71  }
72 }