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: WorldEnvironment Glow effect's size is resolution-dependent #54518

Open
Calinou opened this issue Nov 2, 2021 · 3 comments
Open

Vulkan: WorldEnvironment Glow effect's size is resolution-dependent #54518

Calinou opened this issue Nov 2, 2021 · 3 comments

Comments

@Calinou
Copy link
Member

Calinou commented Nov 2, 2021

Related to #56911.

Godot version

4.0.dev (fe6c65a)
Still reproducible as of 4.0.dev (ce6de71)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 470.74)

Issue description

The glow effect's size is resolution-dependent. This means the glow effect will appear to be larger as the rendering resolution decreases.

This means the rendering will change in unintended ways depending on the user's monitor resolution. Also, if we implement dynamic resolution scaling and FSR in the future, we need to make sure every effect is as a resolution-independent as possible.

glow-resolution-dependent.mp4

Steps to reproduce

  • Enable Glow in WorldEnvironment.
  • Create a MeshInstance with a SphereMesh.
  • Add a StandardMaterial3D on the SphereMesh, with a bright albedo and/or emission value (to make glow kick in).
  • Decrease the 3D resolution scale factor at run-time using get_viewport().scale_3d -= 0.1.

Minimal reproduction project

https://github.com/Calinou/test_fxaa_supersample_master
Press the Up / Down arrow keys to adjust the 3D rendering scale. When doing so, watch the glow effect on the floor become larger as the resolution decreases.

@Calinou Calinou added this to the 4.0 milestone Nov 2, 2021
@Calinou Calinou changed the title Vulkan: Glow effect's size is resolution-dependent Vulkan: WorldEnvironment Glow effect's size is resolution-dependent Nov 2, 2021
@Calinou
Copy link
Member Author

Calinou commented Nov 15, 2021

On Reddit, someone reported a similar issue on master but with the opposite happening. The glow effect became weaker at lower resolutions (possibly because bright details were too small to be represented in the mipmaps)? https://www.reddit.com/r/godot/comments/qucc6i/glow_weakening_at_lower_resolutions_my_mistake_or/

Edit: The issue reported on Reddit was likely similar to #56452, not this one.

@ghost
Copy link

ghost commented Jan 25, 2022

I managed to ameliorate the issue a bit by sliding the glow levels around.
The results are okay if the scaling is a power of 2 (0.5, 2, ...) but kind of iffy in-between.
Also, it doesn't work that well if the user uses the outer glow levels.
Also, I used a hardcoded reference resolution of 1920x1080.

demo-.6.mp4

The depth of field effect is stable throughout the scaling range though, so maybe it is possible to reimplement the glow shader in a similar fashion.

Anyway, I pushed the changes to a branch if anybody wants to have a look.

@Calinou
Copy link
Member Author

Calinou commented Jan 25, 2022

@ceLoFaN This looks pretty good, especially for depth of field – feel free to open pull requests for this 🙂

Since the changes can be reviewed independently, I would recommend opening two separate pull requests – one for glow, one for depth of field.

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

2 participants