diff --git a/Source/Engine/Graphics/Models/Mesh.cpp b/Source/Engine/Graphics/Models/Mesh.cpp index b75db1949..a115ddec7 100644 --- a/Source/Engine/Graphics/Models/Mesh.cpp +++ b/Source/Engine/Graphics/Models/Mesh.cpp @@ -574,7 +574,8 @@ void Mesh::Draw(const RenderContextBatch& renderContextBatch, const DrawInfo& in // Push draw call to the render lists const auto shadowsMode = (ShadowsCastingMode)(entry.ShadowsMode & slot.ShadowsMode); const DrawPass drawModes = (DrawPass)(info.DrawModes & material->GetDrawModes()); - renderContextBatch.GetMainContext().List->AddDrawCall(renderContextBatch, drawModes, info.Flags, shadowsMode, info.Bounds, drawCall, entry.ReceiveDecals); + if (drawModes != DrawPass::None) + renderContextBatch.GetMainContext().List->AddDrawCall(renderContextBatch, drawModes, info.Flags, shadowsMode, info.Bounds, drawCall, entry.ReceiveDecals); } bool Mesh::DownloadDataGPU(MeshBufferType type, BytesContainer& result) const diff --git a/Source/Engine/Graphics/Models/SkinnedMesh.cpp b/Source/Engine/Graphics/Models/SkinnedMesh.cpp index 17c63ac8e..3a4c2cc68 100644 --- a/Source/Engine/Graphics/Models/SkinnedMesh.cpp +++ b/Source/Engine/Graphics/Models/SkinnedMesh.cpp @@ -278,7 +278,8 @@ void SkinnedMesh::Draw(const RenderContextBatch& renderContextBatch, const DrawI // Push draw call to the render lists const auto shadowsMode = (ShadowsCastingMode)(entry.ShadowsMode & slot.ShadowsMode); const DrawPass drawModes = (DrawPass)(info.DrawModes & material->GetDrawModes()); - renderContextBatch.GetMainContext().List->AddDrawCall(renderContextBatch, drawModes, StaticFlags::None, shadowsMode, info.Bounds, drawCall, entry.ReceiveDecals); + if (drawModes != DrawPass::None) + renderContextBatch.GetMainContext().List->AddDrawCall(renderContextBatch, drawModes, StaticFlags::None, shadowsMode, info.Bounds, drawCall, entry.ReceiveDecals); } bool SkinnedMesh::DownloadDataGPU(MeshBufferType type, BytesContainer& result) const