Why is this incredibly basic material showing up as red in “viewmode shadercomplexity” when doing a mobile preview? On PC, it is bright green like the black void you see in the screenshot. I did this test because I’m trying to optimize a scene of mine for mobile in which every single object was either red, pink, or white. Even the most basic materials such as this.
I tested on two new projects with exactly the same results.
No Starter Content
No Starter Content
Once created, I selected Mobile Preview and typed ‘viewmode shadercomplexity’. Everything is red.
I then deleted everything in the scene except the floor, created a new material with a simple uniform color of ‘0.5’ to diffuse, compiled and applied the new material to the floor, rebuilt level, and played game via mobile preview. Same result as my first post.
I didn’t change any project or world settings. Everything is default.
So there are different modes for viewing inside of UE4. These are for development purposes and are meant to troubleshoot/view different aspects of your project.
Shader Complexity Mode is used to visualize the number of shader instructions being used to calculate each pixel of your scene. It is generally a good indication of how performance-friendly your scene will be. In general, it is used to test overall performance for your base scene, as well as to optimize particle effects, which tend to cause performance spikes with a large amount of overdraw for a short period of time.
Only instruction count is used to calculate shader complexity, which may not always be accurate. For example, a shader with 16 instructions, all texture lookups, will be much slower on all platforms than a shader with 16 math instructions. Also shaders which contain loops that are not unrolled will not be represented accurately by the instruction count, this is mainly an issue for vertex shaders. Overall the instruction count is a good metric in the vast majority of cases.
The view mode uses a color spectrum to indicate how expensive the scene is. Green through red represent a linear relationship of “very inexpensive” to “expensive”, while pink and white indicate a large jump to “very expensive” pixels. Small areas of white can be tolerated, but if the majority of your screen is covered in bright red or white, the performance will be poor.
Here is also a link to our wiki with explanations on different view modes: