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

Update ogre2 implementation of Projector to project texture based on a frustum #848

Open
iche033 opened this issue May 16, 2023 · 0 comments
Labels
bug Something isn't working ogre2.x

Comments

@iche033
Copy link
Contributor

iche033 commented May 16, 2023

Environment

  • OS Version: Ubuntu 22.04
  • Source or binary build? Source build 91f5fe9

The projected texture in the ogre2 implementation of Projector differs from ogre1.x's and we need to update the ogre2 implementation to match ogre1.x's.

Related PR: #845

From the PR description:

  • The ogre 1.x implementation is ported from gazebo-classic's Projector class. It uses ogre material projective texturing feature.
    • in addition, I extended the implementation to support visibility flags so that we can toggle the visibility of the projected texture based on the camera's visibility mask.
  • The ogre 2.x implementation uses screen space decals (instead of projective texturing) and has a different behavior.
    Also added support for setting visibility flags.
    • Note: There is one major caveat with this implementation. The projection is not in the form of a "frustum" (i.e. projection becomes larger at longer distance). It uses ogre 2.x screen space decals. Think of a as a rectangular volume and any surface that intersects with the volume will have the texture mapped onto it.
    • We will need to investigate whether it's possible to change the implementation to match the ogre 1.x behavior in the future. Here is a related ogre forum post asking the same question. I will create an issue to track this limitation once the PR is merged.

Description

  • Expected behavior: The projected texture should be based on a frustum
  • Actual behavior: Projection is done based on a rectangular volume (bounding box)

Steps to reproduce

  1. Build and the projector example.
  2. Run with ogre2: ./projector ogre2 and see that the projection is a rectangular volume
  3. Run with ogre: ./projector ogre and see that the projector has a proper frustum, i.e. the further surface the larger the projection.

Output

See screenshots in #845

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ogre2.x
Projects
Status: To do
Development

No branches or pull requests

1 participant