kurotu / VRCQuestTools

Unity editor extension to support uploading VRChat avatars for Oculus Quest
https://kurotu.github.io/VRCQuestTools/
MIT License
218 stars 15 forks source link

[Feature request] Add Material Conversion option to support some transparent material #35

Open UzkiS opened 1 month ago

UzkiS commented 1 month ago

I can convert some transparent materials such as blush from VQT processed ToonLit to VRChat/Mobile/Articles/Multiply to make transparent materials display normally. I hope the tool can directly handle this situation image

kurotu commented 1 month ago

Currently not planned because of its load performance (cost of transparent is high) and instability. VRChat had silently broken particle shaders appearance many times on actual devices ever. I can't assume that shaders properly work in future.

I feel "Material Replacement" is enough for blush though, is there any issue or use case that the replacement setting is not enough?

UzkiS commented 1 month ago

Currently not planned because of its load performance (cost of transparent is high) and instability. VRChat had silently broken particle shaders appearance many times on actual devices ever. I can't assume that shaders properly work in future.

I feel "Material Replacement" is enough for blush though, is there any issue or use case that the replacement setting is not enough?

Thank you for your reply!

My current workflow: Run VQT conversion through GestureManager ->Change shaders from Toon Lit to VRChat/Mobile/Articles/Multiply from NDMF Generated Assets ->Copy the changed materials and textures to another folder ->Replace the copied textures with the copied materials ->Set "Material Replacement"

This will lead to a problem. If the conversion resolution I set in the previous step is 1024 1024, and many things are added later, the overall resolution needs to be switched to 256 256 so that it can be uploaded. These materials that use "Material Replacement" will maintain high resolution and need to be operated again

So I believe that adding alternative shader types to the 'Additional Material Conversation Setting' can greatly improve developer efficiency and user experience (excluding the Default Material Conversation, which can cause performance and instability issues as you mentioned). These custom operations can be directly configured in the 'VQT Avatar Converter Setting' script to maintain consistency in the normal VQT workflow

kurotu commented 1 month ago

Performance which I meant is for VRChat/Mobile/Articles/Multiply shader itself. In general, transparent shaders have higher cost than opaque shaders at run time (especially on mobile GPUs). And instability is for VRChat's updates (the shader was often broken). In these reasons, I recommend not to use particle shaders. Default material conversion is not the matter.

Perhaps you can use Platform-specific overrides of texture importer for material replacement setting. It can reduce texture resolution only for Android. https://docs.unity3d.com/2022.3/Documentation/Manual/class-TextureImporter.html#platform

And you may use Avatar Optimizer's "AAO Trace And Optimize" component. It might amazingly reduce the build size than reducing texture resolution.