/*
- * 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.
* These textures are based off version of Wave engine sample
* Take from https://github.com/WaveEngine/Samples
*
- * Copyright (c) 2022 Wave Coorporation
+ * Copyright (c) 2023 Wave Coorporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
if(renderer)
{
TextureSet textureSet = renderer.GetTextures();
- if(textureSet.GetTextureCount() == 9u)
+ if(textureSet.GetTextureCount() == 10u)
{
- texture = textureSet.GetTexture(7u);
+ texture = textureSet.GetTexture(8u);
}
}
}
if(renderer)
{
TextureSet textureSet = renderer.GetTextures();
- if(textureSet.GetTextureCount() == 9u)
+ if(textureSet.GetTextureCount() == 10u)
{
- texture = textureSet.GetTexture(8u);
+ texture = textureSet.GetTexture(9u);
}
}
}
return texture;
}
-
// For ResourceReady
static bool gOnRelayoutCallBackCalled = false;
-void OnRelayoutCallback(Actor actor)
+void OnRelayoutCallback(Actor actor)
{
gOnRelayoutCallBackCalled = true;
}
static bool gResourceReadyCalled = false;
-void OnResourceReady(Control control)
+void OnResourceReady(Control control)
{
gResourceReadyCalled = true;
}
application.SendNotification();
application.Render();
-
renderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
- DALI_TEST_EQUALS(2u, renderTaskCount, TEST_LOCATION);
+ DALI_TEST_EQUALS(3u, renderTaskCount, TEST_LOCATION);
- RenderTask renderTask = application.GetScene().GetRenderTaskList().GetTask(1u);
+ RenderTask renderTask = application.GetScene().GetRenderTaskList().GetTask(2u);
CameraActor camera = renderTask.GetCameraActor();
CameraActor defaultCamera = renderTask.GetCameraActor();
application.SendNotification();
application.Render();
- DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView2), 0.0f, TEST_LOCATION);
- DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView2), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView2), TEST_LOCATION);
+ DALI_TEST_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView2), TEST_LOCATION);
DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView3), 0.0f, TEST_LOCATION);
DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView3), 0.0f, TEST_LOCATION);
DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
- Dali::Texture diffuseTexture = GetDiffuseTexture(modelView1);
+ Dali::Texture diffuseTexture = GetDiffuseTexture(modelView1);
Dali::Texture specularTexture = GetSpecularTexture(modelView1);
gResourceReadyCalled = false;
DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, 0.0f, TEST_LOCATION);
DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), specularTexture, 0.0f, TEST_LOCATION);
- diffuseTexture = GetDiffuseTexture(modelView1);
+ diffuseTexture = GetDiffuseTexture(modelView1);
specularTexture = GetSpecularTexture(modelView1);
// reset SceneView IBL
application.SendNotification();
application.Render();
- Dali::Texture diffuseTexture = GetDiffuseTexture(modelView1);
+ Dali::Texture diffuseTexture = GetDiffuseTexture(modelView1);
Dali::Texture specularTexture = GetSpecularTexture(modelView1);
gResourceReadyCalled = false;
modelView1.SetImageBasedLightSource("", "");
DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, 0.0f, TEST_LOCATION);
DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), specularTexture, 0.0f, TEST_LOCATION);
- diffuseTexture = GetDiffuseTexture(modelView1);
+ diffuseTexture = GetDiffuseTexture(modelView1);
specularTexture = GetSpecularTexture(modelView1);
// reset SceneView IBL
application.SendNotification();
application.Render();
- RenderTask renderTask = application.GetScene().GetRenderTaskList().GetTask(1u);
+ RenderTask renderTask = application.GetScene().GetRenderTaskList().GetTask(2u);
DALI_TEST_CHECK(!renderTask.GetFrameBuffer());
view.UseFramebuffer(true);
END_TEST;
}
+int UtcDaliSceneViewFramebufferMultiSamplingLevel(void)
+{
+ ToolkitTestApplication application;
+
+ Scene3D::SceneView view = Scene3D::SceneView::New();
+ view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
+
+ application.GetScene().Add(view);
+
+ application.SendNotification();
+ application.Render();
+
+ uint8_t expectValue = 0u; // Default MultiSamplingLevel is 0.
+ uint8_t multiSamplingLevel = view.GetFramebufferMultiSamplingLevel();
+ DALI_TEST_EQUALS(multiSamplingLevel, expectValue, TEST_LOCATION);
+
+ expectValue = 4u; // Change value.
+ view.UseFramebuffer(true);
+ view.SetFramebufferMultiSamplingLevel(expectValue);
+
+ multiSamplingLevel = view.GetFramebufferMultiSamplingLevel();
+ DALI_TEST_EQUALS(multiSamplingLevel, expectValue, TEST_LOCATION);
+
+ // Note : we don't check multi sampling level is applied to framebuffer, or not.
+ view.UseFramebuffer(false);
+ expectValue = 2u; // Change value.
+ view.SetFramebufferMultiSamplingLevel(expectValue);
+
+ application.SendNotification();
+ application.Render();
+
+ multiSamplingLevel = view.GetFramebufferMultiSamplingLevel();
+ DALI_TEST_EQUALS(multiSamplingLevel, expectValue, TEST_LOCATION);
+
+ END_TEST;
+}
+
int UtcDaliSceneViewResourceReady(void)
{
ToolkitTestApplication application;
gOnRelayoutCallBackCalled = false;
- gResourceReadyCalled = false;
- Scene3D::SceneView view = Scene3D::SceneView::New();
+ gResourceReadyCalled = false;
+ Scene3D::SceneView view = Scene3D::SceneView::New();
view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
view.OnRelayoutSignal().Connect(OnRelayoutCallback);
view.ResourceReadySignal().Connect(OnResourceReady);
DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
gOnRelayoutCallBackCalled = false;
- gResourceReadyCalled = false;
+ gResourceReadyCalled = false;
view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE);
{
ToolkitTestApplication application;
- gResourceReadyCalled = false;
+ gResourceReadyCalled = false;
Scene3D::SceneView view = Scene3D::SceneView::New();
view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
view.ResourceReadySignal().Connect(OnResourceReady);
{
ToolkitTestApplication application;
- gResourceReadyCalled = false;
+ gResourceReadyCalled = false;
Scene3D::SceneView view = Scene3D::SceneView::New();
view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
view.ResourceReadySignal().Connect(OnResourceReady);
application.Render();
uint32_t childCount = view.GetChildAt(0u).GetChildCount();
- view.SetSkybox(TEST_EQUIRECTANGULAR_TEXTURE, Scene3D::SceneView::SkyboxType::EQUIRECTANGULAR);
+ view.SetSkyboxEnvironmentMapType(Scene3D::EnvironmentMapType::EQUIRECTANGULAR);
+ view.SetSkybox(TEST_EQUIRECTANGULAR_TEXTURE);
gResourceReadyCalled = false;
DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
{
ToolkitTestApplication application;
- gResourceReadyCalled = false;
+ gResourceReadyCalled = false;
Scene3D::SceneView view = Scene3D::SceneView::New();
view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
view.ResourceReadySignal().Connect(OnResourceReady);
END_TEST;
}
+int UtcDaliSceneViewSetSkyboxEmpty2(void)
+{
+ ToolkitTestApplication application;
+
+ gResourceReadyCalled = false;
+ Scene3D::SceneView view = Scene3D::SceneView::New();
+ view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ view.ResourceReadySignal().Connect(OnResourceReady);
+ application.GetScene().Add(view);
+
+ application.SendNotification();
+ application.Render();
+
+ view.SetSkybox(TEST_EQUIRECTANGULAR_TEXTURE);
+
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+ application.SendNotification();
+ application.Render();
+
+ uint32_t childCount = view.GetChildAt(0u).GetChildCount();
+
+ view.SetSkybox("");
+ DALI_TEST_EQUALS(view.GetChildAt(0u).GetChildCount(), childCount - 1, TEST_LOCATION);
+
+ view.Unparent();
+ view.Reset();
+
+ END_TEST;
+}
+
int UtcDaliSceneViewSetSkyboxEquirectangularEmpty(void)
{
ToolkitTestApplication application;
- gResourceReadyCalled = false;
+ gResourceReadyCalled = false;
Scene3D::SceneView view = Scene3D::SceneView::New();
view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
view.ResourceReadySignal().Connect(OnResourceReady);
application.Render();
uint32_t childCount = view.GetChildAt(0u).GetChildCount();
- view.SetSkybox("", Scene3D::SceneView::SkyboxType::EQUIRECTANGULAR);
+ view.SetSkybox("");
DALI_TEST_EQUALS(view.GetChildAt(0u).GetChildCount(), childCount, TEST_LOCATION);
view.Unparent();
int UtcDaliSceneViewCreateAndRemoveRenderTask(void)
{
ToolkitTestApplication application;
- RenderTaskList taskList = application.GetScene().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
uint32_t renderTaskCount = taskList.GetTaskCount();
application.GetScene().Add(view);
- DALI_TEST_EQUALS(renderTaskCount + 1, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(renderTaskCount + 2, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
view.Unparent();