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

Extend ShaderParam system to support textures #1310

Merged
merged 16 commits into from
Feb 9, 2022

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Jan 25, 2022

Signed-off-by: Ian Chen [email protected]

🎉 New feature

depends on:

Summary

This PR updates the ShaderParam system (introduced in #1275) with the ability to parse texture params and pass them to custom shaders

Easier to review without white space diff:

https://github.com/ignitionrobotics/ign-gazebo/pull/1310/files?w=1

Test it

To test, launch the shader_param.sdf example world. It should download the Waves model from Fuel and render it correctly:

ign gazebo -v 4 shader_param.sdf

shader_param_waves

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@iche033 iche033 requested a review from chapulina as a code owner January 25, 2022 05:14
@iche033 iche033 added needs upstream release Blocked by a release of an upstream library 🏯 fortress Ignition Fortress labels Jan 25, 2022
@chapulina chapulina added the rendering Involves Ignition Rendering label Jan 25, 2022
Base automatically changed from visual_plugin to ign-gazebo6 February 4, 2022 01:40
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
@codecov
Copy link

codecov bot commented Feb 4, 2022

Codecov Report

Merging #1310 (11f5c28) into ign-gazebo6 (83f2f74) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##           ign-gazebo6    #1310   +/-   ##
============================================
  Coverage        62.06%   62.07%           
============================================
  Files              278      278           
  Lines            23378    23378           
============================================
+ Hits             14510    14511    +1     
+ Misses            8868     8867    -1     
Impacted Files Coverage Δ
src/EntityComponentManager.cc 88.38% <0.00%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83f2f74...11f5c28. Read the comment docs.

@scpeters scpeters removed the needs upstream release Blocked by a release of an upstream library label Feb 7, 2022
@scpeters scpeters requested a review from WilliamLewww February 7, 2022 19:45
@WilliamLewww
Copy link
Contributor

I'm running into a segfault:

#31   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3ba868, in void std::_Bind<void (ignition::gazebo::v6::SimulationRunner::*(ignition::gazebo::v6::SimulationRunner*, std::_Placeholder<1>, std::_Placeholder<2>))(unsigned long, std::shared_ptr<sdf::v12::Element> const&)>::__call<void, unsigned long&&, std::shared_ptr<sdf::v12::Element>&&, 0ul, 1ul, 2ul>(std::tuple<unsigned long&&, std::shared_ptr<sdf::v12::Element>&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>)
#30   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3c05a4, in std::__invoke_result<void (ignition::gazebo::v6::SimulationRunner::*&)(unsigned long, std::shared_ptr<sdf::v12::Element> const&), ignition::gazebo::v6::SimulationRunner*&, unsigned long, std::shared_ptr<sdf::v12::Element> >::type std::__invoke<void (ignition::gazebo::v6::SimulationRunner::*&)(unsigned long, std::shared_ptr<sdf::v12::Element> const&), ignition::gazebo::v6::SimulationRunner*&, unsigned long, std::shared_ptr<sdf::v12::Element> >(void (ignition::gazebo::v6::SimulationRunner::*&)(unsigned long, std::shared_ptr<sdf::v12::Element> const&), ignition::gazebo::v6::SimulationRunner*&, unsigned long&&, std::shared_ptr<sdf::v12::Element>&&)
#29   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3c7425, in void std::__invoke_impl<void, void (ignition::gazebo::v6::SimulationRunner::*&)(unsigned long, std::shared_ptr<sdf::v12::Element> const&), ignition::gazebo::v6::SimulationRunner*&, unsigned long, std::shared_ptr<sdf::v12::Element> >(std::__invoke_memfun_deref, void (ignition::gazebo::v6::SimulationRunner::*&)(unsigned long, std::shared_ptr<sdf::v12::Element> const&), ignition::gazebo::v6::SimulationRunner*&, unsigned long&&, std::shared_ptr<sdf::v12::Element>&&)
#28   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe399c02, in ignition::gazebo::v6::SimulationRunner::LoadPlugins(unsigned long, std::shared_ptr<sdf::v12::Element> const&)
#27   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe398d06, in ignition::gazebo::v6::SimulationRunner::LoadPlugin(unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<sdf::v12::Element> const&)
#26   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3963e7, in ignition::gazebo::v6::SimulationRunner::AddSystem(ignition::plugin::TemplatePluginPtr<ignition::plugin::SpecializedPlugin<ignition::gazebo::v6::System, ignition::gazebo::v6::ISystemConfigure, ignition::gazebo::v6::ISystemPreUpdate, ignition::gazebo::v6::ISystemUpdate, ignition::gazebo::v6::ISystemPostUpdate> > const&, std::optional<unsigned long>, std::optional<std::shared_ptr<sdf::v12::Element const> >)
#25   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3966ba, in ignition::gazebo::v6::SimulationRunner::AddSystemImpl(ignition::gazebo::v6::SystemInternal, std::optional<unsigned long>, std::optional<std::shared_ptr<sdf::v12::Element const> >)
#24   Object "/ignition-ws/shared/ign-fortress/install/lib/ign-gazebo-6/plugins/libignition-gazebo-shader-param-system.so", at 0x7fc2ce368b3c, in ignition::gazebo::v6::systems::ShaderParam::Configure(unsigned long const&, std::shared_ptr<sdf::v12::Element const> const&, ignition::gazebo::v6::EntityComponentManager&, ignition::gazebo::v6::EventManager&)
#23   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f531b, in ignition::gazebo::v6::asFullPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#22   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f7f43, in std::filesystem::__cxx11::path::~path()
#21   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f808a, in std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::~vector()
#20   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f8e2e, in void std::_Destroy<std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt>(std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt*, std::allocator<std::filesystem::__cxx11::path::_Cmpt>&)
#19   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f99bd, in void std::_Destroy<std::filesystem::__cxx11::path::_Cmpt*>(std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt*)
#18   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3fa1f8, in void std::_Destroy_aux<false>::__destroy<std::filesystem::__cxx11::path::_Cmpt*>(std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt*)
#17   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3fa6cc, in void std::_Destroy<std::filesystem::__cxx11::path::_Cmpt>(std::filesystem::__cxx11::path::_Cmpt*)
#16   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3fa6ad, in std::filesystem::__cxx11::path::_Cmpt::~_Cmpt()
#15   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f7f43, in std::filesystem::__cxx11::path::~path()
#14   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f808a, in std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::~vector()
#13   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f8e2e, in void std::_Destroy<std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt>(std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt*, std::allocator<std::filesystem::__cxx11::path::_Cmpt>&)
#12   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f99bd, in void std::_Destroy<std::filesystem::__cxx11::path::_Cmpt*>(std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt*)
#11   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3fa1f8, in void std::_Destroy_aux<false>::__destroy<std::filesystem::__cxx11::path::_Cmpt*>(std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt*)
#10   Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3fa6cc, in void std::_Destroy<std::filesystem::__cxx11::path::_Cmpt>(std::filesystem::__cxx11::path::_Cmpt*)
#9    Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3fa6ad, in std::filesystem::__cxx11::path::_Cmpt::~_Cmpt()
#8    Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f7f43, in std::filesystem::__cxx11::path::~path()
#7    Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f808a, in std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::~vector()
#6    Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f8e2e, in void std::_Destroy<std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt>(std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt*, std::allocator<std::filesystem::__cxx11::path::_Cmpt>&)
#5    Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f99bd, in void std::_Destroy<std::filesystem::__cxx11::path::_Cmpt*>(std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt*)
#4    Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3fa1f8, in void std::_Destroy_aux<false>::__destroy<std::filesystem::__cxx11::path::_Cmpt*>(std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt*)
#3    Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3fa6cc, in void std::_Destroy<std::filesystem::__cxx11::path::_Cmpt>(std::filesystem::__cxx11::path::_Cmpt*)
#2    Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3fa6ad, in std::filesystem::__cxx11::path::_Cmpt::~_Cmpt()
#1    Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f7f43, in std::filesystem::__cxx11::path::~path()
#0    Object "/ignition-ws/shared/ign-fortress/install/lib/libignition-gazebo6.so.6", at 0x7fc2fe3f8075, in std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::~vector()

The waves model has been successfully downloaded from fuel but I think it is having trouble trying to load the shaders. I can try again on a different machine to see if I get the same result.

@iche033
Copy link
Contributor Author

iche033 commented Feb 9, 2022

I have not been able to reproduce this yet.

From discussion offline, rebuilding the workspace with gcc 9.3.0 could potentially resolve this issue.

@WilliamLewww
Copy link
Contributor

I have not been able to reproduce this yet.

From discussion offline, rebuilding the workspace with gcc 9.3.0 could potentially resolve this issue.

Compiling everything with gcc 9.3.0 worked!

@osrf-triage
Copy link

This pull request has been mentioned on Gazebo Community. There might be relevant details there:

https://community.gazebosim.org/t/new-ignition-releases-2022-03-01-citadel-edifice-fortress/1313/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress rendering Involves Ignition Rendering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants