14 GLint ViewMatrix = HANDLE_NULL;
15 GLint ModelMatrix = HANDLE_NULL;
16 GLint ProjectionMatrix = HANDLE_NULL;
17 GLint ViewInvMatrix = HANDLE_NULL;
18 GLint ProjectionInvMatrix = HANDLE_NULL;
19 GLint CameraPosition = HANDLE_NULL;
21 GLint LightPosition = HANDLE_NULL;
22 GLint LightType = HANDLE_NULL;
23 GLint LightRadius = HANDLE_NULL;
24 GLint LightColor = HANDLE_NULL;
25 GLint LightShadowMap = HANDLE_NULL;
26 GLint LightMatrix = HANDLE_NULL;
27 GLint LightShadowMode = HANDLE_NULL;
28 GLint LightSize = HANDLE_NULL;
29 GLint LightIrradiance = HANDLE_NULL;
30 GLint LightPrefilter = HANDLE_NULL;
31 GLint LightBrdfLut = HANDLE_NULL;
33 GLint JointMatrix = HANDLE_NULL;
34 GLint SkinningMode = HANDLE_NULL;
36 GLint SourceBuffer = HANDLE_NULL;
37 GLint SourceBufferSize = HANDLE_NULL;
41 GLint Position = HANDLE_NULL;
42 GLint Color = HANDLE_NULL;
43 GLint Normal = HANDLE_NULL;
45 GLint TextureCoord = HANDLE_NULL;
46 GLint Weight = HANDLE_NULL;
47 GLint JointId = HANDLE_NULL;
57 typedef std::map<std::string, GLProgramHandle::Element*> GLElementList;
63 void Exterminate()
override;
65 void SetProgram(GLuint program) {
69 Element* AttributeLocation(
const char* location)
const {
70 auto pair = AttributesList.find(location);
71 return pair == AttributesList.end() ? nullptr : pair->second;
74 Element* UniformLocation(
const char* location)
const {
75 auto pair = UniformsList.find(location);
76 return pair == UniformsList.end() ? nullptr : pair->second;
79 void SetAttribVec3(
const std::string& location, vec3& value);
81 void SetAttribVec4(
const std::string& location, vec4& value);
83 void SetUniformInt(
const std::string& location,
int value);
85 void SetUniformFloat(
const std::string& location,
float value);
87 void SetUniformMat4(
const std::string& location, mat4& value);
89 void SetUniformMat3(
const std::string& location, mat3& value);
91 void SetAttributesList(std::map<std::string, std::string>& vert, std::map<std::string, std::string>& frag);
93 void SetUniformsList(std::map<std::string, std::string>& vert, std::map<std::string, std::string>& frag);
95 GLElementList GetAttributesList()
const;
97 GLElementList GetUniformsList()
const;
99 void SaveShader(
const std::string& path);
102 void Init(
const AssetMgr::AssetReference* asset)
override;
105 static std::string getImplementName(std::map<std::string, std::string>& list,
const std::string& name);
109 GLAttributeHandles Attributes;
110 GLUniformHandles Uniforms;
112 GLElementList AttributesList;
113 GLElementList UniformsList;
115 std::string m_fragShaderName;
116 std::string m_vertShaderName;