-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add Ogre2Heightmap functionality #386
Conversation
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Co-authored-by: Michael Carroll <[email protected]> Signed-off-by: ahcorde <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
…ign-rendering into ahcorde/update/ogre2.2
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: ahcorde <[email protected]>
…obotics/ign-rendering into ahcorde/update/ogre2.2
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: ahcorde <[email protected]>
…ardware gamma to fix dark sky color Signed-off-by: Ian Chen <[email protected]>
* Local updates for Ogre2.2 against main branch Signed-off-by: Ian Chen <[email protected]> Co-authored-by: Ian Chen <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
I merged with main and fixed the merge conflicts. However this now causes DCO check to fail I've also updated to latest Hlms files to fix the compiler error when using shadow mapping; these files also add the missing support for |
It can be forced to pass in this case. It gets a little picky when merge commits and rebases happen. |
I pulled the latest changes and rebuilt the workspace and no more crashes! I still get the same output as the one in: #386 (comment), and I verified that I have the fix. Let me know if you're able to reproduce it. |
Signed-off-by: Matias N. Goldberg <[email protected]>
Update Terra to latest from upstream Signed-off-by: Matias N. Goldberg <[email protected]>
Terra's workspace listener was being executed before the camera is rotated for cubemap rendering Signed-off-by: Matias N. Goldberg <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lights + shadows are working well for me now! Can you add the point light to the demo?
To get green builds, we'll need to suppress compile warnings coming from the terra
directory. I think this works:
diff --git a/ogre2/src/terrain/Terra/CMakeLists.txt b/ogre2/src/terrain/Terra/CMakeLists.txt
index 7dbf9683..531a7763 100644
--- a/ogre2/src/terrain/Terra/CMakeLists.txt
+++ b/ogre2/src/terrain/Terra/CMakeLists.txt
@@ -12,6 +12,13 @@ if(IGN_ADD_fPIC_TO_LIBRARIES AND NOT _ign_add_library_INTERFACE)
target_compile_options(${PROJECT_NAME} PRIVATE -fPIC)
endif()
+target_compile_options(${PROJECT_NAME} PRIVATE
+ -Wno-unused-parameter
+ -Wno-float-equal
+ -Wno-sign-compare
+ -Wno-strict-aliasing)
+add_definitions(-DOGRE_IGNORE_UNKNOWN_DEBUG)
Can you address the remaining comments from @ahcorde?
: public BaseHeightmap<Ogre2Geometry> | ||
{ | ||
/// \brief Constructor | ||
public: explicit Ogre2Heightmap(const HeightmapDescriptor &_desc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like Parameters that describe how a heightmap should be loaded.
should suffice.
this is needed to fix: https://github.com/ignitionrobotics/ign-rendering/pull/386/checks?check_run_id=3576496054
public: virtual void PreRender() override; | ||
|
||
/// \brief Returns NULL, heightmaps don't have movable objects. | ||
/// \return Null pointer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true in ogre 1.x but looking at the Ogre2Heightmap::OgreObject() implementation, it returns an Ogre::Terra
object. Can you update the comment here @darksylinc ?
|
||
/// \brief Returns NULL, heightmap materials don't inherit from | ||
/// MaterialPtr. | ||
/// \return Null pointer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, looks like still always returns null. Textures are specified through HeightmapDescriptor
vNormal += cross( (vNN - v00), (vN0 - v00) ); | ||
vNormal += cross( (vN0 - v00), (v01 - v00) ); | ||
|
||
// vNormal += cross( (v01 - v00), (v11 - v00) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file came from ogre-next samples. We can leave the comment here to minimize diff with upstream version.
ok that's fine. We'll likely play with different bias values if needed, which is what we've done in the past but it was always hard to find something that works for all cases. |
Silence warnings from external code to pass build checks Signed-off-by: Matias N. Goldberg <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
I made some changes in the If that looks good to you, can you merge with that branch? That should make CI green. |
All good. Changes pushed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI looks good.
I'll address a couple of small style comments in a separate PR.
Need to get this in for pre-release
will address remaining comments in a separate PR.
🎉 New feature
Closes #187
Summary
This PR adds Terra samples' code and integrates it into Gazebo to provide Heightmap functionality.
It's yet missing the ability for terrain to cast shadows coming from spot and point lights (only directional lights cast terrain shadows onto everything). This feature will come later. The code is ready but integration with ign-rendering is not and due to time constraints (Fortress feature freeze) it's being submitted for review.
Note: All code under
ogre2/src/terrain
folder should be considered external code.Test it
There are not many ways to test heightmap in Gazebo AFAIK. Build ign-rendering normally then:
ign-rendering/examples/heightmap
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge