Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix supported shader types (normal_map_X_space) #383

Merged
merged 1 commit into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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