mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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
|
||||
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();
|
||||
batch.setUniformBuffer(gr::Buffer::Material, schemaBuffer);
|
||||
if (enableTextures) {
|
||||
batch.setResourceTextureTable(multiMaterial.getTextureTable());
|
||||
} else {
|
||||
auto key = multiMaterial.getMaterialKey();
|
||||
if (key.isLightmapMap()) {
|
||||
defaultMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, textureCache->getBlackTexture());
|
||||
} else if (key.isEmissiveMap()) {
|
||||
defaultMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, textureCache->getGrayTexture());
|
||||
if (renderMode != render::Args::RenderMode::SHADOW_RENDER_MODE) {
|
||||
if (key.isLightmapMap()) {
|
||||
defaultMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, textureCache->getBlackTexture());
|
||||
} else if (key.isEmissiveMap()) {
|
||||
defaultMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, textureCache->getGrayTexture());
|
||||
}
|
||||
}
|
||||
|
||||
batch.setResourceTextureTable(defaultMaterialTextures);
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue