Skip to content

Commit

Permalink
Fix supported shader types (normal_map_X_space) (#383)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <louise@openrobotics.org>
  • Loading branch information
chapulina committed Oct 9, 2020
1 parent 246d978 commit 2917733
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sdf/1.2/visual.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<description></description>

<attribute name="type" type="string" default="pixel" required="1">
<description>vertex, pixel, normal_map_objectspace, normal_map_tangentspace</description>
<description>vertex, pixel, normal_map_object_space, normal_map_tangent_space</description>
</attribute>

<element name="normal_map" type="string" default="__default__" required="0">
Expand Down
2 changes: 1 addition & 1 deletion sdf/1.3/visual.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<description></description>

<attribute name="type" type="string" default="pixel" required="1">
<description>vertex, pixel, normal_map_objectspace, normal_map_tangentspace</description>
<description>vertex, pixel, normal_map_object_space, normal_map_tangent_space</description>
</attribute>

<element name="normal_map" type="string" default="__default__" required="0">
Expand Down
2 changes: 1 addition & 1 deletion sdf/1.4/visual.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<description></description>

<attribute name="type" type="string" default="pixel" required="1">
<description>vertex, pixel, normal_map_objectspace, normal_map_tangentspace</description>
<description>vertex, pixel, normal_map_object_space, normal_map_tangent_space</description>
</attribute>

<element name="normal_map" type="string" default="__default__" required="0">
Expand Down
2 changes: 1 addition & 1 deletion sdf/1.5/material.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<element name="shader" required="0">

<attribute name="type" type="string" default="pixel" required="1">
<description>vertex, pixel, normal_map_objectspace, normal_map_tangentspace</description>
<description>vertex, pixel, normal_map_object_space, normal_map_tangent_space</description>
</attribute>

<element name="normal_map" type="string" default="__default__" required="0">
Expand Down
2 changes: 1 addition & 1 deletion sdf/1.6/material.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<element name="shader" required="0">

<attribute name="type" type="string" default="pixel" required="1">
<description>vertex, pixel, normal_map_objectspace, normal_map_tangentspace</description>
<description>vertex, pixel, normal_map_object_space, normal_map_tangent_space</description>
</attribute>

<element name="normal_map" type="string" default="__default__" required="0">
Expand Down
4 changes: 4 additions & 0 deletions src/Material.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,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,
Expand Down
2 changes: 1 addition & 1 deletion test/sdf/material.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<visual name="visual3">
<material>
<shader type="normal_map_objectspace">
<shader type="normal_map_object_space">
<normal_map>my_normal_map</normal_map>
</shader>
</material>
Expand Down
2 changes: 1 addition & 1 deletion test/sdf/material_normal_map_missing.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<link name="link">
<visual name="visual1">
<material>
<shader type="normal_map_tangentspace">
<shader type="normal_map_tangent_space">
</shader>
</material>
</visual>
Expand Down

0 comments on commit 2917733

Please sign in to comment.