Make subsurface texture not be enabled in dli 44/298144/4
authorseungho baek <sbsh.baek@samsung.com>
Fri, 1 Sep 2023 07:52:42 +0000 (16:52 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Fri, 1 Sep 2023 13:00:54 +0000 (22:00 +0900)
 - dli shaders not use subsurface sampler but the texture is added to textureSet

Change-Id: I2aab8f8e91c663cdc49cdb97a6e4a3a54efc014f
Signed-off-by: seungho baek <sbsh.baek@samsung.com>
dali-scene3d/internal/loader/dli-loader-impl.cpp

index a4dbeda..668a10c 100644 (file)
@@ -667,6 +667,12 @@ void DliLoaderImpl::Impl::ParseShaders(const TreeNode* shaders, Dali::Scene3D::L
     auto&            node = (*i0).second;
     ShaderDefinition shaderDef;
     ReadStringVector(node.GetChild("defines"), shaderDef.mDefines);
+    auto sssIter = std::find_if(shaderDef.mDefines.begin(), shaderDef.mDefines.end(), [](std::string& item)
+                                { return (item == "SSS"); });
+    if(sssIter != shaderDef.mDefines.end())
+    {
+      shaderDef.mDefines.erase(sssIter);
+    }
 
     // Read shader hints. Possible values are:
     //                         Don't define for No hints.
@@ -1027,14 +1033,17 @@ void DliLoaderImpl::Impl::ParseMaterials(const TreeNode* materials, DliInputPara
       materialDef.mFlags |= semantic;
     }
 
-    if(ReadString(node.GetChild("subsurfaceMap"), texturePath))
-    {
-      ToUnixFileSeparators(texturePath);
-
-      const auto semantic = MaterialDefinition::SUBSURFACE;
-      materialDef.mTextureStages.push_back({semantic, TextureDefinition{std::move(texturePath)}});
-      materialDef.mFlags |= semantic;
-    }
+/// @TODO : Some dli shader don't implement this subsurfaceMp usage.
+///         To make visual test pass, Skip subsurfaceMap texture using
+///         until dli shaders are support it.
+//    if(ReadString(node.GetChild("subsurfaceMap"), texturePath))
+//    {
+//      ToUnixFileSeparators(texturePath);
+//
+//      const auto semantic = MaterialDefinition::SUBSURFACE;
+//      materialDef.mTextureStages.push_back({semantic, TextureDefinition{std::move(texturePath)}});
+//      materialDef.mFlags |= semantic;
+//    }
 
     if(ReadString(node.GetChild("occlusionMap"), texturePath))
     {