• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #if !defined(API_3D_ECS_COMPONENTS_POST_PROCESS_COMPONENT_H) || defined(IMPLEMENT_MANAGER)
17 #define API_3D_ECS_COMPONENTS_POST_PROCESS_COMPONENT_H
18 
19 #if !defined(IMPLEMENT_MANAGER)
20 #include <3d/namespace.h>
21 #include <core/ecs/component_struct_macros.h>
22 #include <core/ecs/intf_component_manager.h>
23 #include <render/datastore/render_data_store_render_pods.h>
24 
25 CORE3D_BEGIN_NAMESPACE()
26 #endif
27 
28 /** Post-process component that can be used with cameras.
29  * Uses the core configuration of PostProcessConfiguration, expect fog control not used/implemented.
30  */
31 BEGIN_COMPONENT(IPostProcessComponentManager, PostProcessComponent)
32 #if !defined(IMPLEMENT_MANAGER)
33     enum FlagBits : uint32_t {
34         TONEMAP_BIT = (1 << 0),
35         VIGNETTE_BIT = (1 << 1),
36         DITHER_BIT = (1 << 2),
37         COLOR_CONVERSION_BIT = (1 << 3),
38         COLOR_FRINGE_BIT = (1 << 4),
39         BLUR_BIT = (1 << 8),
40         BLOOM_BIT = (1 << 9),
41         FXAA_BIT = (1 << 10),
42         TAA_BIT = (1 << 11),
43         DOF_BIT = (1 << 12),
44         MOTION_BLUR_BIT = (1 << 13),
45         LENS_FLARE_BIT = (1 << 14),
46     };
47     /** Container for post-processing flag bits */
48     using Flags = uint32_t;
49 #endif
50 
51     /** The type of the background fill when rendering.
52      */
53     DEFINE_BITFIELD_PROPERTY(
54         Flags, enableFlags, "Enabled Effects", PropertyFlags::IS_BITFIELD, VALUE(0), PostProcessComponent::FlagBits)
55 
56     /** Tonemap configuration.
57      */
58     DEFINE_PROPERTY(RENDER_NS::TonemapConfiguration, tonemapConfiguration, "Tonemap Configuration", 0, ARRAY_VALUE())
59 
60     /** Bloom configuration.
61      */
62     DEFINE_PROPERTY(RENDER_NS::BloomConfiguration, bloomConfiguration, "Bloom Configuration", 0, ARRAY_VALUE())
63 
64     /** Vignette configuration.
65      */
66     DEFINE_PROPERTY(RENDER_NS::VignetteConfiguration, vignetteConfiguration, "Vignette Configuration", 0, ARRAY_VALUE())
67 
68     /** Color fringe configuration.
69      */
70     DEFINE_PROPERTY(
71         RENDER_NS::ColorFringeConfiguration, colorFringeConfiguration, "Color Fringe Configuration", 0, ARRAY_VALUE())
72 
73     /** Dither configuration.
74      */
75     DEFINE_PROPERTY(RENDER_NS::DitherConfiguration, ditherConfiguration, "Dither Configuration", 0, ARRAY_VALUE())
76 
77     /** Blur configuration.
78      */
79     DEFINE_PROPERTY(RENDER_NS::BlurConfiguration, blurConfiguration, "Target Blur Configuration", 0, ARRAY_VALUE())
80 
81     /** Color conversion configuration.
82      */
83     DEFINE_PROPERTY(RENDER_NS::ColorConversionConfiguration, colorConversionConfiguration,
84         "Color Conversion Configuration", 0, ARRAY_VALUE())
85 
86     /** FX anti-aliasing configuration.
87      */
88     DEFINE_PROPERTY(RENDER_NS::FxaaConfiguration, fxaaConfiguration, "Fast Approximate Anti-Aliasing Configuration", 0,
89         ARRAY_VALUE())
90 
91     /** Temporal anti-aliasing configuration.
92      */
93     DEFINE_PROPERTY(
94         RENDER_NS::TaaConfiguration, taaConfiguration, "Temporal Anti-Aliasing Configuration", 0, ARRAY_VALUE())
95 
96     /** Depth of field configuration.
97      */
98     DEFINE_PROPERTY(RENDER_NS::DofConfiguration, dofConfiguration, "Depth Of Field Configuration", 0, ARRAY_VALUE())
99 
100     /** Motion blur configuration.
101      */
102     DEFINE_PROPERTY(
103         RENDER_NS::MotionBlurConfiguration, motionBlurConfiguration, "Motion Blur Configuration", 0, ARRAY_VALUE())
104 
105     /** Lens flare configuration.
106      */
107     DEFINE_PROPERTY(
108         RENDER_NS::LensFlareConfiguration, lensFlareConfiguration, "Lens Flare Configuration", 0, ARRAY_VALUE())
109 
110 END_COMPONENT(IPostProcessComponentManager, PostProcessComponent, "a2c647e7-9c66-4565-af3b-3acc75b3718f")
111 #if !defined(IMPLEMENT_MANAGER)
112 CORE3D_END_NAMESPACE()
113 #endif
114 #endif
115