History

add a emissive parameter value to the lightmap shaders

Sam Gateau committed 11 years ago

Commit 68e2df81 parent f67b4b913 files · +45 −12Browse files

Showing the changes to interface/src/renderer/Model.cpp (1 of 13 files). Show all

Unified · Split

interface/src/renderer/Model.cpp+5−0
@@ -160,6 +160,8 @@ void Model::initProgram(ProgramObject& program, Model::Locations& locations, int · 159 unmodified lines
160 160
161 locations.texcoordMatrices = program.uniformLocation("texcoordMatrices");161 locations.texcoordMatrices = program.uniformLocation("texcoordMatrices");
162 162
163 locations.emissiveParams = program.uniformLocation("emissiveParams");
164
163 165
164 program.setUniformValue("diffuseMap", 0);166 program.setUniformValue("diffuseMap", 0);
165 167
@@ -2378,6 +2380,9 @@ int Model::renderMeshesFromList(QVector<int>& list, gpu::Batch& batch, RenderMod · 2212 unmodified lines
2378 }2380 }
2379 2381
2380 if (locations->emissiveTextureUnit >= 0) {2382 if (locations->emissiveTextureUnit >= 0) {
2383 assert(locations->emissiveParams >= 0); // we should have the emissiveParams defined in the shader
2384 GLBATCH(glUniform2f)(locations->emissiveParams, 0.1f, 4.0f);
2385
2381 GLBATCH(glActiveTexture)(GL_TEXTURE0 + locations->emissiveTextureUnit);2386 GLBATCH(glActiveTexture)(GL_TEXTURE0 + locations->emissiveTextureUnit);
2382 Texture* emissiveMap = networkPart.emissiveTexture.data();2387 Texture* emissiveMap = networkPart.emissiveTexture.data();
2383 GLBATCH(glBindTexture)(GL_TEXTURE_2D, !emissiveMap ?2388 GLBATCH(glBindTexture)(GL_TEXTURE_2D, !emissiveMap ?