From 6628f7b811c3e9b7795f574abecd6d9c394f3e9d Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Thu, 25 Dec 2014 19:57:27 -0800 Subject: [PATCH] replace the model.frag and model.vert files from resource by the sl version of the shaders --- libraries/render-utils/src/Model.cpp | 12 +++++------- libraries/render-utils/src/model.slv | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 8a355f1f73..680d193aa3 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -235,8 +235,8 @@ void Model::initJointTransforms() { void Model::init() { if (!_program.isLinked()) { - _program.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() + "shaders/model.vert"); - _program.addShaderFromSourceFile(QGLShader::Fragment, PathUtils::resourcesPath() + "shaders/model.frag"); + _program.addShaderFromSourceCode(QGLShader::Vertex, model_vert); + _program.addShaderFromSourceCode(QGLShader::Fragment, model_frag); initProgram(_program, _locations); @@ -247,8 +247,7 @@ void Model::init() { initProgram(_normalMapProgram, _normalMapLocations); - _specularMapProgram.addShaderFromSourceFile(QGLShader::Vertex, - PathUtils::resourcesPath() + "shaders/model.vert"); + _specularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert); _specularMapProgram.addShaderFromSourceFile(QGLShader::Fragment, PathUtils::resourcesPath() + "shaders/model_specular_map.frag"); @@ -261,8 +260,7 @@ void Model::init() { initProgram(_normalSpecularMapProgram, _normalSpecularMapLocations); - _translucentProgram.addShaderFromSourceFile(QGLShader::Vertex, - PathUtils::resourcesPath() + "shaders/model.vert"); + _translucentProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert); _translucentProgram.addShaderFromSourceFile(QGLShader::Fragment, PathUtils::resourcesPath() + "shaders/model_translucent.frag"); @@ -302,7 +300,7 @@ void Model::init() { PathUtils::resourcesPath() + "shaders/model_shadow.frag"); _skinProgram.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() + "shaders/skin_model.vert"); - _skinProgram.addShaderFromSourceFile(QGLShader::Fragment, PathUtils::resourcesPath() + "shaders/model.frag"); + _skinProgram.addShaderFromSourceCode(QGLShader::Fragment, model_frag); initSkinProgram(_skinProgram, _skinLocations); diff --git a/libraries/render-utils/src/model.slv b/libraries/render-utils/src/model.slv index e1096194ff..496667a062 100755 --- a/libraries/render-utils/src/model.slv +++ b/libraries/render-utils/src/model.slv @@ -23,8 +23,7 @@ void main(void) { normal = normalize(gl_ModelViewMatrix * vec4(gl_Normal, 0.0)); // pass along the diffuse color - // gl_FrontColor = gl_Color * gl_FrontMaterial.diffuse; - gl_FrontColor = gl_Color; + gl_FrontColor = gl_Color * gl_FrontMaterial.diffuse; // and the texture coordinates gl_TexCoord[0] = texcoordMatrices[0] * vec4(gl_MultiTexCoord0.xy, 0.0, 1.0);