Fixed ghosts of a renderable being rendered when a material is changed

This commit is contained in:
Kah Wei 2022-11-21 20:21:08 +08:00
parent fdaa9984da
commit 9cc008eaf4
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ namespace SHADE
void SHSuperBatch::Remove(const SHRenderable* renderable) noexcept
{
Handle<SHMaterial> baseMat = renderable->GetMaterial()->GetBaseMaterial();
Handle<SHMaterial> baseMat = (renderable->HasMaterialChanged() ? renderable->GetPrevMaterial() : renderable->GetMaterial())->GetBaseMaterial();
const Handle<SHVkPipeline> PIPELINE = baseMat->HasPipelineChanged() ? baseMat->GetPrevPipeline() : baseMat->GetPipeline();
// Check if we have a Batch with the same pipeline yet