X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-scene3d%2Finternal%2Fcontrols%2Fscene-view%2Fscene-view-impl.h;h=8b175fe1289bc285ad84b3a4b43f2a81d7f60640;hb=d77ae86eb2508bc80878c5effa07d3bcea73cf10;hp=480ffb014059a269b599eb6e48a531c8f6768f7d;hpb=80a2331cdb57f5398fdfddd12985420287e7844f;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-scene3d/internal/controls/scene-view/scene-view-impl.h b/dali-scene3d/internal/controls/scene-view/scene-view-impl.h index 480ffb0..8b175fe 100644 --- a/dali-scene3d/internal/controls/scene-view/scene-view-impl.h +++ b/dali-scene3d/internal/controls/scene-view/scene-view-impl.h @@ -2,7 +2,7 @@ #define DALI_SCENE3D_INTERNAL_SCENE_VIEW_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,8 @@ #include // INTERNAL INCLUDES -#include +#include +#include #include namespace Dali @@ -96,20 +97,21 @@ public: void SelectCamera(const std::string& name); /** - * @brief Register a Model. - * Some works like ibl setting should be applied on the only Model not the all child actors. - * SceneView contains child Model list to apply the works effectively. + * @brief Register an item. * - * @param[in] model Model to be registered. + * Some works(e.g, lighting) of SceneView should be propagated to the child 3D items. + * SceneView can avoid unnecessary tree traversal to find 3D items by storing only 3D items as a list. + * + * @param[in] item scene observer to be registered. */ - void RegisterModel(Scene3D::Model model); + void RegisterSceneItem(Scene3D::Internal::ImageBasedLightObserver* item); /** - * @brief Unregister a Model + * @brief Unregister an item * - * @param[in] model Model to be unregistered. + * @param[in] item scene observer to be unregistered. */ - void UnregisterModel(Scene3D::Model model); + void UnregisterSceneItem(Scene3D::Internal::ImageBasedLightObserver* item); /** * @copydoc SceneView::SetImageBasedLightSource() @@ -137,11 +139,26 @@ public: bool IsUsingFramebuffer() const; /** + * @copydoc SceneView::SetFramebufferMultiSamplingLevel() + */ + void SetFramebufferMultiSamplingLevel(uint8_t multiSamplingLevel); + + /** + * @copydoc SceneView::GetFramebufferMultiSamplingLevel() + */ + uint8_t GetFramebufferMultiSamplingLevel() const; + + /** * @copydoc SceneView::SetSkybox() */ void SetSkybox(const std::string& skyboxUrl); /** + * @copydoc SceneView::SetSkyboxEnvironmentMapType() + */ + void SetSkyboxEnvironmentMapType(Scene3D::EnvironmentMapType skyboxEnvironmentMapType); + + /** * @copydoc SceneView::SetSkyboxIntensity() */ void SetSkyboxIntensity(float intensity); @@ -236,34 +253,83 @@ private: void OnWindowResized(Window window, Window::WindowSize size); /** - * @brief Update camera's projection orientation according to the screen orientation. + * @brief Updates camera's projection orientation according to the screen orientation. */ void RotateCamera(); + /** + * @brief UpdateSkybox with skybox url and skybox environment map type. + * + * @param[in] skyboxUrl image url for skybox. + * @param[in] skyboxEnvironmentMapType The environment type of skybox. + */ + void UpdateSkybox(const std::string& skyboxUrl, Scene3D::EnvironmentMapType skyboxEnvironmentMapType); + + /** + * @brief Asynchronously skybox loading finished. + */ + void OnSkyboxLoadComplete(); + + /** + * @brief Asynchronously ibl diffusel image loading finished. + */ + void OnIblDiffuseLoadComplete(); + + /** + * @brief Asynchronously ibl specular image loading finished. + */ + void OnIblSpecularLoadComplete(); + + /** + * @brief Asynchronously ibl loading finished. + */ + void OnIblLoadComplete(); + + /** + * @brief Notify the changes of Ibl textures to the child items. + */ + void NotifyImageBasedLightTextureChange(); + private: Toolkit::Visual::Base mVisual; ///////////////////////////////////////////////////////////// // FrameBuffer and Rendertask to render child objects as a 3D Scene - CameraActor mDefaultCamera; - CameraActor mSelectedCamera; - std::vector mCameras; - std::vector mModels; - Dali::FrameBuffer mRenderTarget; - Dali::Texture mTexture; - Dali::RenderTask mRenderTask; - Layer mRootLayer; - int32_t mWindowOrientation; - Dali::Actor mSkybox; - Quaternion mSkyboxOrientation; - float mSkyboxIntensity{1.0f}; - - Dali::Texture mSpecularTexture; - Dali::Texture mDiffuseTexture; - float mIblScaleFactor{1.0f}; - bool mUseFrameBuffer{false}; - bool mIBLResourceReady{true}; - bool mSkyboxResourceReady{true}; + Dali::WeakHandle mWindow; + CameraActor mDefaultCamera; + CameraActor mSelectedCamera; + std::vector mCameras; + std::vector mItems; + Dali::FrameBuffer mFrameBuffer; + Dali::Texture mTexture; + Dali::RenderTask mRenderTask; + Layer mRootLayer; + int32_t mWindowOrientation; + Dali::Actor mSkybox; + Quaternion mSkyboxOrientation; + float mSkyboxIntensity{1.0f}; + uint8_t mFrameBufferMultiSamplingLevel{0u}; + + // Asynchronous Loading. + EnvironmentMapLoadTaskPtr mSkyboxLoadTask; + EnvironmentMapLoadTaskPtr mIblDiffuseLoadTask; + EnvironmentMapLoadTaskPtr mIblSpecularLoadTask; + std::string mSkyboxUrl; + std::string mDiffuseIblUrl; + std::string mSpecularIblUrl; + + Scene3D::EnvironmentMapType mSkyboxEnvironmentMapType{Scene3D::EnvironmentMapType::AUTO}; + Dali::Texture mSkyboxTexture; + Dali::Texture mDiffuseTexture; + Dali::Texture mSpecularTexture; + float mIblScaleFactor{1.0f}; + bool mUseFrameBuffer{false}; + bool mSkyboxResourceReady{true}; + bool mIblDiffuseResourceReady{true}; + bool mIblSpecularResourceReady{true}; + bool mSkyboxDirty{false}; + bool mIblDiffuseDirty{false}; + bool mIblSpecularDirty{false}; // TODO : Light Source };