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

Override AutoParamDataSource so it can handle more than 8 shadow maps. #2967

Closed
wants to merge 6 commits into from

Conversation

mogumbo
Copy link
Contributor

@mogumbo mogumbo commented Apr 13, 2021

Ogre will render more than 8 shadow maps (I do not know if there is a limit), but AutoParamDataSource will only deliver texture_viewproj_matrix uniforms to shaders for up to 8 shadow maps. I worked around this deficiency by overriding much of AutoParamDataSource and creating a custom SceneManager and associated factory that can be used to inject it into Gazebo.

@scpeters
Copy link
Member

the Ubuntu and macOS CI jobs are using ogre 1.9.5 and look fine, while the windows CI is using ogre 1.10.12 and is currently failing as many of the methods that are virtual in the 1.9 version of OgreAutoParamDataSource.h have changed and are not virtual in 1.10.12. I think some OGRE version macros could be useful here (#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR < 10)

@iche033
Copy link
Contributor

iche033 commented Apr 14, 2021

nice, I extended spotlight_shadows_demo.world to have 8 spot lights + 1 directional light in the iche033/extend_spotlight_shadows_demo branch. It seems like it's able to access the spot light shadow textures.

@@ -23,6 +23,7 @@ set (sources
COMVisual.cc
ContactVisual.cc
Conversions.cc
CustomAutoParamDataSource.cc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can conditionally add the .cc file to sources and .hh file to headers based on the OGRE_VERSION like how the deferred_shading folder is handled later in this file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iche033
Copy link
Contributor

iche033 commented Apr 15, 2021

I extended spotlight_shadows_demo.world (heightmap_shadows.world) to have 8 spot lights + 1 directional light in the iche033/extend_spotlight_shadows_demo branch. It seems like it's able to access the spot light shadow textures.

Added another demo world in my branch to show spot light rendering and shadows over a heightmap, 555ece4, credits go to @mogumbo for actually rendering the spot lights and getting rid of the unwanted shadow artifacts!

heightmap_shadows

…1.9. Ogre 1.10 removed the ability to use it.
gazebo/rendering/ScenePrivate.hh Show resolved Hide resolved
gazebo/rendering/ScenePrivate.hh Outdated Show resolved Hide resolved
@WilliamLewww WilliamLewww self-requested a review April 27, 2021 20:04
@@ -134,6 +137,9 @@ set (headers
WrenchVisual.hh
ogre_gazebo.h
)
if (${OGRE_VERSION} VERSION_LESS 1.10)
list(APPEND headers "CustomAutoParamDataSource.hh")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does gazebo/rendering/CustomSceneManager.hh need to be installed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works without it, but it doesn't hurt to add it for completeness. Done.

@scpeters
Copy link
Member

from an external discussion, it sounds like you are building from Ogre from source, so this pull request isn't necessary. I'll close it for now, but we can revisit it in the future if there is interest

@scpeters scpeters closed this May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants