All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ClippedUniformColoredShader.h
1 // Copyright Wrld Ltd (2023-2023), All Rights Reserved
2 
3 #pragma once
4 
5 #include "UniformColoredShader.h"
6 
7 namespace Eegeo
8 {
9  namespace Rendering
10  {
11  namespace Shaders
12  {
13  // Like UniformColoredShader, but additionally clips against some MODEL SPACE planes
15  {
16  public:
17  static ClippedUniformColoredShader* Create(const TShaderId shaderId, int numClipPlanes);
18 
19  template<std::size_t Size>
20  void SetClipPlanes(const std::array<v4, Size>& clipPlanes) const
21  {
22  SetUniformV4v(clipPlanes.data(), Size, m_clipPlaneUniformLocation);
23  }
24 
25  protected:
27  const TShaderId shaderId,
28  const std::string& vertexShaderCode,
29  const std::string& fragmentShaderCode);
30 
31  private:
32  GLuint m_clipPlaneUniformLocation;
33  };
34  }
35  }
36 }