Skip to content

Commit

Permalink
4 ➡️ 5
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <louise@openrobotics.org>
  • Loading branch information
chapulina committed Jan 21, 2021
2 parents 0d6fa7e + a9cf78d commit 6166234
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/rendering/SceneManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@ rendering::MaterialPtr SceneManager::LoadMaterial(
std::string roughnessMap = metal->RoughnessMap();
if (!roughnessMap.empty())
{
std::string fullPath = common::findFile(roughnessMap);
std::string fullPath = common::findFile(
asFullPath(roughnessMap, _material.FilePath()));
if (!fullPath.empty())
material->SetRoughnessMap(fullPath);
else
Expand All @@ -469,7 +470,8 @@ rendering::MaterialPtr SceneManager::LoadMaterial(
std::string metalnessMap = metal->MetalnessMap();
if (!metalnessMap.empty())
{
std::string fullPath = common::findFile(metalnessMap);
std::string fullPath = common::findFile(
asFullPath(metalnessMap, _material.FilePath()));
if (!fullPath.empty())
material->SetMetalnessMap(fullPath);
else
Expand All @@ -487,7 +489,8 @@ rendering::MaterialPtr SceneManager::LoadMaterial(
std::string albedoMap = workflow->AlbedoMap();
if (!albedoMap.empty())
{
std::string fullPath = common::findFile(albedoMap);
std::string fullPath = common::findFile(
asFullPath(albedoMap, _material.FilePath()));
if (!fullPath.empty())
{
material->SetTexture(fullPath);
Expand All @@ -502,7 +505,8 @@ rendering::MaterialPtr SceneManager::LoadMaterial(
std::string normalMap = workflow->NormalMap();
if (!normalMap.empty())
{
std::string fullPath = common::findFile(normalMap);
std::string fullPath = common::findFile(
asFullPath(normalMap, _material.FilePath()));
if (!fullPath.empty())
material->SetNormalMap(fullPath);
else
Expand All @@ -514,7 +518,8 @@ rendering::MaterialPtr SceneManager::LoadMaterial(
std::string environmentMap = workflow->EnvironmentMap();
if (!environmentMap.empty())
{
std::string fullPath = common::findFile(environmentMap);
std::string fullPath = common::findFile(
asFullPath(environmentMap, _material.FilePath()));
if (!fullPath.empty())
material->SetEnvironmentMap(fullPath);
else
Expand All @@ -525,7 +530,8 @@ rendering::MaterialPtr SceneManager::LoadMaterial(
std::string emissiveMap = workflow->EmissiveMap();
if (!emissiveMap.empty())
{
std::string fullPath = common::findFile(emissiveMap);
std::string fullPath = common::findFile(
asFullPath(emissiveMap, _material.FilePath()));
if (!fullPath.empty())
material->SetEmissiveMap(fullPath);
else
Expand Down

0 comments on commit 6166234

Please sign in to comment.