Skip to content

Commit

Permalink
Merge branch 'ign-rendering6' into point_cloud_mat_syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
iche033 authored Oct 7, 2021
2 parents 2707f18 + 50e1e5f commit 60ef35d
Show file tree
Hide file tree
Showing 18 changed files with 206 additions and 60 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(ignition-rendering6 VERSION 6.0.0)
project(ignition-rendering6 VERSION 6.0.1)

#============================================================================
# Find ignition-cmake
Expand All @@ -15,7 +15,7 @@ set(IGN_CMAKE_VER ${ignition-cmake2_VERSION_MAJOR})
#============================================================================
# Set up the project
#============================================================================
ign_configure_project(VERSION_SUFFIX pre2)
ign_configure_project(VERSION_SUFFIX)

#============================================================================
# Set project-specific options
Expand Down
63 changes: 39 additions & 24 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,31 @@

### Ignition Rendering 6.X

### Ignition Rendering 6.0.0 (20XX-XX-XX)
### Ignition Rendering 6.0.1 (2021-10-01)

1. Disable using selection buffer for ray queries
* [Pull request #447](https://github.com/ignitionrobotics/ign-rendering/pull/447)

### Ignition Rendering 6.0.0 (2021-09-30)

1. Avoid configure warning when checking ogre-1.10
* [Pull request #411](https://github.com/ignitionrobotics/ign-rendering/pull/411)
* [Pull request #413](https://github.com/ignitionrobotics/ign-rendering/pull/413)

1. Use selection buffer in ray queries (ogre2)
* [Pull request #378](https://github.com/ignitionrobotics/ign-rendering/pull/378)

1. Fix particle effect randomness
* [Pull request #388](https://github.com/ignitionrobotics/ign-rendering/pull/388)

1. Update test config to run ogre 1.x tests in ign-rendering6 on macOS
* [Pull request #407](https://github.com/ignitionrobotics/ign-rendering/pull/407)
* [Pull request #409](https://github.com/ignitionrobotics/ign-rendering/pull/409)

1. Check if key exists in gpu lidar's user data
* [Pull request #396](https://github.com/ignitionrobotics/ign-rendering/pull/396)
* [Pull request #409](https://github.com/ignitionrobotics/ign-rendering/pull/409)

1. Clone visuals and geometries
* [Pull request #397](https://github.com/ignitionrobotics/ign-rendering/pull/397)
* [Pull request #434](https://github.com/ignitionrobotics/ign-rendering/pull/434)

1. Add SetSize API for LidarVisual and markers
* [Pull request #392](https://github.com/ignitionrobotics/ign-rendering/pull/392)
Expand All @@ -23,36 +37,36 @@

1. Prevent default-constructed variants from holding a type
* [Pull request #371](https://github.com/ignitionrobotics/ign-rendering/pull/371)
* [Pull request #396](https://github.com/ignitionrobotics/ign-rendering/pull/396)

1. Temporarily set number of camera pass count per flush to 0 in ogre2 to prevent downstream build failures
* [Pull request #367](https://github.com/ignitionrobotics/ign-rendering/pull/367)

1. Joint visual
* [Pull request #366](https://github.com/ignitionrobotics/ign-rendering/pull/366)
* [Pull request #387](https://github.com/ignitionrobotics/ign-rendering/pull/387)
1. New visuals
1. Joint visual
* [Pull request #366](https://github.com/ignitionrobotics/ign-rendering/pull/366)
* [Pull request #387](https://github.com/ignitionrobotics/ign-rendering/pull/387)

1. Fixing camera projection type test
* [Pull request #361](https://github.com/ignitionrobotics/ign-rendering/pull/361)
1. Center of mass visual
* [Pull request #345](https://github.com/ignitionrobotics/ign-rendering/pull/345)

1. Inertia visual
* [Pull request #326](https://github.com/ignitionrobotics/ign-rendering/pull/326)

1. UserData methods moved from Visual to Node
* [Pull request #358](https://github.com/ignitionrobotics/ign-rendering/pull/358)

1. Replace renderOneFrame for per-workspace update calls
* [Pull request #353](https://github.com/ignitionrobotics/ign-rendering/pull/353)

1. Center of mass visual
* [Pull request #345](https://github.com/ignitionrobotics/ign-rendering/pull/345)

1. Segmentation Camera
* [Pull request #329](https://github.com/ignitionrobotics/ign-rendering/pull/329)
* [Pull request #419](https://github.com/ignitionrobotics/ign-rendering/pull/419)
* [Pull request #443](https://github.com/ignitionrobotics/ign-rendering/pull/443)

1. Stub bounding box camera APIs
* [Pull request #420](https://github.com/ignitionrobotics/ign-rendering/pull/420)

1. Inertia visual
* [Pull request #326](https://github.com/ignitionrobotics/ign-rendering/pull/326)

1. Changed calculation for range clipping
* [Pull request #325](https://github.com/ignitionrobotics/ign-rendering/pull/325)

Expand All @@ -61,9 +75,7 @@

1. Add orthographic view controller
* [Pull request #322](https://github.com/ignitionrobotics/ign-rendering/pull/322)

1. Port codecov to new configuration
* [Pull request #318](https://github.com/ignitionrobotics/ign-rendering/pull/318)
* [Pull request #361](https://github.com/ignitionrobotics/ign-rendering/pull/361)

1. Visualize wireframes
* [Pull request #314](https://github.com/ignitionrobotics/ign-rendering/pull/314)
Expand All @@ -74,13 +86,16 @@
1. From Ogre 2.1 to Ogre 2.2
* [Pull request #272](https://github.com/ignitionrobotics/ign-rendering/pull/272)
* [Pull request #393](https://github.com/ignitionrobotics/ign-rendering/pull/393)
* [Pull request #436](https://github.com/ignitionrobotics/ign-rendering/pull/436)
* [Pull request #426](https://github.com/ignitionrobotics/ign-rendering/pull/426)
* [Pull request #440](https://github.com/ignitionrobotics/ign-rendering/pull/440)

1. All changes merged forward from ign-rendering5
* [Pull request #310](https://github.com/ignitionrobotics/ign-rendering/pull/310)
* [Pull request #331](https://github.com/ignitionrobotics/ign-rendering/pull/331)
* [Pull request #350](https://github.com/ignitionrobotics/ign-rendering/pull/350)
* [Pull request #401](https://github.com/ignitionrobotics/ign-rendering/pull/401)
* [Pull request #406](https://github.com/ignitionrobotics/ign-rendering/pull/406)
1. Documentation updates
* [Pull request #425](https://github.com/ignitionrobotics/ign-rendering/pull/425)
* [Pull request #431](https://github.com/ignitionrobotics/ign-rendering/pull/431)

1. Infrastructure
* [Pull request #318](https://github.com/ignitionrobotics/ign-rendering/pull/318)

### Ignition Rendering 5.X

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

Build | Status
-- | --
Test coverage | [![codecov](https://codecov.io/gh/ignitionrobotics/ign-rendering/branch/main/graph/badge.svg)](https://codecov.io/gh/ignitionrobotics/ign-rendering/branch/default)
Ubuntu Bionic | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_rendering-ci-main-bionic-amd64)](https://build.osrfoundation.org/job/ignition_rendering-ci-main-bionic-amd64)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_rendering-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_rendering-ci-main-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/job/ign_rendering-ci-win/badge/icon)](https://build.osrfoundation.org/job/ign_rendering-ci-win/)
Test coverage | [![codecov](https://codecov.io/gh/ignitionrobotics/ign-rendering/branch/ign-rendering6/graph/badge.svg)](https://codecov.io/gh/ignitionrobotics/ign-rendering/branch/ign-rendering6)
Ubuntu Bionic | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_rendering-ci-ign-rendering6-bionic-amd64)](https://build.osrfoundation.org/job/ignition_rendering-ci-ign-rendering6-bionic-amd64)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_rendering-ci-ign-rendering6-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_rendering-ci-ign-rendering6-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/job/ign_rendering-ign-6-win/badge/icon)](https://build.osrfoundation.org/job/ign_rendering-ign-6-win/)

Ignition Rendering is a C++ library designed to provide an abstraction
for different rendering engines. It offers unified APIs for creating
Expand Down
2 changes: 1 addition & 1 deletion examples/particles_demo/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ int main(int _argc, char** _argv)

// Expose engine name to command line because we can't instantiate both
// ogre and ogre2 at the same time
std::string ogreEngineName("ogre");
std::string ogreEngineName("ogre2");
if (_argc > 1)
{
ogreEngineName = _argv[1];
Expand Down
3 changes: 3 additions & 0 deletions include/ignition/rendering/base/BaseRenderEngine.hh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ namespace ignition

protected: bool isHeadless = false;

/// \brief ID from a external window
protected: std::string winID = "";

protected: unsigned int nextSceneId;

IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Expand Down
5 changes: 5 additions & 0 deletions ogre2/include/ignition/rendering/ogre2/Ogre2Scene.hh
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,11 @@ namespace ignition
/// \param[in] _camera Camera about to be used for rendering
public: void UpdateAllHeightmaps(Ogre::Camera *_camera);

/// \internal
/// \brief Return all heightmaps in the scene
public: const std::vector<std::weak_ptr<Ogre2Heightmap>> &Heightmaps()
const;

/// \brief Create a compositor shadow node with the same number of shadow
/// textures as the number of shadow casting lights
protected: void UpdateShadowNode();
Expand Down
45 changes: 31 additions & 14 deletions ogre2/src/Ogre2DepthCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ class ignition::rendering::Ogre2DepthCameraPrivate

/// \brief Name of sky box material
public: const std::string kSkyboxMaterialName = "SkyBox";

/// \brief Name of shadow compositor node
public: const std::string kShadowNodeName = "PbsMaterialsShadowNode";
};

using namespace ignition;
Expand Down Expand Up @@ -696,6 +699,25 @@ void Ogre2DepthCamera::CreateDepthTexture()
else
colorTargetDef->setNumPasses(1);
{
// scene pass - opaque
{
Ogre::CompositorPassSceneDef *passScene =
static_cast<Ogre::CompositorPassSceneDef *>(
colorTargetDef->addPass(Ogre::PASS_SCENE));
passScene->mShadowNode = this->dataPtr->kShadowNodeName;
passScene->mVisibilityMask = IGN_VISIBILITY_ALL;
passScene->mIncludeOverlays = false;
passScene->mFirstRQ = 0u;
passScene->mLastRQ = 2u;
if (!validBackground)
{
passScene->setAllLoadActions(Ogre::LoadAction::Clear);
passScene->setAllClearColours(Ogre::ColourValue(
Ogre2Conversions::Convert(this->Scene()->BackgroundColor())));
}
}

// render background, e.g. sky, after opaque stuff
if (validBackground)
{
// quad pass
Expand All @@ -712,21 +734,16 @@ void Ogre2DepthCamera::CreateDepthTexture()
Ogre2Conversions::Convert(this->Scene()->BackgroundColor())));
}

// scene pass
Ogre::CompositorPassSceneDef *passScene =
static_cast<Ogre::CompositorPassSceneDef *>(
colorTargetDef->addPass(Ogre::PASS_SCENE));
passScene->mVisibilityMask = IGN_VISIBILITY_ALL;

// todo(anyone) PbsMaterialsShadowNode is hardcoded.
// Although this may be just fine
passScene->mShadowNode = "PbsMaterialsShadowNode";

if (!validBackground)
// scene pass - transparent stuff
{
passScene->setAllLoadActions(Ogre::LoadAction::Clear);
passScene->setAllClearColours(Ogre::ColourValue(
Ogre2Conversions::Convert(this->Scene()->BackgroundColor())));
Ogre::CompositorPassSceneDef *passScene =
static_cast<Ogre::CompositorPassSceneDef *>(
colorTargetDef->addPass(Ogre::PASS_SCENE));
passScene->mVisibilityMask = IGN_VISIBILITY_ALL;
// todo(anyone) PbsMaterialsShadowNode is hardcoded.
// Although this may be just fine
passScene->mShadowNode = this->dataPtr->kShadowNodeName;
passScene->mFirstRQ = 2u;
}
}

Expand Down
1 change: 1 addition & 0 deletions ogre2/src/Ogre2Heightmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class ignition::rendering::Ogre2HeightmapPrivate
/// \brief Size of the heightmap data.
public: unsigned int dataSize{0u};

/// \brief Pointer to ogre terra object
public: std::unique_ptr<Ogre::Terra> terra{nullptr};
};

Expand Down
5 changes: 5 additions & 0 deletions ogre2/src/Ogre2RayQuery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ RayQueryResult Ogre2RayQuery::ClosestPoint()
{
RayQueryResult result;

// ray query using selection buffer does not seem to work on some machines
// using cpu based ray-triangle intersection method
// \todo remove this line if selection buffer is working again
return this->ClosestPointByIntersection();

#ifdef __APPLE__
return this->ClosestPointByIntersection();
#else
Expand Down
11 changes: 11 additions & 0 deletions ogre2/src/Ogre2RenderEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ bool Ogre2RenderEngine::LoadImpl(
if (it != _params.end())
std::istringstream(it->second) >> this->isHeadless;

it = _params.find("winID");
if (it != _params.end())
std::istringstream(it->second) >> this->winID;

try
{
this->LoadAttempt();
Expand Down Expand Up @@ -880,6 +884,13 @@ std::string Ogre2RenderEngine::CreateRenderWindow(const std::string &_handle,
params["currentGLContext"] = "true";
}

#if !defined(__APPLE__) && !defined(_MSC_VER)
if (!this->winID.empty())
{
params["parentWindowHandle"] = this->winID;
}
#endif

int attempts = 0;
while (window == nullptr && (attempts++) < 10)
{
Expand Down
34 changes: 24 additions & 10 deletions ogre2/src/Ogre2RenderTarget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,23 @@ void Ogre2RenderTarget::BuildCompositor()
else
rt0TargetDef->setNumPasses(1);
{
// scene pass - opaque
{
Ogre::CompositorPassSceneDef *passScene =
static_cast<Ogre::CompositorPassSceneDef *>(
rt0TargetDef->addPass(Ogre::PASS_SCENE));
passScene->mShadowNode = this->dataPtr->kShadowNodeName;
passScene->mIncludeOverlays = false;
passScene->mFirstRQ = 0u;
passScene->mLastRQ = 2u;
if (!validBackground)
{
passScene->setAllLoadActions(Ogre::LoadAction::Clear);
passScene->setAllClearColours(this->ogreBackgroundColor);
}
}

// render background, e.g. sky, after opaque stuff
if (validBackground)
{
// quad pass
Expand All @@ -204,17 +221,14 @@ void Ogre2RenderTarget::BuildCompositor()
passQuad->setAllClearColours(this->ogreBackgroundColor);
}

// scene pass
Ogre::CompositorPassSceneDef *passScene =
static_cast<Ogre::CompositorPassSceneDef *>(
rt0TargetDef->addPass(Ogre::PASS_SCENE));
passScene->mShadowNode = this->dataPtr->kShadowNodeName;
passScene->mIncludeOverlays = true;

if (!validBackground)
// scene pass - transparent stuff
{
passScene->setAllLoadActions(Ogre::LoadAction::Clear);
passScene->setAllClearColours(this->ogreBackgroundColor);
Ogre::CompositorPassSceneDef *passScene =
static_cast<Ogre::CompositorPassSceneDef *>(
rt0TargetDef->addPass(Ogre::PASS_SCENE));
passScene->mIncludeOverlays = true;
passScene->mShadowNode = this->dataPtr->kShadowNodeName;
passScene->mFirstRQ = 2u;
}
}

Expand Down
6 changes: 6 additions & 0 deletions ogre2/src/Ogre2Scene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,12 @@ MaterialMapPtr Ogre2Scene::Materials() const
return this->materials;
}

//////////////////////////////////////////////////
const std::vector<std::weak_ptr<Ogre2Heightmap>> &Ogre2Scene::Heightmaps() const
{
return this->heightmaps;
}

//////////////////////////////////////////////////
DirectionalLightPtr Ogre2Scene::CreateDirectionalLightImpl(unsigned int _id,
const std::string &_name)
Expand Down
22 changes: 22 additions & 0 deletions ogre2/src/Ogre2SegmentationMaterialSwitcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <ignition/common/Console.hh>

#include "ignition/rendering/ogre2/Ogre2Heightmap.hh"
#include "ignition/rendering/ogre2/Ogre2Scene.hh"
#include "ignition/rendering/ogre2/Ogre2Visual.hh"
#include "ignition/rendering/RenderTypes.hh"
Expand Down Expand Up @@ -317,6 +318,18 @@ void Ogre2SegmentationMaterialSwitcher::cameraPreRenderScene(
this->instancesCount.clear();
this->takenColors.clear();
this->coloredLabel.clear();

// disable heightmaps in segmentation camera sensor
// until we support changing its material based on input label
// TODO(anyone) add support for heightmaps with the segmentation camera
// https://github.com/ignitionrobotics/ign-rendering/issues/444
auto heightmaps = this->scene->Heightmaps();
for (auto h : heightmaps)
{
auto heightmap = h.lock();
if (heightmap)
heightmap->Parent()->SetVisible(false);
}
}

////////////////////////////////////////////////
Expand All @@ -326,6 +339,15 @@ void Ogre2SegmentationMaterialSwitcher::cameraPostRenderScene(
// restore item to use pbs hlms material
for (const auto &[subItem, dataBlock] : this->datablockMap)
subItem->setDatablock(dataBlock);

// re-enable heightmaps
auto heightmaps = this->scene->Heightmaps();
for (auto h : heightmaps)
{
auto heightmap = h.lock();
if (heightmap)
heightmap->Parent()->SetVisible(true);
}
}

////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit 60ef35d

Please sign in to comment.