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

From Ogre 2.1 to Ogre 2.2 #272

Merged
merged 62 commits into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
025f72a
Ogre2.2
ahcorde Mar 23, 2021
1cff215
Added media files
ahcorde Mar 23, 2021
e5979b8
Added Headless mode
ahcorde Mar 23, 2021
fc89bef
Added feedback
ahcorde Mar 23, 2021
c5c077c
Added feedback
ahcorde Mar 24, 2021
8033623
Add OGRE2.2 to dependencies
mjcarroll Mar 24, 2021
a82820c
Fixed GPUray and depthCamera test
ahcorde Mar 24, 2021
b5c639e
Merge branch 'main' into ahcorde/update/ogre2.2
ahcorde Mar 24, 2021
b664ade
cast based on pf
iche033 Mar 25, 2021
d6808b8
Fix cleanup with packaged debs
mjcarroll Mar 25, 2021
e940e9a
fix copy raw data
iche033 Mar 25, 2021
92e8fbf
Merge branch 'ahcorde/update/ogre2.2' of github.com:ignitionrobotics/…
iche033 Mar 25, 2021
11cd876
fix material test
iche033 Mar 25, 2021
88cfd40
Lint and compiler warning
mjcarroll Mar 25, 2021
db609f3
Trim whitespace
mjcarroll Mar 25, 2021
bc12f40
Apply gamma correction to sky
ahcorde Mar 25, 2021
fcf51b1
Merge branch 'ahcorde/update/ogre2.2' of https://github.com/ignitionr…
ahcorde Mar 25, 2021
797675b
Test fixes to Ogre2.2 branch (#279)
mjcarroll Mar 25, 2021
7046608
Merge branch 'main' into ahcorde/update/ogre2.2
ahcorde Mar 25, 2021
d55ee47
Revert gamma correction in the sky
ahcorde Mar 25, 2021
01aeec2
Merge branch 'main' into ahcorde/update/ogre2.2
iche033 Apr 13, 2021
62bb629
enable grayscale albedo map to fix red color highlights and disable h…
iche033 Apr 14, 2021
032ce0f
Merge branch 'main' into ahcorde/update/ogre2.2
mjcarroll May 4, 2021
adfdb05
Local updates for Ogre2.2 against main branch (#317)
mjcarroll May 5, 2021
24fb7df
Fix merge
ahcorde May 11, 2021
72f23ab
Merge branch 'main' into ahcorde/update/ogre2.2
iche033 May 11, 2021
96b2eb5
fix shadows in ogre 2.2
iche033 May 11, 2021
5e2f7b5
Merge branch 'main' into ahcorde/update/ogre2.2
mjcarroll May 18, 2021
21b5993
Merge branch 'main' into ahcorde/update/ogre2.2
mjcarroll May 24, 2021
c2bbbe9
Lint
mjcarroll May 24, 2021
2e9d62e
fix toggling sky
iche033 Jun 8, 2021
b37ab76
fix camera test
iche033 Jun 8, 2021
523a5cc
Merge remote-tracking branch 'origin/main' into ahcorde/update/ogre2.2
ahcorde Jun 10, 2021
0df4dd4
make linters happy
ahcorde Jun 10, 2021
b9e8032
make linters happy
ahcorde Jun 10, 2021
5d1bbb6
Merge branch 'main' into ahcorde/update/ogre2.2
mjcarroll Jun 16, 2021
24a67ad
Fix small regression from merge
mjcarroll Jun 20, 2021
9a381e2
Remove problematic leftover files from 2.1
darksylinc Jun 27, 2021
175fcae
Do not crash on shutdown
darksylinc Jun 27, 2021
fb0fb6e
Remove problematic leftover files from 2.1 (#354)
darksylinc Jun 28, 2021
7816937
Do not crash on shutdown (#355)
darksylinc Jun 28, 2021
970d862
Removed unused variable
ahcorde Jun 29, 2021
9f15486
Merge branch 'main' into matias-ogre2.2-main-merge
darksylinc Jul 3, 2021
d3adfbe
Restore FSAA support in 2.2 branch
darksylinc Jul 3, 2021
31b4960
Fix changing background color not always taking immediate effect
darksylinc Jul 3, 2021
60391e1
Changed pass_clear in favour of LoadAction::Clear
darksylinc Jul 3, 2021
d93cc18
Missing public keyword
darksylinc Jul 3, 2021
8c2ec12
Save VRAM when FSAA is used and no postprocessing
darksylinc Jul 3, 2021
84513fa
Merge branch 'ahcorde/update/ogre2.2' into matias-ogre2.2-main-merge
darksylinc Jul 3, 2021
029cd59
Remove code deprecated in ign-rendering5
darksylinc Jul 5, 2021
f951593
Remove code deprecated in ign-rendering5
darksylinc Jul 5, 2021
34c31d0
Code style fixes
darksylinc Jul 10, 2021
c19ec56
Undo VRAM saving optimization: It cannot be applied
darksylinc Jul 10, 2021
5f53934
Merge remote-tracking branch 'origin/main' into ahcorde/update/ogre2.2
ahcorde Aug 12, 2021
0818a0f
Merge branch 'main' into ahcorde/update/ogre2.2
ahcorde Aug 19, 2021
f53d5db
fixing tests
iche033 Sep 2, 2021
0d1999e
add ifdef
iche033 Sep 3, 2021
588100c
suppress warnings
iche033 Sep 3, 2021
20e24e9
update syntax
iche033 Sep 3, 2021
93599aa
update syntax
iche033 Sep 3, 2021
be61509
Merge branch 'main' into ahcorde/update/ogre2.2
iche033 Sep 3, 2021
95af386
Don't keep DEPTH_CLAMP enabled after it's used (#393)
darksylinc Sep 8, 2021
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/ci/packages.apt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ libignition-common4-dev
libignition-math6-dev
libignition-plugin-dev
libogre-1.9-dev
libogre-2.1-dev
libogre-2.2-dev
libxi-dev
libxmu-dev
uuid-dev
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ endif()

#--------------------------------------
# Find OGRE2
ign_find_package(IgnOGRE2 VERSION 2.1.0
ign_find_package(IgnOGRE2 VERSION 2.2.0
COMPONENTS HlmsPbs HlmsUnlit Overlay
REQUIRED_BY ogre2
PRIVATE_FOR ogre2)
Expand Down
4 changes: 4 additions & 0 deletions include/ignition/rendering/Camera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ namespace ignition
/// \return Render pass at the specified index
public: virtual RenderPassPtr RenderPassByIndex(unsigned int _index)
const = 0;

/// \internal
/// \brief Notify that shadows are dirty and need to be regenerated
public: virtual void SetShadowsDirty() = 0;
};
}
}
Expand Down
9 changes: 9 additions & 0 deletions include/ignition/rendering/RenderEngine.hh
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ namespace ignition
public: virtual ScenePtr CreateScene(unsigned int _id,
const std::string &_name) = 0;

/// \brief Set headless mode
/// Only available in OGRE 2.2, which makes use of EGL
/// \param[in] _headless Set to true to enable headless mode.
public: virtual void SetHeadless(bool _headless) = 0;

/// \brief Get headless mode
/// \return True if headless mode is enable, false otherwise.
public: virtual bool Headless() const = 0;

/// \brief Add path to media resource location
/// \param[in] _paths Absolute path to resource location
public: virtual void AddResourcePath(const std::string &_path) = 0;
Expand Down
10 changes: 10 additions & 0 deletions include/ignition/rendering/base/BaseCamera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ namespace ignition
public: virtual RenderPassPtr RenderPassByIndex(unsigned int _index)
const override;

// Documentation inherited.
public: virtual void SetShadowsDirty() override;

protected: virtual void *CreateImageBuffer() const;

protected: virtual void Load() override;
Expand Down Expand Up @@ -828,6 +831,13 @@ namespace ignition
{
return this->RenderTarget()->RenderPassByIndex(_index);
}

//////////////////////////////////////////////////
template <class T>
void BaseCamera<T>::SetShadowsDirty()
{
// no op
}
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions include/ignition/rendering/base/BaseRenderEngine.hh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ namespace ignition
// Documentation Inherited
public: virtual void AddResourcePath(const std::string &_path) override;

// Documentation Inherited
public: virtual void SetHeadless(bool _headless) override;

// Documentation Inherited
public: virtual bool Headless() const override;

// Documentation Inherited
public: virtual RenderPassSystemPtr RenderPassSystem() const override;

Expand All @@ -111,6 +117,8 @@ namespace ignition

protected: bool initialized = false;

protected: bool isHeadless = false;

protected: unsigned int nextSceneId;

IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Expand Down
14 changes: 9 additions & 5 deletions ogre2/include/ignition/rendering/ogre2/Ogre2Camera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "ignition/rendering/base/BaseCamera.hh"
#include "ignition/rendering/ogre2/Ogre2RenderTypes.hh"
#include "ignition/rendering/ogre2/Ogre2Includes.hh"
#include "ignition/rendering/ogre2/Ogre2Sensor.hh"

namespace Ogre
Expand Down Expand Up @@ -114,11 +115,7 @@ namespace ignition
public: virtual unsigned int RenderTextureGLId() const override;

// Documentation inherited.
// TODO(anyone): this function should be virtual, declared in 'Camera'
// and 'BaseCamera'. We didn't do it to preserve ABI.
// Looks in commit history for '#SetShadowsNodeDefDirtyABI' to
// see changes made and revert
public: void SetShadowsNodeDefDirty();
public: void SetShadowsDirty() override;

// Documentation inherited.
public: virtual void Destroy() override;
Expand All @@ -144,6 +141,13 @@ namespace ignition
/// \brief Create internal camera object
private: void CreateCamera();

/// \brief Notifies us that the shadow node definition is about to be
/// updated. This means our compositor workspace must be destroyed
/// because the shadow node definition it's using will become a
/// dangling pointer otherwise
/// \sa SetShadowsDirty
private: void SetShadowsNodeDefDirty();

/// \brief Pointer to ogre camera object
protected: Ogre::Camera *ogreCamera = nullptr;

Expand Down
6 changes: 3 additions & 3 deletions ogre2/include/ignition/rendering/ogre2/Ogre2Conversions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include <OgreColourValue.h>
#include <OgreVector3.h>
#include <OgrePixelFormat.h>
#include <OgrePixelFormatGpu.h>

#ifdef _MSC_VER
#pragma warning(pop)
Expand Down Expand Up @@ -107,10 +107,10 @@ namespace ignition
/// \brief Ign-rendering PixelFormat to Ogre PixelFormat
/// \param[in] _v Ign-rendering PixelFormat
/// return Ogre PixelFormat
public: static Ogre::PixelFormat Convert(PixelFormat _format);
public: static Ogre::PixelFormatGpu Convert(PixelFormat _format);

/// \brief A list of ogre pixel formats
private: static const Ogre::PixelFormat ogrePixelFormats[PF_COUNT];
private: static const Ogre::PixelFormatGpu ogrePixelFormats[PF_COUNT];
};
/// \}
}
Expand Down
28 changes: 8 additions & 20 deletions ogre2/include/ignition/rendering/ogre2/Ogre2DepthCamera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -123,26 +123,7 @@ namespace ignition
public: double FarClipPlane() const override;

// Documentation inherited.
// TODO(anyone): this function should be virtual, declared in 'Camera'
// and 'BaseCamera'. We didn't do it to preserve ABI.
// Looks in commit history for '#SetShadowsNodeDefDirtyABI' to
// see changes made and revert
public: void SetShadowsNodeDefDirty();

// TODO(anyone): This fixes the pass quad material leaving dangling
// pointers when we remove the workspace, so we have to cleanup the
// material first.
// This bug was fixed in Ogre 2.2 thus the workaround should not be
// necessary there
//
// See https://github.com/ignitionrobotics/ign-rendering/
// pull/303#pullrequestreview-635228897
// Repro:
// 1.run the sensors_demo.sdf world: ign gazebo -v 4 -r sensors_demo.sdf
// 2.open Lights plugin, top right menu (3 dots) and select Lights
// 3.insert a spot light into the scene (needs to be spot light)
// 4.ign gazebo crashes
private: void RemoveWorkspaceCrashWorkaround();
public: void SetShadowsDirty() override;

// Documentation inherited.
public: void AddRenderPass(const RenderPassPtr &_pass) override;
Expand All @@ -160,6 +141,13 @@ namespace ignition
/// \brief Create the camera.
protected: void CreateCamera();

/// \brief Notifies us that the shadow node definition is about to be
/// updated. This means our compositor workspace must be destroyed
/// because the shadow node definition it's using will become a
/// dangling pointer otherwise
/// \sa SetShadowsDirty
private: void SetShadowsNodeDefDirty();

/// \brief Pointer to the ogre camera
protected: Ogre::Camera *ogreCamera;

Expand Down
59 changes: 33 additions & 26 deletions ogre2/include/ignition/rendering/ogre2/Ogre2Includes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,54 +27,62 @@
// This prevents some deprecation #warning messages on OSX 10.9
#pragma clang diagnostic ignored "-W#warnings"

#include <memory>

#include <Ogre.h>
#include <OgreBillboard.h>
#include <OgreImageCodec.h>
#include <OgreMovableObject.h>
#include <OgreRenderable.h>
#include <OgreRenderWindow.h>
#include <OgrePlugin.h>
#include <OgreCamera.h>
#include <OgreColourValue.h>
#include <OgreDataStream.h>
#include <OgreLogManager.h>
#include <OgreWindowEventUtilities.h>
#include <OgreSceneQuery.h>
#include <OgreRoot.h>
#include <OgreDepthBuffer.h>
#include <OgreFrameListener.h>
#include <OgreGpuProgramManager.h>
#include <OgreHardwareBufferManager.h>
#include <OgreHighLevelGpuProgramManager.h>
#include <OgreItem.h>
#include <OgreSceneManager.h>
#include <OgreSceneNode.h>
#include <OgreVector3.h>
#include <OgreImage2.h>
#include <OgreLogManager.h>
#include <OgreManualObject.h>
#include <OgreMaterialManager.h>
#include <OgreMatrix4.h>
#include <OgreColourValue.h>
#include <OgreQuaternion.h>
#include <OgreMesh2.h>
#include <OgreSubMesh2.h>
#include <OgreMeshManager2.h>
#include <OgreHardwareBufferManager.h>
#include <OgreCamera.h>
#include <OgreMovableObject.h>
#include <OgreNode.h>
#include <OgreSimpleRenderable.h>
#include <OgreFrameListener.h>
#include <OgreTexture.h>
#include <OgreOldSkeletonManager.h>
#include <OgreParticleEmitter.h>
#include <OgreParticleSystem.h>
#include <OgrePass.h>
#include <OgrePixelFormatGpuUtils.h>
#include <OgrePlugin.h>
#include <OgreQuaternion.h>
#include <OgreRectangle2D.h>
#include <OgreRenderObjectListener.h>
#include <OgreRenderable.h>
#include <OgreRoot.h>
#include <OgreSceneManager.h>
#include <OgreSceneNode.h>
#include <OgreSceneQuery.h>
#include <OgreShadowCameraSetupPSSM.h>
#include <OgreSimpleRenderable.h>
#include <OgreStagingTexture.h>
#include <OgreSubMesh2.h>
#include <OgreTechnique.h>
#include <OgrePass.h>
#include <OgreOldSkeletonManager.h>
#include <OgreTextureGpu.h>
#include <OgreTextureGpuManager.h>
#include <OgreTextureUnitState.h>
#include <OgreGpuProgramManager.h>
#include <OgreHighLevelGpuProgramManager.h>
#include <OgreHardwarePixelBuffer.h>
#include <OgreShadowCameraSetupPSSM.h>
#include <OgreDepthBuffer.h>
#include <OgreParticleAffector.h>
#include <OgreParticleAffectorFactory.h>
#include <OgreParticleEmitter.h>
#include <OgreParticleSystem.h>
#include <OgreVector3.h>
#include <OgreWindow.h>
#include <OgreWindowEventUtilities.h>

#include <OgreHlmsManager.h>
#include <OgreHlmsTextureManager.h>
#include <Hlms/Unlit/OgreHlmsUnlit.h>
#include <Hlms/Pbs/OgreHlmsPbs.h>

Expand All @@ -84,7 +92,6 @@
#include <Compositor/OgreCompositorShadowNode.h>
#include <Compositor/OgreCompositorWorkspace.h>
#include <Compositor/OgreCompositorWorkspaceListener.h>
#include <Compositor/Pass/PassClear/OgreCompositorPassClearDef.h>
#include <Compositor/Pass/PassQuad/OgreCompositorPassQuadDef.h>
#include <Compositor/Pass/PassScene/OgreCompositorPassScene.h>
#include <Compositor/Pass/PassScene/OgreCompositorPassSceneDef.h>
Expand Down
2 changes: 1 addition & 1 deletion ogre2/include/ignition/rendering/ogre2/Ogre2Material.hh
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ namespace ignition

/// \brief Get a pointer to the ogre texture by name
/// \return Ogre texture
protected: virtual Ogre::TexturePtr Texture(const std::string &_name);
protected: virtual Ogre::TextureGpu *Texture(const std::string &_name);

/// \brief Updates the material transparency in the engine,
/// based on transparency and diffuse alpha values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#ifdef _MSC_VER
#pragma warning(push, 0)
#endif
#include <OgreCamera.h>
#include <OgreMaterial.h>
#include <OgreRenderTargetListener.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand All @@ -46,7 +46,7 @@ namespace ignition

/// \brief Helper class to assign unique colors to renderables
class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2MaterialSwitcher :
public Ogre::RenderTargetListener
public Ogre::Camera::Listener
{
/// \brief Constructor
public: explicit Ogre2MaterialSwitcher(Ogre2ScenePtr _scene);
Expand All @@ -65,14 +65,14 @@ namespace ignition
/// \brief Ogre's pre render update callback
/// \param[in] _evt Ogre render target event containing information about
/// the source render target.
public: virtual void preRenderTargetUpdate(
const Ogre::RenderTargetEvent &_evt);
public: virtual void cameraPreRenderScene(
Ogre::Camera *_cam) override;

/// \brief Ogre's post render update callback
/// \param[in] _evt Ogre render target event containing information about
/// the source render target.
public: virtual void postRenderTargetUpdate(
const Ogre::RenderTargetEvent &_evt);
public: virtual void cameraPostRenderScene (
Ogre::Camera * _cam) override;

/// \brief Current unique color value
private: ignition::math::Color currentColor;
Expand Down
10 changes: 10 additions & 0 deletions ogre2/include/ignition/rendering/ogre2/Ogre2RenderEngine.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace Ogre
{
class LogManager;
class Root;
class Window;
namespace v1
{
class OverlaySystem;
Expand Down Expand Up @@ -94,6 +95,9 @@ namespace ignition
/// \param[in] _uri Resource path in the form of an uri
public: void AddResourcePath(const std::string &_uri) override;

/// \brief return the ogre window
public: Ogre::Window * OgreWindow() const;

/// \brief Get the ogre2 root object
/// \return ogre2 root object
public: virtual Ogre::Root *OgreRoot() const;
Expand Down Expand Up @@ -138,6 +142,9 @@ namespace ignition
/// \brief Create GL context
private: void CreateContext();

/// \brief Register Hlms
private: void RegisterHlms();

/// \brief Create ogre root
private: void CreateRoot();

Expand Down Expand Up @@ -192,6 +199,9 @@ namespace ignition
/// \brief Dummy window Id needed for linux platform
private: uint64_t dummyWindowId = 0u;

/// \brief Ogre Window
private: Ogre::Window *window = nullptr;

/// \brief True to use the current opengl context
private: bool useCurrentGLContext = false;

Expand Down
Loading