3 #ifndef SCENEVIEW_SHADER_RESOURCE_HPP__
4 #define SCENEVIEW_SHADER_RESOURCE_HPP__
9 #include <QOpenGLShaderProgram>
13 extern int kShaderMaxLights;
90 std::vector<ShaderLightLocation> sv_lights;
142 typedef std::shared_ptr<ShaderResource> Ptr;
144 const QString Name()
const {
return name_; }
165 void LoadFromFiles(
const QString& prefix,
const QString& preamble);
167 QOpenGLShaderProgram* Program() {
return program_.get(); }
176 void LoadLocations();
180 std::unique_ptr<QOpenGLShaderProgram> program_;
187 #endif // SCENEVIEW_SHADER_RESOURCE_HPP__
void LoadFromFiles(const QString &prefix)
Loads a vertex shader and fragment shader into this resource.
int sv_model_mat
Model matrix.
Definition: shader_resource.hpp:66
int sv_tex_coords_0
Texture coordinates set 0.
Definition: shader_resource.hpp:128
int sv_model_normal_mat
Model normal matrix.
Definition: shader_resource.hpp:87
int sv_mv_mat
Model-view matrix.
Definition: shader_resource.hpp:80
An OpenGL shader program.
Definition: shader_resource.hpp:140
int sv_ambient
Per-vertex ambient color.
Definition: shader_resource.hpp:113
int sv_proj_mat
Projection matrix.
Definition: shader_resource.hpp:48
int sv_specular
Per-vertex specular color.
Definition: shader_resource.hpp:118
Holds the GLSL locations of light parameters in a shader program.
Definition: shader_resource.hpp:21
int sv_normal
Vertex normal vector.
Definition: shader_resource.hpp:103
int sv_vert_pos
Vertex position.
Definition: shader_resource.hpp:98
int sv_view_mat
View matrix.
Definition: shader_resource.hpp:54
int sv_mvp_mat
Model-view-projection matrix.
Definition: shader_resource.hpp:73
Holds the GLSL locations of shader variables.
Definition: shader_resource.hpp:40
Central repository for resources.
Definition: resource_manager.hpp:36
int sv_view_mat_inv
View matrix inverse.
Definition: shader_resource.hpp:60
int sv_diffuse
Per-vertex diffuse color.
Definition: shader_resource.hpp:108
int sv_shininess
Per-vertex shininess.
Definition: shader_resource.hpp:123