The same performance with different custom shading models

I need to measure performance of 4 shading models - Default Lit and 3 custom models (first is similar to Default Lit and third is Blinn-Phong). I created them modyfing UE 4.22.3 source code (cpp and shaders).

I’ve created a scene that contains over 8k spheres (positioned like a cube). All of them have one material that I change its shading model when I want to test the next model.

Currently, I’m measuring performance by computing the avg delta time of last 100 frames (in Tick function of C++ class). Then I print it to Output Log. Unfortunetely, I couldn’t see any difference in those times.

I tried to turn off some optimizations (like Static Lighting uses or I switched those spheres from static to movable). Then I enabled forward rendering. Now I can see in Stats window that:

  • Default Lit costs 613 instructions,
  • 1st custom model costs 625 instructions,
  • 2nd custom model costs 624 instructions,
  • 3rd custom model (Blinn-Phong) costs 532 instructions.

Yet, I still can’t see any difference in performance.

Does anyone have an idea what I can do to make those differences noticeable?

For shader instruction count to matter, you have to be pixel fill rate limited.
To be pixel fill rate limited, you have to use a slow graphics card, and a large window.
Plug in an 8k monitor and turn up 8x FSAA. Run on a GTX 1030.
Also, turn off vertical sync, if that’s currently on, and make sure you have a fast enough CPU to feed your GPU.

Also note that Unreal will be doing a lot of additional work per pixel in those shader instruction counts – Blinn and Phong are nowhere near 500 instructions in complexity. If you actually want to measure those algorithms, outside of all the extra work Unreal does, then you’ll probably want to write a custom program.

It worked!

I switched to my integrated GPU and set those setting just how you advised. I’m using 2k monitor so I stayed with it (I don’t have access to any other with higher resolution). I could finally see the difference (small but it’s enough).

Thank you again!