From f48a4fcc09ba61c5dfe9383296e7a06fd0e1cfce Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Fri, 9 Oct 2020 10:00:51 -0700 Subject: [PATCH] Fix supported shader types (normal_map_X_space) (#383) Signed-off-by: Louise Poubel --- sdf/1.2/visual.sdf | 2 +- sdf/1.3/visual.sdf | 2 +- sdf/1.4/visual.sdf | 2 +- sdf/1.5/material.sdf | 2 +- sdf/1.6/material.sdf | 2 +- sdf/1.7/material.sdf | 2 +- sdf/1.8/material.sdf | 2 +- src/Material.cc | 4 ++++ test/sdf/material.sdf | 2 +- test/sdf/material_normal_map_missing.sdf | 2 +- 10 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sdf/1.2/visual.sdf b/sdf/1.2/visual.sdf index 6b4913260..550fe4448 100644 --- a/sdf/1.2/visual.sdf +++ b/sdf/1.2/visual.sdf @@ -41,7 +41,7 @@ - vertex, pixel, normal_map_objectspace, normal_map_tangentspace + vertex, pixel, normal_map_object_space, normal_map_tangent_space diff --git a/sdf/1.3/visual.sdf b/sdf/1.3/visual.sdf index 029ef22bd..10dfb3a56 100644 --- a/sdf/1.3/visual.sdf +++ b/sdf/1.3/visual.sdf @@ -41,7 +41,7 @@ - vertex, pixel, normal_map_objectspace, normal_map_tangentspace + vertex, pixel, normal_map_object_space, normal_map_tangent_space diff --git a/sdf/1.4/visual.sdf b/sdf/1.4/visual.sdf index 644bff44a..f8043dfca 100644 --- a/sdf/1.4/visual.sdf +++ b/sdf/1.4/visual.sdf @@ -41,7 +41,7 @@ - vertex, pixel, normal_map_objectspace, normal_map_tangentspace + vertex, pixel, normal_map_object_space, normal_map_tangent_space diff --git a/sdf/1.5/material.sdf b/sdf/1.5/material.sdf index 137436eea..fdf5fa6a7 100644 --- a/sdf/1.5/material.sdf +++ b/sdf/1.5/material.sdf @@ -17,7 +17,7 @@ - vertex, pixel, normal_map_objectspace, normal_map_tangentspace + vertex, pixel, normal_map_object_space, normal_map_tangent_space diff --git a/sdf/1.6/material.sdf b/sdf/1.6/material.sdf index f17690759..7cd011598 100644 --- a/sdf/1.6/material.sdf +++ b/sdf/1.6/material.sdf @@ -17,7 +17,7 @@ - vertex, pixel, normal_map_objectspace, normal_map_tangentspace + vertex, pixel, normal_map_object_space, normal_map_tangent_space diff --git a/sdf/1.7/material.sdf b/sdf/1.7/material.sdf index f17690759..7cd011598 100644 --- a/sdf/1.7/material.sdf +++ b/sdf/1.7/material.sdf @@ -17,7 +17,7 @@ - vertex, pixel, normal_map_objectspace, normal_map_tangentspace + vertex, pixel, normal_map_object_space, normal_map_tangent_space diff --git a/sdf/1.8/material.sdf b/sdf/1.8/material.sdf index f17690759..7cd011598 100644 --- a/sdf/1.8/material.sdf +++ b/sdf/1.8/material.sdf @@ -17,7 +17,7 @@ - vertex, pixel, normal_map_objectspace, normal_map_tangentspace + vertex, pixel, normal_map_object_space, normal_map_tangent_space diff --git a/src/Material.cc b/src/Material.cc index dd465a942..4e0870931 100644 --- a/src/Material.cc +++ b/src/Material.cc @@ -170,8 +170,12 @@ Errors Material::Load(sdf::ElementPtr _sdf) this->dataPtr->shader = ShaderType::VERTEX; else if (typePair.first == "normal_map_objectspace") this->dataPtr->shader = ShaderType::NORMAL_MAP_OBJECTSPACE; + else if (typePair.first == "normal_map_object_space") + this->dataPtr->shader = ShaderType::NORMAL_MAP_OBJECTSPACE; else if (typePair.first == "normal_map_tangentspace") this->dataPtr->shader = ShaderType::NORMAL_MAP_TANGENTSPACE; + else if (typePair.first == "normal_map_tangent_space") + this->dataPtr->shader = ShaderType::NORMAL_MAP_TANGENTSPACE; else { errors.push_back({ErrorCode::ELEMENT_INVALID, diff --git a/test/sdf/material.sdf b/test/sdf/material.sdf index 5869f6de4..5b1c2e68f 100644 --- a/test/sdf/material.sdf +++ b/test/sdf/material.sdf @@ -26,7 +26,7 @@ - + my_normal_map diff --git a/test/sdf/material_normal_map_missing.sdf b/test/sdf/material_normal_map_missing.sdf index 033efffb4..08607c335 100644 --- a/test/sdf/material_normal_map_missing.sdf +++ b/test/sdf/material_normal_map_missing.sdf @@ -4,7 +4,7 @@ - +