1 #ifndef DALI_SCENE_LOADER_ENVIRONMENT_DEFINITION_H
2 #define DALI_SCENE_LOADER_ENVIRONMENT_DEFINITION_H
4 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #include "dali-scene-loader/public-api/api.h"
22 #include "dali-scene-loader/public-api/ktx-loader.h"
25 #include "dali/public-api/rendering/texture.h"
26 #include "dali/public-api/math/quaternion.h"
34 * @brief Defines an environment map with either or both of radiance
35 * and irradiance maps.
37 struct DALI_SCENE_LOADER_API EnvironmentDefinition
41 Texture mDiffuse; // irradiance
42 Texture mSpecular; // radiance
46 return mDiffuse || mSpecular;
56 using EnvironmentData = std::pair<EnvironmentDefinition, Textures>;
57 using Vector = std::vector<EnvironmentData>;
59 EnvironmentDefinition() = default;
61 EnvironmentDefinition(const EnvironmentDefinition&) = delete;
62 EnvironmentDefinition& operator=(const EnvironmentDefinition&) = delete;
64 EnvironmentDefinition(EnvironmentDefinition&&) = default;
65 EnvironmentDefinition& operator=(EnvironmentDefinition&&) = default;
68 * @brief Loads raw pixel data for the given diffuse and specular maps.
69 * @note This can be done on any thread.
71 RawData LoadRaw(const std::string& environmentsPath) const;
74 * @brief Creates DALi cubemap Textures from the pixel data in @a raw, then
75 * returns them in a Textures object.
76 * @note This must only be called from the event thread.
78 Textures Load(RawData&& raw) const;
81 std::string mDiffuseMapPath;
82 std::string mSpecularMapPath;
83 Quaternion mCubeOrientation = Quaternion::IDENTITY;
84 float mIblIntensity = 1.0f;
90 #endif //DALI_SCENE_LOADER_ENVIRONMENT_DEFINITION_H