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

Changing horizon or top color of Procedural Sky causes lag spikes #54397

Open
Miziziziz opened this issue Oct 29, 2021 · 2 comments
Open

Changing horizon or top color of Procedural Sky causes lag spikes #54397

Miziziziz opened this issue Oct 29, 2021 · 2 comments

Comments

@Miziziziz
Copy link

Godot version

3.3.mono.stable and v3.4.rc2.mono.official

System information

Windows 10

Issue description

If you try modifying the horizon or top color of a ProceduralSky in a WorldEnvironment node you get random lag spikes. This happens both when modifying through scripts and animations. I would expect this to not cause issues as I want to change sky color for weather effects or day/night cycles

Steps to reproduce

create a scene with a WorldEnvironment and a ProceduralSky, then have a script that runs this code:

func _process(delta):
	$WorldEnvironment.environment.background_sky.sky_horizon_color = Color.white

run the profiler and you'll see lag spikes

Minimal reproduction project

AnimatedSkyLagTest.zip

@Calinou
Copy link
Member

Calinou commented Oct 29, 2021

This is expected in 3.x, since the radiance map needs to be regenerated every time a sky property is changed. In 4.0, you can set the sky update mode to Real-Time which makes changes apply much faster.

In the meantime, you can add a MeshInstance with a large SphereMesh that's parented to the camera. The sphere's size should be slightly smaller than your camera's Far distance.
Add a material with the cull mode set to Front, and texture it accordingly. This sphere won't be reflected in the radiance map, but you'll be able to rotate the mesh and update its texture at no cost.

@clayjohn Should we add a boolean property to temporarily freeze radiance map updates in 3.x? This would let people update the sky in a smoother fashion, at the cost of reflections being incorrect until you unfreeze the radiance map updates.

@Zireael07
Copy link
Contributor

@Calinou: Nice trick, can it get documented somewhere?

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

3 participants