All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InteriorsStencilMirrorShader.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 InteriorsStencilMirrorShader* 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 SetSaturation(float saturation) const;
28  void SetLightColors(const m44& colors) const;
29  void SetWorldToLightDirections(const m44& worldSpaceToLightDirections) const;
30  void SetUVBounds(const Eegeo::v2& min, const Eegeo::v2& max) const;
31  void SetFresnelCoefficients(float bias, float scale, float power) const;
32  void SetViewOffset(const v3& viewDirection, float offsetParam) const;
33 
34 
35  void Use(Rendering::GLState& glState) const;
36 
37  GLuint GetDiffuseSamplerId() const { return m_diffuseSamplerId; }
38 
39 
40  protected:
42  const Rendering::TShaderId shaderId,
43  const std::string& vertexShaderCode,
44  const std::string& fragmentShaderCode);
45 
46  private:
47  GLuint m_unpackModelViewProjectionMatrixUniformLocation;
48  GLuint m_unpackModelMatrixUniformLocation;
49  GLuint m_normalToWorldMatrixUniformLocation;
50 
51  GLuint m_lightColorsUniformLocation;
52  GLuint m_worldToLightDirectionsUniformLocation;
53  GLuint m_minUVRangeUniformLocation;
54  GLuint m_maxUVRangeUniformLocation;
55  GLuint m_diffuseTextureSamplerUniformLocation;
56 
57  GLuint m_diffuseColorUniformLocation;
58  GLuint m_saturationParamUniformLocation;
59  GLuint m_fresnelBiasScalePowerUniformLocation;
60  GLuint m_viewOffsetUniformLocation;
61 
62  const GLuint m_diffuseSamplerId;
63  };
64  }
65  }
66 }