mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 21:43:03 +02:00
Taking into account comments
This commit is contained in:
parent
7d412f9109
commit
8dabcb76b8
1 changed files with 9 additions and 6 deletions
|
@ -755,18 +755,21 @@ bool RenderPipelines::bindMaterials(graphics::MultiMaterial& multiMaterial, gpu:
|
||||||
});
|
});
|
||||||
|
|
||||||
// For shadows, we only need opacity mask information
|
// For shadows, we only need opacity mask information
|
||||||
if (renderMode != render::Args::RenderMode::SHADOW_RENDER_MODE || multiMaterial.getMaterialKey().isOpacityMaskMap()) {
|
auto key = multiMaterial.getMaterialKey();
|
||||||
|
if (renderMode != render::Args::RenderMode::SHADOW_RENDER_MODE || key.isOpacityMaskMap()) {
|
||||||
auto& schemaBuffer = multiMaterial.getSchemaBuffer();
|
auto& schemaBuffer = multiMaterial.getSchemaBuffer();
|
||||||
batch.setUniformBuffer(gr::Buffer::Material, schemaBuffer);
|
batch.setUniformBuffer(gr::Buffer::Material, schemaBuffer);
|
||||||
if (enableTextures) {
|
if (enableTextures) {
|
||||||
batch.setResourceTextureTable(multiMaterial.getTextureTable());
|
batch.setResourceTextureTable(multiMaterial.getTextureTable());
|
||||||
} else {
|
} else {
|
||||||
auto key = multiMaterial.getMaterialKey();
|
if (renderMode != render::Args::RenderMode::SHADOW_RENDER_MODE) {
|
||||||
if (key.isLightmapMap()) {
|
if (key.isLightmapMap()) {
|
||||||
defaultMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, textureCache->getBlackTexture());
|
defaultMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, textureCache->getBlackTexture());
|
||||||
} else if (key.isEmissiveMap()) {
|
} else if (key.isEmissiveMap()) {
|
||||||
defaultMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, textureCache->getGrayTexture());
|
defaultMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, textureCache->getGrayTexture());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
batch.setResourceTextureTable(defaultMaterialTextures);
|
batch.setResourceTextureTable(defaultMaterialTextures);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue