Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable shader asynchronous compilation and caching for the editor #3594

Closed
TokisanGames opened this issue Nov 24, 2021 · 2 comments
Closed

Comments

@TokisanGames
Copy link

TokisanGames commented Nov 24, 2021

This fine work from @RandomShaper provides a PR to enable async compilation and caching of some shaders for in-game only for 3.x (merged in 3.5). This discussion is not relevant to 4.0. godotengine/godot#53411

However, it still lags terribly in the editor. While I'm happy that my future game players will no longer suffer during gameplay, I'm still suffering every day during development as my editor lags up to 10-30s at times to compile shaders, every time I open a large scene.

@RandomShaper suggested the choice is not trivial:

Enabling this in the editor involves some design decisions (separate settings for editor and game?, using ubershader is OK since in summer cases it's not 100% equal to the real shader?, maybe it's better to just enable a cache of regular shaders with no async support, or allow async with no ubershader but some placeholder shader?, etc.).
So, while I agree it may be a good thing, it's not trivial. You may want to open a proposal with your choices so a discussion can happen to see what the most wanted behavior is.
(godotengine/godot#53411 (comment))

Since the fix is already in the engine, I suggest it is just enabled in the editor with the identical settings that we've already chosen in the project settings. Or add additional settings, but in general I want to work in the same environment in which the game will be played. The only setting I might want is a single disable shader caching for testing/debugging, and/or force clear the cache.

What other settings or choices might people want other than eliminating all engine lags in-game and in the editor?

@TokisanGames TokisanGames changed the title [3.x] Enable Shader Async Compilation for the editor [3.x] Enable Shader Async Compilation & Caching for the editor Nov 24, 2021
@Calinou Calinou added this to the 3.x milestone Nov 25, 2021
@Fr0sk
Copy link

Fr0sk commented Dec 3, 2021

I think by default the visuals should be identical in-editor and in-game, otherwise it might throw people off of what's happening. I'm ok with the eventual freeze when loading a new material (compiling a new shader), but it should be cached, otherwise simple things like changing between scenes forces the shaders to recompile and in large scenes can take up to minutes... Ideally, a temporary shader could be used while the real one is being compiled (simillar to what Unreal Engine does when you first open a new scene).

@Calinou Calinou changed the title [3.x] Enable Shader Async Compilation & Caching for the editor Enable shader asynchronous compilation and caching for the editor Dec 30, 2021
@akien-mga
Copy link
Member

Closed by godotengine/godot#56366.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants