[Bug?] DX10 shaders take time and have to be compiled everytime

Hi,

I’m running rocket on two different computers and I noticed two different behaviors. I’m comparing this based on the few days I had with my DX11 GPU (before it died).

My two computers are :

  • Desktop : i7 860 @ 2.8 GHz, Win 7 x64, 16gb of ram, ATI HD 4850X2 (previously nVidia GTX 470)

  • Laptop : Core 2 Duo @ 2ghz, Win 7 x64, 4gb of ram, ATI Radeaon HD4670


  • Behavior 1 :
    The Grid material on startup take time to compile (and it never ends) on my laptop. I’m unable to launch the editor. I’m forced to close the command line window to stop rocket (rocket launched with the “-log” command).

  • Behaviors 2 :
    On my desktop computer shaders takes more time to compile that when I was in DX11 (but this fact seems obvious regarding the power of my current GPUs). But this compilation really increase when I add a time node in them, it jump from 10 seconds maximum to 30 seconds or almost 1 minute. I don’t remember in DX11 having to recompile every shader every time I open a material or that I close the material editor (when not changing anything inside it).


The recompile every time is probably the most strange thing. It feels like the editor doesn’t remember that the shader was previously built (maybe the editor is looking for the DX11 version, doesn’t found it, and then recompile the shader even if the DX10 version is already done ?).

Hi Fabrice,

The issues that you are experiencing with your laptop are because it is below the minimum hardware requirements. 2 core processors have to be greater than 2.5GHz ( Intel only Sandy Bridge or newer). That will only bring it up to minimum, which will still be very slow to compile shaders, but it will allow you to launch the editor.

Running in DX10 will be significantly slower to compile shaders and some lighting may appear different. It will also cause the compiling of sub-menu shaders to be slower, making their recompiling more noticeable.

For a better editor experience, consult your Rocket Beta Orientation for the recommended system requirements. If you have any more questions, comments or concerns, please let us know.

Thank you,

Alexander

Is this the right force mode line from the shortcut?
("C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe" -d3d10)
My current 512mb dx10 is very poor(but did quite a lot with Unreal 3!). How long should it take to compile the shaders? Estimate please…
I get a hang at the screen compile shaders. Using almost my full (97%) CPU 2.5ghz duo core. So I shut it down. I just upgraded to a 2GB dx11 but it won’t be in for a few more days…

Is this the right force mode line from the shortcut? ("C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe" -d3d10)

Yes that’s the correct commandline to use if you want to force a DX11 card to render in DX10. If you only have a DX10 card, there’s no need to have this commandline.

How long should it take to compile the shaders? Estimate please… I get a hang at the screen compile shaders.

From running on my old 2 core CPU laptop at home (a while back) - this can last maybe 30 minutes on a below-min-spec system. But I’ll need to verify tonight as that might have been because we didn’t yet ship Samples with precompiled shaders. Ideally, you should never see this process when you start up a project. What you might be seeing is that it’s compiling other engine assets which normally occur very quickly but are lumped into the map load process…which can be very slow on min spec systems. Again, I’ll check this tonight to verify the time it takes and check with engineers that we aren’t trying to compile unneeded assets. Seems to be quite a few complaints about compiling shaders.

I don’t remember in DX11 having to recompile every shader every time I open a material or that I close the material editor (when not changing anything inside it).

I know we have to recompile shaders when materials have been opened up in editor and changed, but don’t think they should recompile if nothing is done. Looping in an engineer to verify.

Thanks for the additional information. I can confirm the recompile every time I open a material or that I assign it to an object (skeletal or static mesh). Same behavior on the build 1711197 (Beta 3).

When you open a material in the material editor we have to compile some shaders in order to provide previews. That is probably what you are seeing.

If you assign a material to a lightmapped static mesh and the material does not have bUsedWithStaticLighting enabled under usage flags the editor will set the flag and recompile shaders for you. Similarly, if you set a material on a skeletal mesh that doesn’t have bUsedWithSkeletalMeshes the editor sets the flag and recompiles shaders for you. Note that if you don’t save the material after the editor has made this change, you’ll have to recompile those shaders again the next time you load the editor!

I also tried dx10 mode and I have very bad experience about it.
It’s almost imposible to work in dx10 editor, so I think it’s necessity is questionable…

I did get it compiled in a timely manner now.
I created a empty project.
Turn off any visuals. You can check how many shaders need recompiling by jumping into the P.I.E…
Go to task manger to check CPU usage for the “Shader Compiler”
Left click and hold the Unreal Editor window. The shader compiler will jump to almost 50% CPU power…if it drops to 0 for some reason again. Close window and restart. The shaders will save where left off!
I’m sure this will be fixed next release!!!

This sounds like a bug where the shader compiler processes are getting starved by the engine. We’ll look in to it.

I thought I would let support know that when the shaders are compiling I can get the “Shader CPU usage” to jump up to 45% on my system by left clicking and holding the Unreal Editor window…k enough posts by me!!

Running in DX10 will be significantly
slower to compile shaders

This isn’t accurate, compiling all DX10 shaders takes about the same amount of time as DX11. Perhaps we don’t ship precompiled DX10 shaders with Rocket right now in which case you have to do a full rebuild the first time you launch the editor or open a new level.