It would seem that updating a material does not update the associated platform stats in a material instance editor, only the parameters.
Can workaround by manually invoking shader compile in the material instance editor.
It is expected that the material instance stats updates when the base material is changed.
I made a local testing change in MaterialInstanceEditor.cpp, in void FMaterialInstanceEditor::RebuildMaterialInstanceEditor() that adds NotifyExternalMaterialChange() to the function, which triggers instance compilation when base material is changed. While this does address this specific repro, I'm not sure this entirely the best possible fix for this solution, since I'm not very familiar with this area of engine code.
Would someone be able to suggest a better fix?
void FMaterialInstanceEditor::RebuildMaterialInstanceEditor() { if( MaterialEditorInstance ) { ReInitMaterialFunctionProxies(); MaterialEditorInstance->CopyBasePropertiesFromParent(); MaterialEditorInstance->RegenerateArrays(); RebuildInheritanceList(); // Required b/c recompiled parent materials result in invalid weak object pointers UpdatePropertyWindow(); NotifyExternalMaterialChange(); // Add this line here } }
Steps to Reproduce
1. In 5.4 editor, make a material with some test nodes eg. VectorNoise gated behind a static switch.
2. Use Window --> Platform Stats to show stats such as instruction count
3. Make a material instance of the material and open it in editor. Open Window --> Platform Stats as well in the instance editor.
4. Note flipping the static switch in the instance DOES update Platform Stats in the instance editor, since it triggers shader recompilation
5. Twiddle the original base material's bp graph, Save or Apply.
6. Note the material's Platform Stats updates, since shader compilation in the base material is triggered
7. Note the material instance's Platform Stats does NOT update since it does not trigger compilation in the instance PreviewMaterial.
8. Flipping the static switch in the instance editor does now update the platform stats since
I am not able to find world outliner how to enable it?
What method is used to fill polygonal regions when drawing spline mesh at run time?
How does TextureRenderTarget2D get TArray<uint8> type data?
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
How can i modify the param name in EQS node
What properties of the progress bar can be used for drag and drop highlighting?
What property of the Slider is the image used when dragging?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-231474 in the post.
0 |
Component | UE - Rendering Architecture - Materials |
---|---|
Affects Versions | 5.4 |
Target Fix | 5.6 |
Created | Nov 26, 2024 |
---|---|
Updated | Nov 27, 2024 |