SDK, local SDK test avatar and uploaded avatar report different material slots count when renderers have more material slots than sub-meshes
WubTheCaptain
Please see the attached screenshots to explain the issue.
I have an avatar which is reported as 4 materials in the local SDK test build and in the SDK, but as 5 material slots when uploaded. This occurs when a skinned mesh renderer has more material slots than sub-meshes.
Avatar setup explained
- Armature
- Body(skinned mesh renderer): 2 materials (Salt_Face,Salt_Face_Effect)
- Hair(skinned mesh renderer): 2 materials (Salt_Hair,Salt_Hair_FakeShadow);1 sub-mesh
- Hair_Base(skinned mesh renderer): 1 materials (Salt_Hair)
Steps to reproduce
This is how I did this:
- I got the Salt_v1.01 avatar by komado from BOOTH (https://komado.booth.pm/items/8962830).
- I created a new VRChat SDK 3.10.6 project with d4rkAvatarOptimizer v4.7.2 and other avatar dependencies added from ALCOM.
- I added the Salt prefab to the scene. I deleted anything but Armature,Base,Hair,Hair_Basegameobjects.Hairwill have two materials (Salt_Hair,Salt_Hair_FakeShadow; 1 submesh),Hair_Basehas one material shared (Salt_Hair) shared withHairgameobject.
- (Optional, not required) I added d4rkAvatarOptimizer component to the avatar (as a gameobject or on the avatar root), basic/standard optimizations with "Delete Unused GameObjects" checked.
- Build & Test.
- Build & Publish (upload).
- Compare the avatar performance details of the uploaded avatar and the SDK test avatar in the VRChat client (Build 1939).
Expected result
SDK & local SDK test avatar should report 5 material slots in the VRChat client. The uploaded avatar should report 5 material slots too.
Actual result
SDK & local SDK test avatar both report 4 material slots;
missing one material slot
. The uploaded avatar reports 5 material slots.Additional information
d4rkAvatarOptimizer is not required to reproduce this bug. It should be reproducible with VRChat SDK 3.10.6 and the current live branch VRChat 2026.4.1 (Build
1939
) client alone.I have confirmed the issue is not with the material shaders used.
The default Salt avatar base FBX does not setup a 2nd material slot on the
Hair
renderer by default, this extra material slot was added to the prefab by the creator of the base for a lilToon fake shadow.Related d4rkAvatarOptimizer v4.6.0 change: https://github.com/d4rkc0d3r/d4rkAvatarOptimizer/pull/194
Related d4rkAvatarOptimizer changelog: https://github.com/d4rkc0d3r/d4rkAvatarOptimizer/blob/main/CHANGELOG.md#v460
I can provide private avatar IDs for minimal repro avatar versions on request, if specified which version(s).
VRChat SDK - Avatars 3.10.6. d4rkAvatarOptimizer versions
4.5.4
, 4.6.0
and 4.7.2
(latest). The latter two d4rkAvatarOptimizer versions share the same behavior. VRChat 2026.4.1 Build 1939
on Windows.Photo Viewer
View photos in a modal
Log In
WubTheCaptain
Play Mode illustration. Notice the 5 material slots with 4 unique materials. This is still reported as 4 materials in the VRChat client when built locally.
Photo Viewer
View photos in a modal
WubTheCaptain
Even with those 5 materials slots (4 unique materials) set in the avatar, the SDK reports 4 material slots.
Photo Viewer
View photos in a modal