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

Billboard jitters when modifying imageSubRegion #11569

Closed
syzdev opened this issue Oct 18, 2023 · 4 comments
Closed

Billboard jitters when modifying imageSubRegion #11569

syzdev opened this issue Oct 18, 2023 · 4 comments
Labels
needs feedback On hold until additional info is supplied

Comments

@syzdev
Copy link
Contributor

syzdev commented Oct 18, 2023

I want to use CallbackProperty to modify imageSubRegion to implement dynamic Billboard, but I find that when the width and height of Billboard.image are large enough, Billboard will jitter after modifying imageSubRegion. And the larger the width and height of Billboard.image, the more violent the jitter.

I implemented a simple case to reproduce this problem, in this case I repeatedly drew a 128*128 image whiteShapes.png on the Canvas, and then used the CallbackProperty to modify the imageSubRegion to get a BoundingRectangle at different positions (Although different BoundingRectangle will get the same image content).
ss1

In the picture below, the width and height of Canvas are 6400. The picture has been drawn for a total of 2500 times, and you can see that the jitter is very obvious.
GIF

In the picture below, the width and height of Canvas are 512. The picture has been drawn for a total of 16 times, and you can see that it is very calm.
GIF2

You can modify NumberOfRepeats in the sample code to see different situations. Jitter starts when NumberOfRepeats >= 5 in
my computer.

Sandcastle example: Cesium Sandcastle

Browser: Latest versions of Chrome

Operating System: Windows 11

@ggetz
Copy link
Contributor

ggetz commented Oct 18, 2023

Thanks for the report @syzdev.

I'm seeing some flickering at a size of 512, although it's less apparent than the flickering at larger sizes.

I implemented a simple case to reproduce this problem, in this case I repeatedly drew a 128*128 image on the Canvas, and then used the CallbackProperty to modify the imageSubRegion to get a BoundingRectangle at different positions.

Would you mind explaining your use case? There may be a better way to achieve a similar end result.

@ggetz ggetz added the needs feedback On hold until additional info is supplied label Oct 18, 2023
@syzdev
Copy link
Contributor Author

syzdev commented Oct 18, 2023

@ggetz Thank you for your attention!

I want to add dynamic images to the scene (such as .gif), and there are currently two implementation methods that I can think of:

  1. HTML Overlays: However, this method places dynamic images outside the scene and cannot interact with the scene.
  2. Billboard: The inspiration for all of this comes from #2319. Although this discussion has been going on for a long time, the implementation method is still feasible, but the problem described above may occur when the Canvas size is too large.

In the example provided by @mramato, due to the smaller image size and fewer frames, the Canvas size ultimately handed over to Billboard was not large, so this issue did not occur.

@ggetz
Copy link
Contributor

ggetz commented Oct 18, 2023

Got it, thanks @syzdev!

I think is likely something we'd address as part of support for #2319. I would suggest moving this discussion there.

We're also happy to take intermediate PRs if you have the bandwidth to contribute. 😄

@syzdev
Copy link
Contributor Author

syzdev commented Oct 19, 2023

Note: This may be a precision loss issue due to compression of texture coordinates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs feedback On hold until additional info is supplied
Projects
None yet
Development

No branches or pull requests

2 participants