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

Reduce default heightmap sampling from 2 to 1 #459

Merged
merged 7 commits into from
Jan 26, 2021
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
4 changes: 4 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ but with improved human-readability..
+ bool JointNameExists(const std::string &) const
+ bool LinkNameExists(const std::string &) const

1. **sdf/Heightmap.hh**: sampling now defaults to 1 instead of 2.

### Deprecations

1. **src/Root.hh**: The following methods have been deprecated in favor of the
Expand Down Expand Up @@ -308,6 +310,8 @@ but with improved human-readability..
1. **joint.sdf** `child` and `parent` elements accept frame names instead of only link names
* [Issue 204](https://github.com/osrf/sdformat/issues/204)

1. **heightmap.sdf**: sampling now defaults to 1 instead of 2.

### Deprecations

1. **joint.sdf** `initial_position` element in `<joint><axis>` and `<joint><axis2>` is deprecated
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Heightmap.hh
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ namespace sdf
/// \return The heightmap's sampling.
public: unsigned int Sampling() const;

/// \brief Set the heightmap's sampling. Defaults to 2.
/// \brief Set the heightmap's sampling. Defaults to 1.
/// \param[in] _sampling The heightmap's sampling per datum.
public: void SetSampling(unsigned int _sampling);

Expand Down
4 changes: 2 additions & 2 deletions sdf/1.8/heightmap_shape.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
<element name="use_terrain_paging" type="bool" default="false" required="0">
<description>Set if the rendering engine will use terrain paging</description>
</element>
<element name="sampling" type="unsigned int" default="2" required="0">
<description>Samples per heightmap datum. For rasterized heightmaps, this indicates the number of samples to take per pixel. Using a lower value, e.g. 1, will generally improve the performance of the heightmap but lower the heightmap quality.
<element name="sampling" type="unsigned int" default="1" required="0">
<description>Samples per heightmap datum. For rasterized heightmaps, this indicates the number of samples to take per pixel. Using a higher value, e.g. 2, will generally improve the quality of the heightmap but lower performance.
</description>
</element>
</element>
2 changes: 1 addition & 1 deletion src/Heightmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class sdf::HeightmapPrivate
public: bool useTerrainPaging{false};

/// \brief Sampling per datum.
public: unsigned int sampling{2u};
public: unsigned int sampling{1u};

/// \brief Textures in order
public: std::vector<HeightmapTexture> textures;
Expand Down
4 changes: 2 additions & 2 deletions src/Heightmap_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ TEST(DOMHeightmap, Construction)
EXPECT_EQ(ignition::math::Vector3d(1, 1, 1), heightmap.Size());
EXPECT_EQ(ignition::math::Vector3d::Zero, heightmap.Position());
EXPECT_FALSE(heightmap.UseTerrainPaging());
EXPECT_EQ(2u, heightmap.Sampling());
EXPECT_EQ(1u, heightmap.Sampling());
EXPECT_EQ(0u, heightmap.TextureCount());
EXPECT_EQ(0u, heightmap.BlendCount());
EXPECT_EQ(nullptr, heightmap.TextureByIndex(0u));
Expand Down Expand Up @@ -304,7 +304,7 @@ TEST(DOMHeightmap, Set)
heightmap.SetUseTerrainPaging(true);
EXPECT_TRUE(heightmap.UseTerrainPaging());

EXPECT_EQ(2u, heightmap.Sampling());
EXPECT_EQ(1u, heightmap.Sampling());
heightmap.SetSampling(12u);
EXPECT_EQ(12u, heightmap.Sampling());

Expand Down