mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 08:16:21 +02:00
fixing the bug when lighmaps are diasppearing in the <apartment>, i don;t understand why
This commit is contained in:
parent
fa375539d0
commit
c78af1c982
1 changed files with 16 additions and 13 deletions
|
@ -2381,24 +2381,27 @@ int Model::renderMeshesFromList(QVector<int>& list, gpu::Batch& batch, RenderMod
|
||||||
GLBATCH(glActiveTexture)(GL_TEXTURE0);
|
GLBATCH(glActiveTexture)(GL_TEXTURE0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locations->emissiveTextureUnit >= 0) {
|
|
||||||
// assert(locations->emissiveParams >= 0); // we should have the emissiveParams defined in the shader
|
|
||||||
float emissiveOffset = part.emissiveParams.x;
|
|
||||||
float emissiveScale = part.emissiveParams.y;
|
|
||||||
GLBATCH(glUniform2f)(locations->emissiveParams, emissiveOffset, emissiveScale);
|
|
||||||
|
|
||||||
GLBATCH(glActiveTexture)(GL_TEXTURE0 + locations->emissiveTextureUnit);
|
|
||||||
Texture* emissiveMap = networkPart.emissiveTexture.data();
|
|
||||||
GLBATCH(glBindTexture)(GL_TEXTURE_2D, !emissiveMap ?
|
|
||||||
Application::getInstance()->getTextureCache()->getWhiteTextureID() : emissiveMap->getID());
|
|
||||||
GLBATCH(glActiveTexture)(GL_TEXTURE0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args) {
|
if (args) {
|
||||||
args->_materialSwitches++;
|
args->_materialSwitches++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HACK: For unkwon reason (yet!) this code that should be assigned only if the material changes need to be called for every
|
||||||
|
// drawcall with an emissive, so let's do it for now.
|
||||||
|
if (locations->emissiveTextureUnit >= 0) {
|
||||||
|
// assert(locations->emissiveParams >= 0); // we should have the emissiveParams defined in the shader
|
||||||
|
float emissiveOffset = part.emissiveParams.x;
|
||||||
|
float emissiveScale = part.emissiveParams.y;
|
||||||
|
GLBATCH(glUniform2f)(locations->emissiveParams, emissiveOffset, emissiveScale);
|
||||||
|
|
||||||
|
GLBATCH(glActiveTexture)(GL_TEXTURE0 + locations->emissiveTextureUnit);
|
||||||
|
Texture* emissiveMap = networkPart.emissiveTexture.data();
|
||||||
|
GLBATCH(glBindTexture)(GL_TEXTURE_2D, !emissiveMap ?
|
||||||
|
Application::getInstance()->getTextureCache()->getWhiteTextureID() : emissiveMap->getID());
|
||||||
|
GLBATCH(glActiveTexture)(GL_TEXTURE0);
|
||||||
|
}
|
||||||
|
|
||||||
lastMaterialID = part.materialID;
|
lastMaterialID = part.materialID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue