-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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: Glow not working in 2D due to 2D rendering being in LDR #62110
Comments
2D rendering in 4.0 is always done in LDR space to improve performance (when HDR isn't needed), so you need to set Bloom above 0.0 to see any effect. Adding an option to render 2D in HDR requires a lot of work, so this will only be tackled after 4.0. |
Huh, that's pretty interesting. It seems like bumping up the bloom level isn't doing anything, though. Did you get the glow to work by bumping the bloom value up? |
@MyStarrySpace > Huh, that's pretty interesting. It seems like bumping up the bloom level isn't doing anything, though. Did you get the glow to work by bumping the bloom value up? Does not work for me, but i saw @Calinou mentioning rendering 2d in hdr is not available yet |
It works if you decrease Glow > HDR Threshold below 0.0 (try 0.1) or increase Bloom above 0.0. The WorldEnvironment's background mode must also be set to Canvas. godotengine/godot-demo-projects#782 features two demos with working glow in 2D (Glow in 2D and 2D GPUParticles). |
I can confirm the issue is still present in Beta9. @Calinou This is a very severe feature regression compared to Godot3. Neither is raising Bloom above 0.0 nor lowing the Threshold below 1.0 a solution. Both of these affect the whole viewport. Using Glow in 2D in Godot is very often (if not by far the most cases) used deliberately on particular objects in the scene. To deliberately make a 2D object glow, the user would modulate that particular object above the 1.0 threshold. Keeping the Threshold at 1.0 makes a lot of sense if you want to use glow deliberately, because any graphic may be in the 0.0-1.0 range. By modulating only this one graphic (or only a particular part within that graphic using a shader) above the LDR threshold, creates a controlled environment. Solving this at the asset level by making sure not to bring in assets which cross a lower than 1.0 threshold is pretty backwards crazy. You would also cut down dynamic range of your assets this way. Glow is a modern feature almost no modern game can do without in some form or another, be it 2D or 3D. It would be a shame if using Glow in Godot4 would be even more cumbersome and harder to use than it is in Godot3. |
When i do that, the whole color picker glows up like a christmas tree, running beta 10 in linux, have not checked in windows yet, maybe this should be a new bug? |
This is a known issue: #69122 |
This probably deserves a better explanation. What we have as 2D HDR in Godot 3 is not really HDR, as it still mixes color in sRGB space. Of course, this requires a bit more work and it means that, if HDR is enabled, hint_albedo needs to do the proper conversion of textures from sRGB as well as sRGB happening later. Its a good amount of work and we did not make it to 4.0 because there are so many other things that need to be worked on, so it will happen after its released. |
The issue is that the default settings make the effect nearly invisible. While keeping HDR Threshold to 1 (or even increasing it above 1), increase Strength, change the blend mode to Screen or Additive and perhaps play around with the Levels. You'll get something like this: The red sprite on the left is not overbright, but the ones on the right are (to varying degrees). If some objects that shouldn't glow still glow, try further increasing HDR Threshold while increasing Strength to compensate. With careful tweaking, it's possible to get the effect to look very close to how it'd look in 3.x: Testing project: test_glow_2d.zip Edit: It seems that with this approach, fully white objects (e.g. Line2D) still glow. Changing their color to |
@Calinou |
I use Compatibility rendering and I don't seem being able to use glow effect any more. (It used to work quite correctly in Godot 3) |
This is a separate issue: #66455 |
@Calinou in the workaround you posted, when you say something like Also, I'm noticing that objects will stop glowing if you zoom out far enough. At least with a Line2D And finally, there seems to be an HDR threshold upper bound, where no matter how overbright (modulate > than the threshold) a node is set to be, it will not glow. |
Yes, "overbright" refers to a pixel where any its color channels is greater than 1.0 (exclusive).
This is an unrelated issue: #56452
This is because the 2D buffer is LDR as mentioned above. The workaround I mentioned doesn't make the 2D buffer HDR 🙂 For your particular use case, consider using a glow sprite as a child of your laser sprite. This is cheaper and gives you more artistic control over how the glow looks, and it prevents the glow from disappearing or flickering if it doesn't take much space on screen. |
Is there any update on when this will be implemented? Or when it's expected to be? 🤔 |
The Godot team is well aware of this issue, we know it is a priority for many users. We also know that many users are unhappy with the current workarounds in place. Please understand that this issue has taken some time due to the numerous architectural changes in Godot and we want to ensure that Glow in 2D is implemented the right way. Because Godot is developed by a community of volunteers, we can't give an exact time estimate for when this will be added. We also won't promise that it will make it into any specific release. But please know, we are aware of the issue. The only answer we can give is: it will be released when it is ready. That message won't change until a PR is made. To ensure that this message remains visible I will be locking this thread. Once a PR is made, it will be linked to this thread and we will be able to provide a better estimate for which version of the engine it will ship with. |
Just a tiny note: The workarounds do work on my PC when:
They do NOT work:
|
The reason the workaround doesn't work when using Compatibility is that there's no glow implementation there. #80215 will not address this – it should be implemented in a separate pull request.
The web export always uses the Compatibility rendering method, as Vulkan can't run in web browsers. |
Ah! Thank you for the clarification! |
It is planned for a future release, but keep in mind that Compatibility will always render in SDR for performance reasons (also because support for some sRGB/linear formats is spotty on WebGL). This means that when glow is implemented there, it will require you to decrease HDR Threshold below 1.0 to be visible, even in 3D (like you currently need to do with Forward+/Mobile in 2D). Godot 3's GLES3 supported rendering in HDR, but this came at a significant performance and complexity cost. In contrast, Godot 4's Compatibility rendering method targets low-end devices first and foremost, which puts it closer to Godot 3.x GLES2 in terms of intent. However, using GLES3 as a baseline for this low-end renderer allows implementing a lot of features that are not possible when stuck with GLES2. |
is this fixed? Or no .. This doesn't work in 4.1.1 |
This is only supported in 4.2.dev, not 4.1.1. You also need to enable in the project settings as mentioned in #80215. |
Godot version
4.0.dev (alpha 10)
System information
Windows 11 Pro version 10.0.22000 Build 22000, NVIDIA GeForce RTX 2060, Game Ready Driver v511.79, Vulkan
Issue description
The glow feature of WorldEnvironment doesn't work properly in 2D in Godot 4.0. The object itself does get brighter, but it does not emit any bloom
Steps to reproduce
Minimal reproduction project
2d_hdr_demo.zip
The text was updated successfully, but these errors were encountered: