History

Adding the self introspection of shaders

Sam Gateau committed 11 years ago

Commit c097c6a1 parent 7534a6b7 files · +428 −44Browse files

Showing the changes to libraries/render-utils/src/Model.cpp (1 of 7 files). Show all

Unified · Split

libraries/render-utils/src/Model.cpp+9−0
@@ -299,6 +299,15 @@ void Model::init() { · 298 unmodified lines
299299 _program.addShaderFromSourceCode(QGLShader::Fragment, model_frag);
300300 initProgram(_program, _locations);
301301
302+
303+ auto defaultShader = gpu::ShaderPointer(
304+ gpu::Shader::createProgram(
305+ gpu::ShaderPointer(gpu::Shader::createVertex(std::string(model_vert))),
306+ gpu::ShaderPointer(gpu::Shader::createPixel(std::string(model_frag)))
307+ )
308+ );
309+ gpu::GLBackend::makeShader(*defaultShader);
310+
302311 _normalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_normal_map_vert);
303312 _normalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_map_frag);
304313 initProgram(_normalMapProgram, _normalMapLocations);