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

Vulkan Static reflections from dynamic shader sky (ViewportTexture) #68302

Open
RicardRC opened this issue Nov 5, 2022 · 3 comments
Open

Vulkan Static reflections from dynamic shader sky (ViewportTexture) #68302

RicardRC opened this issue Nov 5, 2022 · 3 comments

Comments

@RicardRC
Copy link
Contributor

RicardRC commented Nov 5, 2022

Godot version

master (6882890)

System information

Windows 10 and Linux

Issue description

I expect reflections from sky to change when the sky changes.

Steps to reproduce

Open project and observe that the background is dynamic but the reflections are static

Minimal reproduction project

ViewportBug.zip

@clayjohn
Copy link
Member

clayjohn commented Nov 5, 2022

I can reproduce the issue. It looks like the "background" viewports are updated appropriately each frame, but the sky is not updating the radiance map as it doesn't detect that there has been a change.

We will need to add some logic to the sky setup function to detect if it is using ViewportTextures and if so, to update the sky everytime the ViewportTexture changes.

In the meantime, as a workaround, you can force the sky to update every frame by adding + 0.0 * TIME at the end of one of the lines in the shader. While this is a total hack, it works and won't hurt the shader.

@clayjohn clayjohn added this to the 4.x milestone Nov 5, 2022
@Calinou Calinou changed the title Static reflections from dynamic shader sky VulkanStatic reflections from dynamic shader sky (ViewportTexture) Nov 5, 2022
@RicardRC RicardRC changed the title VulkanStatic reflections from dynamic shader sky (ViewportTexture) Vulkan Static reflections from dynamic shader sky (ViewportTexture) Nov 6, 2022
@clayjohn
Copy link
Member

Those issues aren't really related. In all three of those cases the issue is that the texture atlas is not updated when the Viewport is updated. This issue here is specific to skies and it happens because the radiance map itself is not redrawn each frame when a viewport is used as a texture in the sky's shader and that viewport is updated every frame.

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