@@ -88,9 +88,9 @@ Camera attributes
8888 adjusting those properties independently of other Environment settings more
8989 easily.
9090
91- The :ref: `class_CameraAttributes ` resource stores exposure and depth of field information. It
92- also allows enabling automatic exposure adjustments depending on scene
93- brightness.
91+ The :ref: `class_CameraAttributes ` resource stores exposure and depth of field
92+ information. It also allows enabling automatic exposure adjustments depending on
93+ scene brightness.
9494
9595There are two kinds of CameraAttribute resources available:
9696
@@ -152,7 +152,9 @@ There are several background modes available:
152152- **Sky ** lets you define a background sky material (see below). By default,
153153 objects in the scene will reflect this sky material and absorb ambient light
154154 from it.
155- - **Canvas ** displays the 2D scene as a background to the 3D scene.
155+ - **Canvas ** displays the 2D scene as a background to the 3D scene. This can be used
156+ to make environment effects visible on 2D rendering, such as
157+ :ref: `glow in 2D <doc_environment_and_post_processing_using_glow_in_2d >`.
156158- **Keep ** does not draw any sky, keeping what was present on previous frames
157159 instead. This improves performance in purely indoor scenes, but creates a
158160 "hall of mirrors" visual glitch if the sky is visible at any time.
@@ -542,6 +544,9 @@ illumination for off-screen elements (unlike :abbr:`SSIL (Screen-Space Indirect
542544Glow
543545^^^^
544546
547+ *This feature is only available when using the Forward+ and Mobile backends, not
548+ Compatibility. *
549+
545550In photography and film, when light amount exceeds the maximum *luminance *
546551(brightness) supported by the media, it generally bleeds outwards to darker
547552regions of the image. This is simulated in Godot with the **Glow ** effect.
@@ -584,8 +589,9 @@ The **Blend Mode** of the effect can also be changed:
584589 an all around.
585590- **Softlight ** is the default and weakest one, producing only a subtle color
586591 disturbance around the objects. This mode works best on dark scenes.
587- - **Replace ** can be used to blur the whole screen or debug the effect. It only
588- shows the glow effect without the image below.
592+ - **Replace ** can be used to
593+ :ref: `blur the whole screen <doc_environment_and_post_processing_using_glow_to_blur_the_screen >`
594+ or debug the effect. It only shows the glow effect without the image below.
589595- **Mix ** mixes the glow effect with the main image. This can be used for
590596 greater artistic control. The mix factor is controlled by the **Mix ** property
591597 which appears above the blend mode (only when the blend mode is set to Mix).
@@ -617,11 +623,68 @@ There are 2 main use cases for a glow map texture:
617623
618624.. image :: img/environment_glow_map.webp
619625
620- .. note ::
626+ .. _doc_environment_and_post_processing_using_glow_in_2d :
627+
628+ Using glow in 2D
629+ ^^^^^^^^^^^^^^^^
630+
631+ There are 2 ways to use glow in 2D:
632+
633+ - Since Godot 4.2, you can enable HDR for 2D rendering when using the Forward+
634+ and Mobile rendering methods. This has a performance cost, but it allows for a
635+ greater dynamic range. This also allows you to control which objects glow
636+ using their individual **Modulate ** or **Self Modulate ** properties (use the
637+ RAW mode in the color picker). Enabling HDR can also reduce banding in the 2D
638+ rendering output.
639+
640+ - To enable HDR in 2D, open the Project Settings, enable
641+ **Rendering > Viewport > HDR 2D ** then restart the editor.
642+
643+ - If you want to maximize performance, you can leave HDR disabled for 2D
644+ rendering. However, you will have less control on which objects glow.
645+
646+ - Enable glow, set the environment background mode to **Canvas ** then decrease
647+ **Glow HDR Threshold ** so that pixels that are not overbright will still
648+ glow. To prevent UI elements from glowing, make them children of a
649+ :ref: `class_CanvasLayer ` node. You can control which layers are affected by
650+ glow using the **Background > Canvas Max Layer ** property of the Environment
651+ resource.
652+
653+ .. figure :: img/environment_and_post_processing_glow_in_2d.webp
654+ :align: center
655+ :alt: Example of using glow in a 2D scene
621656
622- Glow can be used in 2D as well. To do so, set the environment background
623- mode to **Canvas ** then enable glow as usual. You may have to decrease
624- **Glow HDR Threshold ** to see a difference.
657+ Example of using glow in a 2D scene. HDR 2D is enabled, while coins and the
658+ bullet have their **Modulate ** property increased to overbright values using the
659+ RAW mode in the color picker.
660+
661+ .. _doc_environment_and_post_processing_using_glow_to_blur_the_screen :
662+
663+ Using glow to blur the screen
664+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
665+
666+ Glow can be used to blur the whole viewport, which is useful for background blur
667+ when a menu is open. Only 3D rendering will be affected unless the environment's
668+ background mode is set to **Canvas **. To prevent UI elements from being blurred
669+ when using the Canvas background mode, make them children of a :ref: `class_CanvasLayer `
670+ node. You can control which layers are affected by this blurring effect using the
671+ **Background > Canvas Max Layer ** property of the Environment resource.
672+
673+ To use glow as a blurring solution:
674+
675+ - Enable **Normalized ** and adjust levels according to preference. Increasing
676+ higher level indices will result in a more blurred image. It's recommended to
677+ leave a single glow level at ``1.0 `` and leave all other glow levels at
678+ ``0.0 ``, but this is not required. Note that the final appearance will vary
679+ depending on viewport resolution.
680+ - Set **Intensity ** to ``1.0 `` and **Bloom ** to ``1.0 ``.
681+ - Set the blend mode to **Replace ** and **HDR Luminance Cap ** to ``1.0 ``.
682+
683+ .. figure :: img/environment_and_post_processing_glow_blur.webp
684+ :align: center
685+ :alt: Example of using glow to blur the 2D rendering in the menu's background
686+
687+ Example of using glow to blur the 2D rendering in the menu's background
625688
626689Adjustments
627690^^^^^^^^^^^
@@ -715,7 +778,8 @@ a given range. It has an initial **Distance** with a **Transition** region
715778.. image :: img/environment_dof_far.webp
716779
717780The **Amount ** parameter controls the amount of blur. For larger blurs, tweaking
718- the **Quality ** may be needed in order to avoid artifacts.
781+ the depth of field quality in the advanced project settings may be needed to
782+ avoid artifacts.
719783
720784Depth of Field / Near Blur
721785^^^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments