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
160160
161161 locations.texcoordMatrices = program.uniformLocation("texcoordMatrices");
162162
163+ locations.emissiveParams = program.uniformLocation("emissiveParams");
164+
163165
164166 program.setUniformValue("diffuseMap", 0);
165167
@@ -2378,6 +2380,9 @@ int Model::renderMeshesFromList(QVector<int>& list, gpu::Batch& batch, RenderMod · 2212 unmodified lines
23782380 }
23792381
23802382 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+
23812386 GLBATCH(glActiveTexture)(GL_TEXTURE0 + locations->emissiveTextureUnit);
23822387 Texture* emissiveMap = networkPart.emissiveTexture.data();
23832388 GLBATCH(glBindTexture)(GL_TEXTURE_2D, !emissiveMap ?