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

Merge 8 -> main #979

Merged
merged 24 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
09099db
Update github issue template (#939)
iche033 Nov 1, 2023
79acfe4
Add minor comments to BaseGizmoVisual (#881)
iche033 Nov 2, 2023
c2fdbcd
Update github action workflows (#940)
azeey Nov 13, 2023
329555a
Merge remote-tracking branch 'origin/ign-rendering3' into azeey/3_to_6
azeey Nov 14, 2023
cc77597
Merge pull request #942 from gazebosim/azeey/3_to_6
iche033 Nov 14, 2023
2c996ae
Prepare for 3.7.2 release (#952)
iche033 Jan 5, 2024
53b3c0a
Merge 3 to 6
azeey Jan 12, 2024
77e1d12
Merge pull request #954 from azeey/3_to_6
azeey Jan 12, 2024
34fdfb7
Backport ogre2 lidar performance improvement (#956)
iche033 Jan 17, 2024
e57c84a
Merge 6 into 7
azeey Jan 18, 2024
860cfd4
Improve Ogre2GpuRays performance (#955)
iche033 Jan 17, 2024
0305b34
Merge pull request #957 from azeey/6_to_7
azeey Jan 18, 2024
9593a4e
Merge remote-tracking branch 'origin/gz-rendering7' into 7_to_8
caguero Jan 26, 2024
ed7b3e5
Fix merge
caguero Jan 26, 2024
22eb772
Merge pull request #966 from gazebosim/7_to_8
iche033 Jan 26, 2024
9f5c94a
Optimize Ogre2DepthCamera performance by skipping color target passes…
iche033 Jan 26, 2024
dc9fe05
Update github ci workflow (#967)
caguero Feb 5, 2024
b07e79d
Skip particle passes in Ogre2DepthCamera if there are no particles in…
iche033 Feb 28, 2024
4f01a66
Update ogre2 symbol visibility macro in private classes (#972)
iche033 Feb 29, 2024
8b92eec
Skip particle passes in Ogre2GpuRays if there are no particles in the…
iche033 Feb 29, 2024
f95826f
Fix setting normal map when not all submeshes have texcoords (ogre2) …
iche033 Mar 1, 2024
5859051
Merge branch 'gz-rendering7' into merge_7_8_20240304
iche033 Mar 4, 2024
79463f1
Merge pull request #977 from gazebosim/merge_7_8_20240304
iche033 Mar 4, 2024
24d0f9b
Merge branch 'gz-rendering8' into merge_8_main_20240314
iche033 Mar 14, 2024
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 .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ labels: bug
---

<!-- If you're not sure whether your problem is a bug, please ask a question at
http://answers.gazebosim.org instead.-->
https://robotics.stackexchange.com instead.-->

## Environment
* OS Version: <!-- e.g, Ubuntu 20.04 -->
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ labels: enhancement

<!-- If you're not sure on the specifics of the feature or would like a broader
discussion, please consider posting a proposal to
http://community.gazebosim.org/ instead.-->
https://robotics.stackexchange.com instead.-->

## Desired behavior
<!-- Describe the current problem and the feature you want implemented.-->
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Ubuntu CI

on: [push, pull_request]
on:
pull_request:
push:
branches:
- 'ign-rendering[0-9]'
- 'gz-rendering[0-9]?'
- 'main'

jobs:
jammy-ci:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ jobs:
with:
project-url: https://github.com/orgs/gazebosim/projects/7
github-token: ${{ secrets.TRIAGE_TOKEN }}

10 changes: 10 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,16 @@
1. Add support for transparency based on textures alpha channel for ogre1 and ogre2
* [BitBucket pull request 229](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-rendering/pull-requests/229)

### Gazebo Rendering 3.7.2 (2024-01-05)

1. Update github action workflows
* [Pull request #940](https://github.com/gazebosim/gz-rendering/pull/940)
* [Pull request #834](https://github.com/gazebosim/gz-rendering/pull/834)
* [Pull request #833](https://github.com/gazebosim/gz-rendering/pull/833)

1. Add minor comments to BaseGizmoVisual
* [Pull request #881](https://github.com/gazebosim/gz-rendering/pull/881)

### Gazebo Rendering 3.7.1 (2023-02-03)

1. Remove fini to resolve segfault at shutdown.
Expand Down
4 changes: 4 additions & 0 deletions include/gz/rendering/base/BaseGizmoVisual.hh
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ namespace gz
this->visuals[TransformAxis::TA_TRANSLATION_X] = transXVis;
this->visuals[TransformAxis::TA_TRANSLATION_Y] = transYVis;
this->visuals[TransformAxis::TA_TRANSLATION_Z] = transZVis;
// Store the translation origin visual in this->visuals using a key
// that's not already occupied by the TransformAxis enum
this->visuals[TransformAxis::TA_TRANSLATION_Z << 1] = transOrigin;

// translation handles
Expand Down Expand Up @@ -588,6 +590,8 @@ namespace gz
this->visuals[TransformAxis::TA_ROTATION_X] = rotXVis;
this->visuals[TransformAxis::TA_ROTATION_Y] = rotYVis;
this->visuals[TransformAxis::TA_ROTATION_Z] = rotZVis;
// Store the full rotation visual in this->visuals using a key
// that's not already occupied by the TransformAxis enum
this->visuals[TransformAxis::TA_ROTATION_Z << 1] = rotFullVis;

// rotation handles
Expand Down
125 changes: 111 additions & 14 deletions ogre2/src/Ogre2DepthCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <windows.h>
#endif

#include <cstdint>
#include <math.h>
#include <gz/math/Helpers.hh>
#include <gz/math/Matrix4.hh>
Expand All @@ -31,7 +32,6 @@
#include "gz/rendering/ogre2/Ogre2Conversions.hh"
#include "gz/rendering/ogre2/Ogre2DepthCamera.hh"
#include "gz/rendering/ogre2/Ogre2GaussianNoisePass.hh"
#include "gz/rendering/ogre2/Ogre2Includes.hh"
#include "gz/rendering/ogre2/Ogre2ParticleEmitter.hh"
#include "gz/rendering/ogre2/Ogre2RenderEngine.hh"
#include "gz/rendering/ogre2/Ogre2RenderTarget.hh"
Expand All @@ -41,6 +41,21 @@

#include "Ogre2ParticleNoiseListener.hh"

#ifdef _MSC_VER
#pragma warning(push, 0)
#endif
#include <Compositor/OgreCompositorManager2.h>
#include <Compositor/OgreCompositorWorkspace.h>
#include <Compositor/Pass/PassClear/OgreCompositorPassClearDef.h>
#include <Compositor/Pass/PassQuad/OgreCompositorPassQuadDef.h>
#include <Compositor/Pass/PassScene/OgreCompositorPassSceneDef.h>
#include <OgreRoot.h>
#include <OgreSceneManager.h>
#include <OgreTechnique.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif

namespace gz
{
namespace rendering
Expand Down Expand Up @@ -148,6 +163,19 @@

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

/// \brief Execution mask for this workspace
/// If RGB point color data are requested, the execution mask of the color
/// target will be updated to match the workspace's execution mask so that
/// these passes are executed, otherwise they will be skipped for performance
/// improvement.
public: const uint8_t kDepthExecutionMask = 0xEF;

/// \brief Pointer to the color target definition in the workspace
public: Ogre::CompositorTargetDef *colorTargetDef{nullptr};

/// \brief Pointer to the particle target definition in the workspace
public: Ogre::CompositorTargetDef *particleTargetDef{nullptr};
};

using namespace gz;
Expand Down Expand Up @@ -315,6 +343,8 @@
{
ogreCompMgr->removeWorkspace(
this->dataPtr->ogreCompositorWorkspace);
this->dataPtr->colorTargetDef = nullptr;
this->dataPtr->particleTargetDef = nullptr;
}

if (this->dataPtr->depthMaterial)
Expand Down Expand Up @@ -702,19 +732,24 @@
rtvParticleTexture->depthAttachment.textureName = "particleDepthTexture";

baseNodeDef->setNumTargetPass(4);
Ogre::CompositorTargetDef *colorTargetDef =
this->dataPtr->colorTargetDef =
baseNodeDef->addTargetPass("colorTexture");

if (validBackground)
colorTargetDef->setNumPasses(3);
this->dataPtr->colorTargetDef->setNumPasses(4);

Check warning on line 738 in ogre2/src/Ogre2DepthCamera.cc

View check run for this annotation

Codecov / codecov/patch

ogre2/src/Ogre2DepthCamera.cc#L738

Added line #L738 was not covered by tests
else
colorTargetDef->setNumPasses(2);
this->dataPtr->colorTargetDef->setNumPasses(3);
{
// clear pass
Ogre::CompositorPassClearDef *passClear =
static_cast<Ogre::CompositorPassClearDef *>(
this->dataPtr->colorTargetDef->addPass(Ogre::PASS_CLEAR));
passClear->mExecutionMask = this->dataPtr->kDepthExecutionMask;

// scene pass - opaque
{
Ogre::CompositorPassSceneDef *passScene =
static_cast<Ogre::CompositorPassSceneDef *>(
colorTargetDef->addPass(Ogre::PASS_SCENE));
this->dataPtr->colorTargetDef->addPass(Ogre::PASS_SCENE));
passScene->mShadowNode = this->dataPtr->kShadowNodeName;
passScene->setVisibilityMask(GZ_VISIBILITY_ALL);
passScene->mIncludeOverlays = false;
Expand All @@ -733,6 +768,7 @@
Ogre2Conversions::Convert(this->Scene()->BackgroundColor()));

}
passScene->mExecutionMask = ~this->dataPtr->kDepthExecutionMask;
}

// render background, e.g. sky, after opaque stuff
Expand All @@ -741,23 +777,25 @@
// quad pass
Ogre::CompositorPassQuadDef *passQuad =
static_cast<Ogre::CompositorPassQuadDef *>(
colorTargetDef->addPass(Ogre::PASS_QUAD));
this->dataPtr->colorTargetDef->addPass(Ogre::PASS_QUAD));

Check warning on line 780 in ogre2/src/Ogre2DepthCamera.cc

View check run for this annotation

Codecov / codecov/patch

ogre2/src/Ogre2DepthCamera.cc#L780

Added line #L780 was not covered by tests
passQuad->mMaterialName = this->dataPtr->kSkyboxMaterialName + "_"
+ this->Name();
passQuad->mFrustumCorners =
Ogre::CompositorPassQuadDef::CAMERA_DIRECTION;
passQuad->mExecutionMask = ~this->dataPtr->kDepthExecutionMask;

Check warning on line 785 in ogre2/src/Ogre2DepthCamera.cc

View check run for this annotation

Codecov / codecov/patch

ogre2/src/Ogre2DepthCamera.cc#L785

Added line #L785 was not covered by tests
}

// scene pass - transparent stuff
{
Ogre::CompositorPassSceneDef *passScene =
static_cast<Ogre::CompositorPassSceneDef *>(
colorTargetDef->addPass(Ogre::PASS_SCENE));
this->dataPtr->colorTargetDef->addPass(Ogre::PASS_SCENE));
passScene->setVisibilityMask(GZ_VISIBILITY_ALL);
// todo(anyone) PbsMaterialsShadowNode is hardcoded.
// Although this may be just fine
passScene->mShadowNode = this->dataPtr->kShadowNodeName;
passScene->mFirstRQ = 2u;
passScene->mExecutionMask = ~this->dataPtr->kDepthExecutionMask;
}
}

Expand All @@ -774,23 +812,36 @@
this->FarClipPlane(),
this->FarClipPlane(),
this->FarClipPlane()));
// depth texute does not contain particles
// depth texture does not contain particles
passScene->setVisibilityMask(
GZ_VISIBILITY_ALL & ~Ogre2ParticleEmitter::kParticleVisibilityFlags);
passScene->mEnableForwardPlus = false;
passScene->setLightVisibilityMask(0x0);
}

Ogre::CompositorTargetDef *particleTargetDef =
// Ogre::CompositorTargetDef *particleTargetDef =
this->dataPtr->particleTargetDef =
baseNodeDef->addTargetPass("particleTexture");
particleTargetDef->setNumPasses(1);
this->dataPtr->particleTargetDef->setNumPasses(2);
{
// clear pass
Ogre::CompositorPassClearDef *passClear =
static_cast<Ogre::CompositorPassClearDef *>(
this->dataPtr->particleTargetDef->addPass(Ogre::PASS_CLEAR));
passClear->setAllClearColours(Ogre::ColourValue::Black);
passClear->mExecutionMask = this->dataPtr->kDepthExecutionMask;

// scene pass
Ogre::CompositorPassSceneDef *passScene =
static_cast<Ogre::CompositorPassSceneDef *>(
particleTargetDef->addPass(Ogre::PASS_SCENE));
this->dataPtr->particleTargetDef->addPass(Ogre::PASS_SCENE));
passScene->setAllLoadActions(Ogre::LoadAction::Clear);
passScene->setAllClearColours(Ogre::ColourValue::Black);
passScene->setVisibilityMask(
Ogre2ParticleEmitter::kParticleVisibilityFlags);
passScene->mEnableForwardPlus = false;
passScene->setLightVisibilityMask(0x0);
passScene->mExecutionMask = ~this->dataPtr->kDepthExecutionMask;
}

// rt0 target - converts depth to xyz
Expand Down Expand Up @@ -920,7 +971,7 @@
Ogre::GpuResidency::Resident);
}

CreateWorkspaceInstance();
this->CreateWorkspaceInstance();
}

//////////////////////////////////////////////////
Expand All @@ -942,7 +993,8 @@
externalTargets,
this->ogreCamera,
this->dataPtr->ogreCompositorWorkspaceDef,
false);
false, -1, 0, 0, Ogre::Vector4::ZERO, 0x00,
this->dataPtr->kDepthExecutionMask);

this->dataPtr->ogreCompositorWorkspace->addListener(
engine->TerraWorkspaceListener());
Expand Down Expand Up @@ -1017,6 +1069,51 @@
if (!this->dataPtr->ogreCompositorWorkspace)
this->CreateWorkspaceInstance();


// Disable color target (set to clear pass) if there are no rgb point cloud
// connections
if (this->dataPtr->colorTargetDef)
{
Ogre::CompositorPassDefVec &colorPasses =
this->dataPtr->colorTargetDef->getCompositorPassesNonConst();
GZ_ASSERT(colorPasses.size() > 2u,
"Ogre2DepthCamera color target should contain more than 2 passes");
GZ_ASSERT(colorPasses[0]->getType() == Ogre::PASS_CLEAR,
"Ogre2DepthCamera color target should start with a clear pass");
colorPasses[0]->mExecutionMask =
(this->dataPtr->newRgbPointCloud.ConnectionCount() > 0u) ?
~this->dataPtr->kDepthExecutionMask :this->dataPtr->kDepthExecutionMask;
for (unsigned int i = 1; i < colorPasses.size(); ++i)
{
colorPasses[i]->mExecutionMask =
(this->dataPtr->newRgbPointCloud.ConnectionCount() > 0u) ?
this->dataPtr->kDepthExecutionMask :
~this->dataPtr->kDepthExecutionMask;
}
}

// Disable particle target (set to clear pass) if there are no particles
if (this->dataPtr->particleTargetDef)
{
bool hasParticles =
this->scene->OgreSceneManager()->getMovableObjectIterator(
Ogre::ParticleSystemFactory::FACTORY_TYPE_NAME).hasMoreElements();
Ogre::CompositorPassDefVec &particlePasses =
this->dataPtr->particleTargetDef->getCompositorPassesNonConst();
GZ_ASSERT(particlePasses.size() == 2u,
"Ogre2DepthCamera particle target should 2 passes");
GZ_ASSERT(particlePasses[0]->getType() == Ogre::PASS_CLEAR,
"Ogre2DepthCamera particle target should start with a clear pass");
GZ_ASSERT(particlePasses[1]->getType() == Ogre::PASS_SCENE,
"Ogre2DepthCamera particle target should end with a scene pass");
particlePasses[0]->mExecutionMask =
(hasParticles) ? ~this->dataPtr->kDepthExecutionMask :
this->dataPtr->kDepthExecutionMask;
particlePasses[1]->mExecutionMask =
(hasParticles) ? this->dataPtr->kDepthExecutionMask :
~this->dataPtr->kDepthExecutionMask;
}

// update depth camera render passes
Ogre2RenderTarget::UpdateRenderPassChain(
this->dataPtr->ogreCompositorWorkspace,
Expand Down
4 changes: 2 additions & 2 deletions ogre2/src/Ogre2GlobalIlluminationCiVct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ using namespace gz;
using namespace rendering;

/// \brief Private data for the Ogre2CiVctCascadePrivate class
class DETAIL_GZ_RENDERING_OGRE2_HIDDEN gz::rendering::Ogre2CiVctCascadePrivate
class GZ_RENDERING_OGRE2_HIDDEN gz::rendering::Ogre2CiVctCascadePrivate
{
// clang-format off
/// \brief Pointer to cascade setting
Expand All @@ -49,7 +49,7 @@ class DETAIL_GZ_RENDERING_OGRE2_HIDDEN gz::rendering::Ogre2CiVctCascadePrivate
};

/// \brief Private data for the Ogre2GlobalIlluminationCiVct class
class DETAIL_GZ_RENDERING_OGRE2_HIDDEN
class GZ_RENDERING_OGRE2_HIDDEN
gz::rendering::Ogre2GlobalIlluminationCiVctPrivate
{
// clang-format off
Expand Down
Loading
Loading