From 18dd99ef11126696df022fdb12882cbfc3eaab40 Mon Sep 17 00:00:00 2001 From: seungho baek Date: Fri, 1 Sep 2023 16:52:42 +0900 Subject: [PATCH] Make subsurface texture not be enabled in dli - dli shaders not use subsurface sampler but the texture is added to textureSet Change-Id: I2aab8f8e91c663cdc49cdb97a6e4a3a54efc014f Signed-off-by: seungho baek --- dali-scene3d/internal/loader/dli-loader-impl.cpp | 25 ++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/dali-scene3d/internal/loader/dli-loader-impl.cpp b/dali-scene3d/internal/loader/dli-loader-impl.cpp index a4dbeda..668a10c 100644 --- a/dali-scene3d/internal/loader/dli-loader-impl.cpp +++ b/dali-scene3d/internal/loader/dli-loader-impl.cpp @@ -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)) { -- 2.7.4