Skip to content

fix: performance issue when dealing with models with a lot of objects rendering over and over again#40

Merged
DIYer22 merged 1 commit intoDIYer22:masterfrom
lucasew:fix/material
May 27, 2022
Merged

fix: performance issue when dealing with models with a lot of objects rendering over and over again#40
DIYer22 merged 1 commit intoDIYer22:masterfrom
lucasew:fix/material

Conversation

@lucasew
Copy link
Contributor

@lucasew lucasew commented May 26, 2022

In our project, we have models with about 500 objects but much fewer segmentation instances, and when calculating segmentations repeatedly, we had a very annoying performance problem. Each render iteration gets a bit slower kinda linearly.

After some investigation, we discovered that when this library kicks in it creates one material for each object but every time a render is requested it creates another material instead of reusing the one already there.

This pull request changes this behavior by creating one material per inst_id instead of per object and check if the material is already created so it will not be created again reusing that material and avoiding the slowdown.

… rendering over and over again

Signed-off-by: lucasew <[email protected]>
@lucasew lucasew marked this pull request as draft May 26, 2022 21:58
@lucasew lucasew marked this pull request as ready for review May 26, 2022 22:09
@DIYer22
Copy link
Owner

DIYer22 commented May 27, 2022

Thank you for the contribution!

@DIYer22 DIYer22 merged commit b8778bc into DIYer22:master May 27, 2022
@lucasew lucasew deleted the fix/material branch May 27, 2022 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants