-
Notifications
You must be signed in to change notification settings - Fork 53
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
Port custom materials to Hlms pieces #504
Comments
yeah that'll be nice go with the recommended way. Originally, we tried material schemes but couldn't get it to work in ogre 2.1. We then resorted to this workaround and have been doing it in many places of our code, e.g. MaterialSwitcher used by selection buffer. So it would nice to go with the proper solution. |
Affects gazebosim#504 Signed-off-by: Matias N. Goldberg <[email protected]>
The changes are currently on https://github.com/darksylinc/ign-rendering/tree/matias-hlmsCustom A few takes:
|
Segmentation camera is already working! I couldn't believe it worked on first try. I was suspicious at first and... it wasn't working 🤣 Things missing:
Update: While going through this PR I noticed that currently hlmsPbs->setListener(this->dataPtr->hlmsPbsTerraShadows.get());
hlmsPbs->setListener(&this->dataPtr->hlmsCustomizations); // err.. only one can be set as they were merged as separate Pull Requests. I will harmonize them in the PR. But as for refactoring Ogre2SelectionBuffer, Ogre2ThermalCameraMaterialSwitcher, Ogre2LaserRetroMaterialSwitcher and possibly others; I will very likely split them into another PR. Otherwise a single PR could become too large (touches too many files, a silly bug could be introduced that would block the entire merge) making it hard to review. (*) As for Fortress, personally I'd say |
I have a question (I think I'm already answering myself): I wish to rename the class The rename should happen in the PR? If I do it now, it would make review harder, not to mention a whole file (Ogre2IgnHlmsCustomizations.hh and Ogre2IgnHlmsCustomizations.cc) would have to be renamed. Since it's a simple rename, it should be split into its own standalone PR, right? Update: I've decided to put it in its own standalone PR |
Affects gazebosim#504 Signed-off-by: Matias N. Goldberg <[email protected]>
Ogre2IgnHlmsCustomizations rename is in branch matias-hlmsCustom2 |
I just tried disabling the
yep that sounds good to me. |
Understood (note that it affects Fortress). I do have something to raise though: Enabling Ogre2IgnHlmsCustomizations makes void Ogre2DepthCamera::Render()
{
#ifndef _WIN32
if (useGL)
glEnable(GL_DEPTH_CLAMP);
#endif
...
#ifndef _WIN32
if (useGL)
glDisable(GL_DEPTH_CLAMP);
#endif
} Thus if you remove it, you will probably get the same results as having |
for |
Affects gazebosim#504 Signed-off-by: Matias N. Goldberg <[email protected]>
This ticket is almost done except we're missing porting Ogre2ThermalCameraMaterialSwitcher and Terrain. Terrain should be a piece of cake. Ogre2ThermalCameraMaterialSwitcher will be a more difficult because it has two materials: solid colour (easy) and a texture variation. I'm tempted to leave the texture variation using a V1 material. That will depend on how easy/difficult it ends up being. |
OK Solid colour and background are covered via Hlms pieces. The things that remain are:
By the next weekend the final PR should be ready for submission. Let's hope #534 is merged by then :) |
This is fixed by #545. |
Desired behavior
Right now specific passes such as the Segmentation Camera iterates through all objects, changes their material to a custom low level materials, and renders that.
This works but has a few issues:
Ogre +2.1 supports Hlms pieces, which allows users to add custom code that can be run before/during/after our default code runs.
This solves all outstanding issues:
Alternatives considered
This is the recommended way.
Implementation suggestion
I'll be the one implementing this feature
Additional context
The text was updated successfully, but these errors were encountered: