Search Issue Tracker
Feature Request
Votes
0
Found in
2021.3.27f1
2022.3.2f1
2023.1.0f1
2023.2.0a20
Issue ID
UUM-40246
Regression
No
VertexAttributeFormat changes are overridden when importing a skinned mesh
Reproduction steps:
1. Open the “MeshAttribs” project
2. In Project Browser expand the “unit_orc“ asset
3. Select the “unit_orc (Mesh)” subasset
4. In Inspector observe the Normal and Tangent values
Expected result: Both are “Float16 x 4 (8 bytes)”
Actual result: Normal is “Float32 x 3 (12 bytes)“, Tangent is “Float32 x 4 (16 bytes)“
Reproduced in: 2021.3.27f1, 2022.3.2f1, 2023.1.0f1, 2023.2.0a20
Reproduced using: Windows 10, macOS 13.4 (Intel)
Note: The reporter is trying to optimize the mesh vertex buffer formats by using “Float16 x 4” for normals and tangents. They do so with SetVertexBufferParams in an AssetPostprocessor using OnPostprocessModel. This works as expected for non-skinned meshes. But when importing a skinned mesh, the normal format gets reset to “Float32 x 3” and the tangent format to “Float32 x 4”. Not reproduced when “FBX Import Settings > Rig > Animation Type” is set to None. Calling UploadMeshData after SetVertexBufferParams also resets the format. Calling GetVertexAttributes after UploadMeshData shows the reset Normal and Tangent format
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Select” windows are named differently on Windows and macOS
- [Windows] No minimum “Select” window size
- Enabling “Editor Extension Authoring” in UI Builder doesn’t dirty the document and saving with shortcut doesn’t persist the state
- WebRequest.Create() function fails with "URI prefix is not recognized" errors when the project is built for Linux Standalone or Windows Dedicated Server
- “GUIStyle” and “NullReferenceException” errors thrown in the Console when opening Object Field during script compilation
Resolution Note:
This is a feature request to have more flexibility around vertex attributes and skinning.
When blend weights and/or blend indices are present in the vertex streams Unity enforces a strict layout. This enforced layout firstly, enforces the division of attributes in certain streams. Secondly, it enforces specific format and dimension. For normals this means 3 components in float32. For tangents this is 4 components in float32.
This is described in part here (https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.VertexAttributeDescriptor.html). I have added a ticket to the backlog to update documentation in order to call out the latter detail more explicitly.
In this case it is observed that the issue does not reproduce when “FBX Import Settings > Rig > Animation Type” is set to None. This is because when the option is set to None blend weights and indices are not added to the vertex stream. As a result the layout for skinning is not enforced.