1 /* 2 * Copyright (c) 2024 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_DYNAMIC_ENVIRONMENT_BLENDER_COMPONENT_H) || defined(IMPLEMENT_MANAGER) 17 #define API_3D_ECS_COMPONENTS_DYNAMIC_ENVIRONMENT_BLENDER_COMPONENT_H 18 19 #if !defined(IMPLEMENT_MANAGER) 20 #include <3d/namespace.h> 21 #include <base/containers/vector.h> 22 #include <base/math/vector.h> 23 #include <core/ecs/component_struct_macros.h> 24 #include <core/ecs/entity.h> 25 #include <core/ecs/intf_component_manager.h> 26 27 CORE3D_BEGIN_NAMESPACE() 28 #endif 29 30 BEGIN_COMPONENT(IDynamicEnvironmentBlenderComponentManager, DynamicEnvironmentBlenderComponent) 31 32 /** Entities containing EnvironmentComponents that are pushed to camera buffers and can be blended. 33 * Controls indirect and environment lighting. Currently there is a limit of 4 blend environments. 34 */ 35 DEFINE_PROPERTY(BASE_NS::vector<CORE_NS::Entity>, environments, "Environments", 0,) 36 37 /** Environment blend weights in a Vec4(Vector4). 38 * Each component of the vector decides weight in the total of 100% blend (for example vec4(0.25f, 0.75f, 0, 0) 39 * would result in environment1 having the weight of 25% and environment2 having 75%). 40 */ 41 DEFINE_PROPERTY(BASE_NS::Math::Vec4, entryFactor, "Entry Factor", 0, ARRAY_VALUE(0.0f, 0.0f, 0.0f, 0.0f)) 42 43 /** Environment blend interpolator target values as Vec4. 44 * Each vector4 component acts as a weight (for example entry of 0.25, 0.25, 0.25, 0.25 with switch of 0.9, 0, 0, 0 45 * would make entry of 0.9, 0.033, 0.033, 0.033) 46 * Can also be set as full 100% (The values form full 1.0). 47 * User is responsible for keeping the 100% value (Total not exceeding 100%). 48 */ 49 DEFINE_PROPERTY(BASE_NS::Math::Vec4, switchFactor, "Switch Factor", 0, ARRAY_VALUE(0.0f, 0.0f, 0.0f, 0.0f)) 50 51 END_COMPONENT(IDynamicEnvironmentBlenderComponentManager, DynamicEnvironmentBlenderComponent, 52 "0e1d7883-4609-427e-a05c-9aa7ad42e188") 53 #if !defined(IMPLEMENT_MANAGER) 54 CORE3D_END_NAMESPACE() 55 #endif 56 57 #endif 58