Precompiling materials/shaders #2710
Eideren
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This class forces all materials contained in a build to compile at once instead of doing so in the middle of gameplay whenever they are on screen.
ShaderPrecompiler.zip
Here's how you set it up:
The last step is essential to get right, if you haven't set it up correctly you would just be wasting your time
Those instructions are also included at the top of the source file in case you might need them.
Increasing the amount for those variables quickly creates too many permutations to compile, keep them to a strict minimum, you can always run this again with different settings if you intend to let the user change graphics settings
Do note that this class doesn't help in pre-compiling materials/shaders you build at runtime, you can either generate them as assets in the editor, or build them at runtime right before running this component and save them to the content manager/file provider
Here's the default UI it builds and shows in game while compiling:

It looks awful, feel free to customize it however you might need by editing the source file above.
And the editor-side configuration:

Haven't tested skinned models yet, let me know if they need to be included in the tool as well.
Beta Was this translation helpful? Give feedback.
All reactions