-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VRAM savings from removing unused blendshapes not as high as when done through Blender #27
Comments
I don't think the VRAM difference comes from handling blendshapes differently.
13k * 2 * 4Bytes ~= 0.1MiB This is the difference between your blender stripped version and the one the optimizer produces. As a short explanation on why I expand uv0. I save original meshID in uv0.z so I can convert mesh toggles to shader property toggles. uv0.w is also needed for merging materials by saving the original material id per vertex and then the combined shader can load per material data from arrays. If you don't have ~13k vertices in that mesh I'd like to get to the bottom of the difference, but if you do you can close this issue. |
I think you might have copied the wrong numbers when checking the difference between blender and this tool, because 11.02 - 8.94 is 2.08, not 0.1 -- while what you've mentioned is a factor that's occurring, it's overshadowed by whatever else is happening. Some points:
|
Ok, I'll investigate the blendshape situation further. Idk what kinda math I was doing in my head last time, I was so far off its not even funny.
yes, that would be pretty easy. I just simply hadn't bothered so far since the gains seem pretty small. |
You might have been comparing the un-optimized and the optimized version, instead of optimized and blender. No worries.
I knew that was eventually going to bite me! Irrelevant for people using the tool as designed, then. I'm glad I mentioned the passes that I disabled. Will edit previous message to indicate this. tbh i'm kinda waiting for a "actually the blendshape space usage is also fixed by enabling another pass, that's also your fault" and hoping that isn't the case >_> |
Ok, I think I figured it out. I added |
That takes it to 10.46 MiB, which is definitely better, but is still leaving 1.52 MiB on the table compared to removing the blendshapes in blender. I should really reproduce on not-personal avatar so you can work on it directly. EDIT: I'm confused now. I setup the reproduction, was getting similar behaviour as with my personal avatar, and then i jiggered some things around and now the optimized avatar's mesh is producing good results, VRAM-wise. EDIT 2: Okay, current status: If I add the component to the avatar, immediately toggle everything off, then I get 10.27 MiB on my reproduction. If I add the component to the avatar, run (a successful) optimization with default settings it gives 8.58 MiB. If I then toggle everything off and re-optimize, it still produces an 8.58 MiB mesh. So I guess there's still behavior that depends on a something being toggled on when optimizing, at least once in this component's lifetime. EDIT 3: It appears that it's Delete Unused Game Objects that's triggering the confusing behaviour? (what? this doesn't feel right at all, looking at the code, which I haven't messed with at all this time. is there more pebkac on my end? :/) |
No its not just you, I also have seen very inconsistent behavior regarding VRAM size now. Even on consecutive runs on the same avatar with no changes :( |
hm. i think my experience has been more consistent than that, but maybe the Delete Unused Game Objects thing was a fluke/red herring. Is it at least consistent for you when using default settings? |
Turns out Thry's VRAM calculator takes some memory consumption value from a Unity API. This is not VRAM consumption however. I found this out while doing blendshape performance testing. I've notified them of a way to calculate actual VRAM consumption for meshes. |
Comparisons done using the VRAM Calculator from Thry's VRAM performance tools, using:
Results:
Unfortunately, this isn't 100% rigorous:
If you want I can work on making a reproduction case that I can send to you that isn't <my personal avatar>
The text was updated successfully, but these errors were encountered: