Search Issue Tracker

Fixed in 2019.3.X

Votes

1

Found in

2017.1.1p2

Issue ID

962277

Regression

No

'Optimize Mesh Data' does not consider materials assigned by scenes when deciding whether to remove vertex color data

Graphics - General

-

Repro:
Phase 1 (demonstration of expected behavior)
1. Open the attached repro project.
2. Switch to PC/Mac/Linux standalone
3. Open the scene "SceneBundle/RainbowScene" and enter play mode in the editor.
4. You should notice that the ends of the rainbow fade out. This is done using vertex alpha in the FBX itself.

Phase 2 (demonstration of the problem)
5. Click the menu item "Build/Build Asset Bundles".
6. Switch to the "Loader" scene and enter play mode. This will use the assets in the bundles instead.
7. You should notice that the ends of the rainbow do not fade out. This is because the vertex alpha has been removed by the 'Optimize Mesh Data' player setting.
8. If you examine the FBX, you'll see that it has a default material with a default shader "Standard" selected, which does not apparently use vertex color data.
9. If you examine the FBX instance in RainbowScene, it has overridden its material and is using a different shader "StoryVille/AdditiveUIShine" which uses vertex color data.

Phase 3 (demonstration of workarounds)
10. Open "SceneBundle/RainbowScene" again.
11. Find "Map_Rainbow_01" in the scene and drag it anywhere inside the AssetBundle folder to create a prefab there.
12. Redo steps 5 and 6. You'll notice that the rainbow fades at the ends properly now.
13. Apparently, the existence of the prefab in the project is used at build time to inform the 'Optimize Mesh Data' process that the vertex colors are required, preventing them from being removed.

Expected: The FBX instance inside RainbowScene with its scene-overridden material should also inform 'Optimize Mesh Data' that vertex colors are required.

Reproduced in 2017.1.1p2, 2017.3.0b6, 2018.1.0a1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.