From ef4abecdeee9b749a4efed72870bdf30a853fe17 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Sat, 20 May 2023 18:02:07 +0200 Subject: [PATCH 1/6] Fix visibility decorator of Ogre2Projector (#850) Signed-off-by: Silvio Traversaro --- ogre2/include/gz/rendering/ogre2/Ogre2Projector.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ogre2/include/gz/rendering/ogre2/Ogre2Projector.hh b/ogre2/include/gz/rendering/ogre2/Ogre2Projector.hh index 46e240f57..4774585b0 100644 --- a/ogre2/include/gz/rendering/ogre2/Ogre2Projector.hh +++ b/ogre2/include/gz/rendering/ogre2/Ogre2Projector.hh @@ -23,7 +23,7 @@ #include "gz/rendering/config.hh" #include "gz/rendering/base/BaseProjector.hh" -#include "gz/rendering/ogre/Export.hh" +#include "gz/rendering/ogre2/Export.hh" #include "gz/rendering/ogre2/Ogre2Visual.hh" namespace gz @@ -33,7 +33,7 @@ namespace gz inline namespace GZ_RENDERING_VERSION_NAMESPACE { /// \brief Ogre 2.x implementation of a Projector class. - class GZ_RENDERING_OGRE_VISIBLE Ogre2Projector : + class GZ_RENDERING_OGRE2_VISIBLE Ogre2Projector : public BaseProjector { /// \brief Constructor. From 388a766268ce3066f65a4bb4d7ce934934d71009 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Mon, 22 May 2023 22:34:29 +0200 Subject: [PATCH 2/6] OgreNext: Fix shaders compilation on d3d12 mesa driver (WSLg) (#851) Old GPUs and systems with incomplete GL implementations like WSLg would trigger shader compiler errors for several reasons: * because C++ saw that GL_ARB_shader_storage_buffer_object was supported but we didn't request it in the shader. * because C++ required the use of GLSL 4.30 (not supported by d3d12 as of 2023/05), even if GLSL 4.20 plus some extensions would also work fine. This was tested on both mesa 22.2.5 and 23.1.0 . --------- Signed-off-by: Silvio Traversaro Signed-off-by: Silvio Traversaro --- .../materials/Common/GLSL/GaussianBlurBase_cs.glsl | 8 +++++++- .../materials/Terra/GLSL/TerraShadowGenerator.glsl | 7 ++++++- .../Hlms/Common/GLSL/CrossPlatformSettings_piece_all.glsl | 4 ++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ogre2/src/media/2.0/scripts/materials/Common/GLSL/GaussianBlurBase_cs.glsl b/ogre2/src/media/2.0/scripts/materials/Common/GLSL/GaussianBlurBase_cs.glsl index 9e013df6a..126bf8195 100644 --- a/ogre2/src/media/2.0/scripts/materials/Common/GLSL/GaussianBlurBase_cs.glsl +++ b/ogre2/src/media/2.0/scripts/materials/Common/GLSL/GaussianBlurBase_cs.glsl @@ -1,5 +1,11 @@ @property( syntax != glslvk ) - #version 430 + @property( GL3+ >= 430 ) + #version 430 + @else + #version 420 + #extension GL_ARB_arrays_of_arrays: enable + #extension GL_ARB_compute_shader: enable + @end @else #version 450 @end diff --git a/ogre2/src/media/2.0/scripts/materials/Terra/GLSL/TerraShadowGenerator.glsl b/ogre2/src/media/2.0/scripts/materials/Terra/GLSL/TerraShadowGenerator.glsl index e519d2736..94083379a 100644 --- a/ogre2/src/media/2.0/scripts/materials/Terra/GLSL/TerraShadowGenerator.glsl +++ b/ogre2/src/media/2.0/scripts/materials/Terra/GLSL/TerraShadowGenerator.glsl @@ -1,5 +1,10 @@ @property( syntax != glslvk ) - #version 430 + @property( GL3+ >= 430 ) + #version 430 + @else + #version 420 + #extension GL_ARB_compute_shader: enable + @end #define ogre_B0 binding = 0 #define ogre_B1 binding = 1 @else diff --git a/ogre2/src/media/Hlms/Common/GLSL/CrossPlatformSettings_piece_all.glsl b/ogre2/src/media/Hlms/Common/GLSL/CrossPlatformSettings_piece_all.glsl index 4e3912853..049e3e5b5 100644 --- a/ogre2/src/media/Hlms/Common/GLSL/CrossPlatformSettings_piece_all.glsl +++ b/ogre2/src/media/Hlms/Common/GLSL/CrossPlatformSettings_piece_all.glsl @@ -6,6 +6,10 @@ #version 430 core @else #version 330 core + + @property( !hlms_readonly_is_tex ) + #extension GL_ARB_shader_storage_buffer_object: require + @end @end @end From 3bf3a640b24350e73f7d6c704e27c18ef51cdc97 Mon Sep 17 00:00:00 2001 From: Zaidhaan Date: Tue, 23 May 2023 21:08:33 +0800 Subject: [PATCH 3/6] Fix missing header in latest gcc build (#853) Signed-off-by: Zaidhaan Hussain Co-authored-by: Ian Chen --- include/gz/rendering/GraphicsAPI.hh | 1 + 1 file changed, 1 insertion(+) diff --git a/include/gz/rendering/GraphicsAPI.hh b/include/gz/rendering/GraphicsAPI.hh index 8039ef6ba..8a1089d85 100644 --- a/include/gz/rendering/GraphicsAPI.hh +++ b/include/gz/rendering/GraphicsAPI.hh @@ -18,6 +18,7 @@ #define GZ_RENDERING_GRAPHICSAPI_HH_ #include +#include #include "gz/rendering/config.hh" #include "gz/rendering/Export.hh" From b0636118da33d252b374bc8ca0c24bcd3bf0e03d Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 23 May 2023 09:26:03 -0500 Subject: [PATCH 4/6] Fix missing header (#855) Signed-off-by: Michael Carroll --- src/CameraLens.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CameraLens.cc b/src/CameraLens.cc index b966f6849..39dfa80c2 100644 --- a/src/CameraLens.cc +++ b/src/CameraLens.cc @@ -15,6 +15,7 @@ * */ +#include #include #include #include From a18de246ccf467d17c3990b986fb4b171feb0fd1 Mon Sep 17 00:00:00 2001 From: shameekganguly Date: Mon, 5 Jun 2023 03:12:44 -0700 Subject: [PATCH 5/6] Minor cleanup of ogre/ogre2 (#858) Signed-off-by: Shameek Ganguly --- ogre/src/OgreProjector.cc | 5 ++--- ogre/src/OgreRenderEngine.cc | 2 +- ogre2/src/Ogre2RayQuery.cc | 2 -- ogre2/src/terrain/Terra/src/Terra.cpp | 1 + 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ogre/src/OgreProjector.cc b/ogre/src/OgreProjector.cc index 6744428dc..77420633b 100644 --- a/ogre/src/OgreProjector.cc +++ b/ogre/src/OgreProjector.cc @@ -444,7 +444,7 @@ std::unordered_set OgreProjectorListener::FindVisibleMaterials() ///////////////////////////////////////////////// void OgreProjectorListener::AddDecalToVisibleMaterials() { - auto newVisibleMaterials = std::move(this->FindVisibleMaterials()); + auto newVisibleMaterials = this->FindVisibleMaterials(); this->AddDecalToMaterials(newVisibleMaterials); } @@ -652,8 +652,7 @@ void OgreProjectorListener::SetVisibilityFlags(uint32_t _flags) ///////////////////////////////////////////////// void OgreProjectorListener::UpdateVisibleMaterials() { - this->visibleMaterials = - std::move(this->FindVisibleMaterials()); + this->visibleMaterials = this->FindVisibleMaterials(); } ///////////////////////////////////////////////// diff --git a/ogre/src/OgreRenderEngine.cc b/ogre/src/OgreRenderEngine.cc index f73a4edc1..c77287c1a 100644 --- a/ogre/src/OgreRenderEngine.cc +++ b/ogre/src/OgreRenderEngine.cc @@ -843,5 +843,5 @@ OgreRenderEngine *OgreRenderEngine::Instance() } // Register this plugin -GZ_ADD_PLUGIN(OgreRenderEnginePlugin, +GZ_ADD_PLUGIN(rendering::OgreRenderEnginePlugin, rendering::RenderEnginePlugin) diff --git a/ogre2/src/Ogre2RayQuery.cc b/ogre2/src/Ogre2RayQuery.cc index 8d7684c9e..180f7d916 100644 --- a/ogre2/src/Ogre2RayQuery.cc +++ b/ogre2/src/Ogre2RayQuery.cc @@ -128,8 +128,6 @@ void Ogre2RayQuery::SetFromCamera(const CameraPtr &_camera, ////////////////////////////////////////////////// RayQueryResult Ogre2RayQuery::ClosestPoint(bool _forceSceneUpdate) { - RayQueryResult result; - if (!this->dataPtr->camera || !this->dataPtr->camera->Parent() || std::this_thread::get_id() != this->dataPtr->threadId) diff --git a/ogre2/src/terrain/Terra/src/Terra.cpp b/ogre2/src/terrain/Terra/src/Terra.cpp index 4e85f0437..8f609cdf3 100644 --- a/ogre2/src/terrain/Terra/src/Terra.cpp +++ b/ogre2/src/terrain/Terra/src/Terra.cpp @@ -30,6 +30,7 @@ THE SOFTWARE. #include "Terra/TerraShadowMapper.h" #include "Terra/Hlms/OgreHlmsTerra.h" +#include "Terra/Hlms/OgreHlmsTerraDatablock.h" #include "OgreImage2.h" From e39e10f70c7bb6e30219272a0abfe630793f4aa8 Mon Sep 17 00:00:00 2001 From: shameekganguly Date: Mon, 5 Jun 2023 06:34:30 -0700 Subject: [PATCH 6/6] Replace ignerr with gzerr (#857) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Shameek Ganguly Co-authored-by: Alejandro Hernández Cordero --- ogre/src/OgreNode.cc | 4 ++-- ogre2/src/Ogre2Node.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ogre/src/OgreNode.cc b/ogre/src/OgreNode.cc index 26ca823f7..4d1a83568 100644 --- a/ogre/src/OgreNode.cc +++ b/ogre/src/OgreNode.cc @@ -106,8 +106,8 @@ void OgreNode::SetRawLocalPosition(const math::Vector3d &_position) // the length of the position vector. if (dynamic_cast(this) && _position.Length() > 1e8) { - ignerr << "Unable to set camera node position to a distance larger than " - << "1e8 from origin" << std::endl; + gzerr << "Unable to set camera node position to a distance larger than " + << "1e8 from origin" << std::endl; return; } this->ogreNode->setPosition(OgreConversions::Convert(_position)); diff --git a/ogre2/src/Ogre2Node.cc b/ogre2/src/Ogre2Node.cc index a211ef71f..fc1ea2db3 100644 --- a/ogre2/src/Ogre2Node.cc +++ b/ogre2/src/Ogre2Node.cc @@ -116,8 +116,8 @@ void Ogre2Node::SetRawLocalPosition(const math::Vector3d &_position) // the length of the position vector. if (dynamic_cast(this) && _position.Length() > 1e9) { - ignerr << "Unable to set camera node position to a distance larger than " - << "1e9 from origin" << std::endl; + gzerr << "Unable to set camera node position to a distance larger than " + << "1e9 from origin" << std::endl; return; } this->ogreNode->setPosition(Ogre2Conversions::Convert(_position));