Skip to content

Proposed RFC Feature : Bloom Mask #125

Open
@SZUxiegumeng

Description

Summary:

This proposal outlines an extended ability to control the bloom effect on an object-by-object basis in StandardPBR materialtype.

What is the relevance of this feature?

Why is this important? What are the use cases? What will it do once completed?

Feature design description:

This design is mainly divided into two parts: bloom pass and wind bloomMask implementation in StandardPBR materialtype.

Design of the bloom pass:

I added two subpasses to the bloom pass to generate the mask texture and blend the scene colors. And bloomMask Pass outputs the mask texture in response to the BloomMask attribute in MaterialSrg.

image

Design of the bloomMask for bloom in StandardPBR materialtype:

This attribute is a floating-point value that enhances/degrades its own bloom effect.
image

Other settings

Added global switches and material lua scripts to optimize performance.

  • I added a global switch to control the on/off of the extended feature.

image

  • When the bloomMask value of the material is 0, the bloomMask shader is disabled.

Result

bloomMask_RFC

Technical design description:

One of the important things is the modification of bloompass.

             {
                 "Name": "BloomMaskPass",
                "TemplateName": "BloomMaskPassTemplate",
                "Connections": [
                    {
                        "LocalSlot": "InputColor",
                        "AttachmentRef": {
                            "Pass": "Parent",
                            "Attachment": "InputOutput"
                        }
                    }
                ]
            }

            {
                "Name": "BloomMaskBlendPass",
                "TemplateName": "BloomMaskBlendPassTemplate",
                "Connections": [
                    {
                        "LocalSlot": "InputColor",
                        "AttachmentRef": {
                            "Pass": "Parent",
                            "Attachment": "InputOutput"
                        }
                    }

                    {
                        "LocalSlot": "InputMask",
                        "AttachmentRef": {
                            "Pass": "BloomMaskPass",
                            "Attachment": "OutputEntityMask"
                        }
                    }
                ]
            }

            {
                "Name": "BloomDownsamplePass",
                "TemplateName": "BloomDownsamplePassTemplate",
                "Connections": [
                    {
                        "LocalSlot": "Input",
                        "AttachmentRef": {
                            "Pass": "BloomMaskBlendPass",
                            "Attachment": "OutputColor"
                        }
                    }
                ]
            }

Since most objects don't use this feature, you can turn off their shader.

image

What are the advantages of the feature?

Precise control of bloom effects on an object-by-object basis
In addition, we can enable or disable this feature conveniently without causing other impacts..

What are the disadvantages of the feature?

This feature adds some performance and memory overhead.

How will users learn this feature?

users only need to add the Bloom component and adjust the bloomMask attribute of the material panel.

Are there any open questions?

  • An extra texture is output in the pipeline. Currently, this feature uses only one channel to implement the ability. There should be more post-processing feature to use this texture to achieve precise effect control on an object-by-object basis.
  • The reason why the output is not in standard forwardPs is that the extension function is small and special. Isolate this code as a separate design for post-processing.

Metadata

Assignees

No one assigned

    Labels

    rfc-featureRequest for Comments for a Feature

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions