gazebosim / gazebosim/gz-rendering
Port Ambient Occlusion plugin from gazebo-classic
- Dominant language
- C++
- Stars
- 81
- Forks
- 90
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 10
Description
## Desired behavior
Port the Ambient Occlusion plugin from gazebo-classic to gz-rendering and offer an API to create ambient occlusion for a scene
## Alternatives considered
Implement a new ambient occlusion method directly in gz-rendering
## Implementation suggestion
Start off by porting the ambient occlusion plugin from gazebo-classic to `ogre` (ogre 1.x implementation in gz-rendering):
Source code:
* [AmbientOcclusionVisualPlugin.cc](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/plugins/AmbientOcclusionVisualPlugin.cc)
* [AmbientOcclusionVisualPlugin.hh](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/plugins/AmbientOcclusionVisualPlugin.hh)
Media files:
* [CreaseShading.material](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/media/materials/scripts/CreaseShading.material)
* [CreaseShading.compositor](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/media/materials/scripts/CreaseShading.compositor)
* [Modulate.material](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/media/materials/scripts/Modulate.material)
* [GBuffer.material](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/media/materials/scripts/GBuffer.material)
* [SSAOPost.material](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/media/materials/scripts/SSAOPost.material)
* [SSAOPost.compositor](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/media/materials/scripts/SSAOPost.compositor)
* [StdQuad_vp.program](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/media/materials/scripts/StdQuad_vp.program)
* [CreaseShadingFP.glsl](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/media/materials/programs/CreaseShadingFP.glsl)
* [GBufferFP.glsl](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/media/materials/programs/GBufferFP.glsl)
* [ModulateFP.glsl](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/media/materials/programs/ModulateFP.glsl)
* [NoFilterFP.glsl](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/media/materials/programs/NoFilterFP.glsl)
* [StdQuad_vp.glsl](https://github.com/gazebosim/gazebo-classic/blob/gazebo11/media/materials/programs/StdQuad_vp.glsl)
This will help fleshout the API in Scene. As of `gz-rendering8` there are currently a couple of functions to create global illumination (GI) in scene, namely [CreateGlobalIlluminationVct](https://github.com/gazebosim/gz-rendering/blob/c42123e35262e602b1a3c0c0ac8ec738e6ff7ba0/include/gz/rendering/Scene.hh#L1216), and [CreateGlobalIlluminationCiVct](https://github.com/gazebosim/gz-rendering/blob/gz-rendering8/include/gz/rendering/Scene.hh#L1246). Since ambient occlusion can be treated as an approximation of GI, we could consider having a generic API that takes a GI type like:
```cpp
GlobalIlluminationPtr Scene::CreateGlobalIllumination(unsigned int _id, const std::string &_name, GlobalIlluminationType _type)
```
After the implementation is ported to `ogre`, the code and shaders will need to be ported to `ogre2`.
## Additional context
Original pull request with screenshots: https://osrf-migration.github.io/gazebo-gh-pages/#!/osrf/gazebo/pull-requests/2916/page/1
Contributor guide
Assessment
This issue has not been assessed yet.