+Property::Index RENDERING_BUFFER = Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX + 1;
+constexpr int32_t DEFAULT_ORIENTATION = 0;
+
+static constexpr std::string_view SKYBOX_INTENSITY_STRING = "uIntensity";
+
+Dali::Actor CreateSkybox(const std::string& skyboxUrl)
+{
+ struct Vertex
+ {
+ Vector3 aPosition;
+ };
+
+ Vertex skyboxVertices[] = {
+ // back
+ {Vector3(-1.0f, 1.0f, -1.0f)},
+ {Vector3(-1.0f, -1.0f, -1.0f)},
+ {Vector3(1.0f, -1.0f, -1.0f)},
+ {Vector3(1.0f, -1.0f, -1.0f)},
+ {Vector3(1.0f, 1.0f, -1.0f)},
+ {Vector3(-1.0f, 1.0f, -1.0f)},
+
+ // left
+ {Vector3(-1.0f, -1.0f, 1.0f)},
+ {Vector3(-1.0f, -1.0f, -1.0f)},
+ {Vector3(-1.0f, 1.0f, -1.0f)},
+ {Vector3(-1.0f, 1.0f, -1.0f)},
+ {Vector3(-1.0f, 1.0f, 1.0f)},
+ {Vector3(-1.0f, -1.0f, 1.0f)},
+
+ // right
+ {Vector3(1.0f, -1.0f, -1.0f)},
+ {Vector3(1.0f, -1.0f, 1.0f)},
+ {Vector3(1.0f, 1.0f, 1.0f)},
+ {Vector3(1.0f, 1.0f, 1.0f)},
+ {Vector3(1.0f, 1.0f, -1.0f)},
+ {Vector3(1.0f, -1.0f, -1.0f)},
+
+ // front
+ {Vector3(-1.0f, -1.0f, 1.0f)},
+ {Vector3(-1.0f, 1.0f, 1.0f)},
+ {Vector3(1.0f, 1.0f, 1.0f)},
+ {Vector3(1.0f, 1.0f, 1.0f)},
+ {Vector3(1.0f, -1.0f, 1.0f)},
+ {Vector3(-1.0f, -1.0f, 1.0f)},
+
+ // botton
+ {Vector3(-1.0f, 1.0f, -1.0f)},
+ {Vector3(1.0f, 1.0f, -1.0f)},
+ {Vector3(1.0f, 1.0f, 1.0f)},
+ {Vector3(1.0f, 1.0f, 1.0f)},
+ {Vector3(-1.0f, 1.0f, 1.0f)},
+ {Vector3(-1.0f, 1.0f, -1.0f)},
+
+ // top
+ {Vector3(-1.0f, -1.0f, -1.0f)},
+ {Vector3(-1.0f, -1.0f, 1.0f)},
+ {Vector3(1.0f, -1.0f, -1.0f)},
+ {Vector3(1.0f, -1.0f, -1.0f)},
+ {Vector3(-1.0f, -1.0f, 1.0f)},
+ {Vector3(1.0f, -1.0f, 1.0f)}};
+
+ Dali::Shader shaderSkybox = Shader::New(SHADER_SKYBOX_SHADER_VERT.data(), SHADER_SKYBOX_SHADER_FRAG.data());
+ Dali::VertexBuffer vertexBuffer = Dali::VertexBuffer::New(Property::Map().Add("aPosition", Property::VECTOR3));
+ vertexBuffer.SetData(skyboxVertices, sizeof(skyboxVertices) / sizeof(Vertex));
+
+ Dali::Geometry skyboxGeometry = Geometry::New();
+ skyboxGeometry.AddVertexBuffer(vertexBuffer);
+ skyboxGeometry.SetType(Geometry::TRIANGLES);
+
+ Dali::Texture skyboxTexture = Dali::Scene3D::Loader::LoadCubeMap(skyboxUrl);
+ Dali::TextureSet skyboxTextures = TextureSet::New();
+ skyboxTextures.SetTexture(0, skyboxTexture);
+
+ Dali::Renderer skyboxRenderer = Renderer::New(skyboxGeometry, shaderSkybox);
+ skyboxRenderer.SetTextures(skyboxTextures);
+ skyboxRenderer.SetProperty(Renderer::Property::DEPTH_INDEX, 2.0f);
+ // Enables the depth test.
+ skyboxRenderer.SetProperty(Renderer::Property::DEPTH_TEST_MODE, DepthTestMode::ON);
+ // The fragment shader will run only is those pixels that have the max depth value.
+ skyboxRenderer.SetProperty(Renderer::Property::DEPTH_FUNCTION, DepthFunction::LESS_EQUAL);
+
+ Dali::Actor skyboxActor = Actor::New();
+ skyboxActor.SetProperty(Dali::Actor::Property::NAME, "SkyBox");
+ skyboxActor.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ skyboxActor.SetProperty(Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ skyboxActor.AddRenderer(skyboxRenderer);
+ return skyboxActor;
+}