d4rkc0d3r / d4rkAvatarOptimizer

d4rkpl4y3r's VRChat Avatar 3.0 optimizer
MIT License
394 stars 17 forks source link

Toggling an Object with an InternalErrorShader causes Unity Freeze, Potential Project Corruption #59

Closed britefire closed 5 months ago

britefire commented 1 year ago

I noticed one avatar caused unity to freeze entirely each time I tried to expand the minimized D4rkAvatarOptimizer component, and an ill-advised attempt to upload an avatar without expanding it caused Unity to lock up, and something shader related corrupted the project into being unable to be launched at all.

After an hour poking at the model in a new launch, I discovered an object turned on in the FX Layer had one of its shaders as the Unity: Screenshot of a mask on the avatar with one of its materials as an internal error shader.

Removing the layer that toggled that item on stopped the freezes entirely, so I decided to try swapping the error shader to a poiyomi mat: Screenshot of a mask on the avatar with the error material replaced.

And after that, the avatar optimizer tool could be added without error.

It looks like somehow, the InternalErrorShader is causing the optimizer to hang entirely; possibly add a quick check to materials to trigger an error if the error shader is present and avoid the hanging behavior that could lead to project issues on upload if it's not caught?

I know it's probably not expected for an error shader to be there, I certainly didn't realize it was on the model. xwx;

d4rkc0d3r commented 1 year ago

I can't reproduce the issue. On my end the material with the error shader gets correctly marked as one the optimizer can't handle and it works around it as expected.