Skip to content

removed texture cloning - #2935

Merged
elalish merged 8 commits into
masterfrom
perf
Dec 29, 2021
Merged

elalish merged 8 commits into
masterfrom
perf

Conversation

@elalish

@elalish elalish commented Oct 29, 2021 •

Copy link
Copy Markdown
Contributor

So, while looking into #2915, I noticed that our cloning of textures is in fact causing those copies to be independently uploaded to the GPU, which is causing much of the obscene slow-load of that example with ten identical models. I originally put in the cloning so that our setURI method on the scene-graph would change textures independently for two identical models. This change obviously regresses that, however I think it's the right call now that we have a better texture creation API and since this increases performance and simplifies the code considerably.

Note, this does not actually fix the real problem in #2915, which appears to be caused by very slow shader compilation, which has seen been resolved upstream in three.js.

I have also removed RoughnessMipmapper here, as it has become too much of a headache to maintain. It also costs a little startup time and GPU memory for all models loaded in MV, while having a noticeable effect on very few. Instead, if someone has a model that could use this (shiny material with high-frequency normal map), I will instead recommend the use of KTX2 textures (which everyone should probably be using anyway); these require all mip levels to be present in the file in the first place, so you'll simply want to ensure you use a tool that takes appropriate note of the normal map when generating roughness mips. FYI @pushmatrix @mikkoh.

@elalish elalish self-assigned this Oct 29, 2021
@elalish
elalish requested a review from a user October 29, 2021 16:26
@elalish
elalish marked this pull request as ready for review November 30, 2021 19:07
ghost
ghost previously approved these changes Nov 30, 2021

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the shiny dog issue which also appears on master everything looks fine.

@elalish elalish mentioned this pull request Dec 1, 2021
@elalish
elalish merged commit c0b80a6 into master Dec 29, 2021
@elalish
elalish deleted the perf branch December 29, 2021 00:56
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.

1 participant