Skip to content
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

AAO Trace And Optimize will cause Poiyomi shader cant auto lock on #1383

Open
lonelyicer opened this issue Jan 18, 2025 · 12 comments
Open

AAO Trace And Optimize will cause Poiyomi shader cant auto lock on #1383

lonelyicer opened this issue Jan 18, 2025 · 12 comments

Comments

@lonelyicer
Copy link

lonelyicer commented Jan 18, 2025

AAO Version: 1.8.3
Poiyomi Version: 9.0.61, Pro 9.2.6

https://github.com/poiyomi/PoiyomiToonShader

No logs
Normally Poiyomi will auto-lock on Build, but using AAO will cause Poiyomi cant auto-lock.

@anatawa12
Copy link
Owner

anatawa12 commented Jan 18, 2025

Could you explain what shader lock on is, please?

I searched IVRCSDKPreprocessAvatarCallback on poiyomi and I see several callbacks registered and those are called after AAO so it might be incompatible with duplicating material for optimization in AAO.

@lonelyicer
Copy link
Author

lonelyicer commented Jan 19, 2025

Poiyomi generates a unique shader variant on lock on, and only that variant will display correctly visual effect in VRChat.

Before Lock on:
Image

After Lock on:
Image

@lonelyicer
Copy link
Author

Locked shaders are not editable, but are portable and can still display visual effects correctly without the correct Poiyomi shader installed.

@anatawa12
Copy link
Owner

Thank you for explanation.

I tried poiyomi 9.0.61 from VPM and I found that auto lock-on is working for AAO-duplicated materials.
And locked shader will automatically removed by NDMF (AAO) just after building avatar complete.
This is why you feel shader lock on does not work.

Even if there is some shader features requires shader lock on, I think it will work on uploaded avatar.
Please let me know if you have some features not working.

I found some change in behavior, but it's impossible to fix the change I think.
The difference is that shader lock on without AAO will affect material on Assets, but it with AAO won't affect material on Asset.
However, I think this is expected behavior (from AAO's perspective) because AAO will duplicate material, and Poiyomi will apply shader lock on after Poiyomi processes.
Because Avatar Optimizer is Non-Destructive tool, it's not allowed to edit material so we cannot avoid material duplication.
And there is no way to retrieve original material from duplicated one (except for API in NDMF) so this behavior change is impossible to fix I think.

Do you experienced something bad with this behavior difference?
If so could you explain that please?

@lonelyicer
Copy link
Author

I found that AAO would remove some of my textures incorrectly even though I had locked Poiyomi manually, such as some masks and matcap, I'm not sure if it was a problem with other plugins, but the problem was fixed after I removed the AAO Trace And Optimizer component from Avatar ( The problem persisted after I turned off Merge Skinned Mesh and Optimize Texture)

@anatawa12
Copy link
Owner

anatawa12 commented Jan 21, 2025

Could you let me know the name of property or location of field in the inspector that texture was removed?

@lonelyicer
Copy link
Author

_GlitterMask
_Matcap

@lonelyicer
Copy link
Author

Image

Image

@anatawa12
Copy link
Owner

Thank you. I reproduced the problem with Glitter Mask.

@anatawa12
Copy link
Owner

Umm... After recompiling the AAO, I become could not reproduce the bug even if source code is exactly same as before....

@anatawa12
Copy link
Owner

Could you try upgrading / downgrading AAO and restarting Unity?

@lonelyicer
Copy link
Author

I didn't do anything today, at most I ran it a couple of times after deleting the AAO T&O and the problem couldn't be reproduced

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

No branches or pull requests

2 participants