Search Issue Tracker
Fixed in 5.5.0f3
Votes
0
Found in
5.3.5f1
Issue ID
819900
Regression
No
Shader keyword is not serialized in the material file
How to reproduce:
1. Open case_819900-Shaders.zip
2. Open scene "1"
3. Drag and drop "ToggleTest" shader on material "Test1"
4. Select "Custom/ToggleTest" shader from drop down menu for material "Test2"
Expected behaviour: both materials look identical, since the same shader is used.
Actual behaviour: materials look different.
Note: Set 'Force Text' through 'Edit->Project Settings->Editor' and check the material file with text editor.
'm_ShaderKeywords:' line will differ between the two materials.
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
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts with meta files from previous Editor versions
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
chyrho
Jan 30, 2018 20:35
I examined the source code of the standard shaders in 5.6.1 and realized that those two missing keywords are probably no longer required as they are now always active, according to the shader script.
#pragma shader_feature _NORMALMAP
...
#pragma shader_feature _METALLICGLOSSMAP
So my problem is NOT really about missing keywords. Instead something else happened and caused Unity to disregard the normal map and metallic map I assigned to the material.
Sorry about the confusion.
chyrho
Jan 30, 2018 19:56
Forgot to mention the Unity versions I tried that showed the symptom: 5.6.1f3, 2017.3.0f3.
chyrho
Jan 30, 2018 19:54
I'm still seeing something similar in loosing shader keywords after re-saving the material. The ones I lost are from two of UMA's Diffuse/Normal/Metallic materials which use the standard shader.
Diff in changes:
- m_ShaderKeywords: _ALPHATEST_ON _EMISSION _METALLICGLOSSMAP _NORMALMAP
+ m_ShaderKeywords: _ALPHATEST_ON _EMISSION