All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InteriorsDiffuseTranslucentShader.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 InteriorsDiffuseTranslucentShader* Create(const Rendering::TShaderId shaderId);
20 
21  virtual void SetMVP(const m44& mvp) const {;}
22  void SetUnpackModelViewProjectionMatrix(const m44& unpackModelViewProjectionMatrix) const;
23  void SetNormalToWorldMatrix(const m44& normalToWorldMatrix) const;
24 
25  void SetDiffuseColor(const v4& color) const;
26  void SetOutlineColor(const v4& color) const;
27  void SetOutlineThickness(const float outlineThickness) const;
28  void SetLightColors(const m44& colors) const;
29  void SetWorldToLightDirections(const m44& worldSpaceToLightDirections) const;
30 
31  void Use(Rendering::GLState& glState) const;
32 
33  GLuint GetDiffuseSamplerId() const { return 0; }
34 
35  protected:
37  const Rendering::TShaderId shaderId,
38  const std::string& vertexShaderCode,
39  const std::string& fragmentShaderCode);
40 
41  private:
42  GLuint m_unpackModelViewProjectionMatrixUniformLocation;
43  GLuint m_normalToWorldMatrixUniformLocation;
44 
45  GLuint m_lightColorsUniformLocation;
46  GLuint m_worldToLightDirectionsUniformLocation;
47 
48  GLuint m_diffuseColorUniformLocation;
49  GLuint m_outlineColorUniformLocation;
50  GLuint m_outlineThicknessUniformLocation;
51  };
52  }
53  }
54 }