If a Material is used with the Foliage Tool the Shader compiles automatically with bUsedWithInstancedStaticMeshes but this is not saved in the Material. Everytime I open the Level in the Editor I get this Message in the Log:
LogMaterial:Warning: Material [MaterialName] needed to have new flag set bUsedWithInstancedStaticMeshes !
LogMaterial: Missing cached shader map for material [MaterialName], compiling.
and the Shader is compiling. To fix this I have to open the Material and compile/save it (The Flag is set there automatically). The Problem with this behavior is that the Shader is missed in packaged builds. The artists doesn’t see the problem because in Editor it looks fine.
The Materials should be marked as edited when the automatic flag is set.
Hey user37337,
I tested your issue in 4.8.1 and was unable to reproduce the missing shader in the packaged build. Have you attempted to go into the Material Editor and manually set the ‘Usage’ for ‘Used with Instance Static Meshes’ and saved out the shader from there?
Thank you,
The Problem only appears when a Material without the Flag is already saved, compiled and not used with foliage. When using this Material later with foliage it sets the flag automatically but not marks the material as changed.
Hey user37337,
After receiving some additional information and investigating further, a bug report was entered pertaining to this issue previously. The bug number associated is UE-17616. Thank you for taking the time to create a new answerhub post and report this issue.
I cannot say when the bug will be integrated as it is still in need of being assessed by the developers, but we ask our users to look to the forums in our Announcements and Releases section for updates to their issues.
Thank you,