-
Notifications
You must be signed in to change notification settings - Fork 214
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
Add dynamic screen space error #466
Conversation
frustum.computeScreenSpaceError(tile.getGeometricError(), distance); | ||
if (_options.enableDynamicScreenSpaceError) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the main code that applies dynamic SSE. The calcDynamicSSEDensity()
isn't used currently. You can see the graph of the formula in this desmos https://www.desmos.com/calculator/qtajjjczqc
In the graph above,
m -> camera height
c -> the minimum height that dynamic SSE will takes effect
f -> the maximum height to remove dynamic SSE
a -> the near distance to apply dynamic SSE
b -> the far distance where we aggressively choose the coarse tile
Once this dynamic SSE is something we should add, I can properly rework the PR. It's just the prototype quality currently though |
Related to #342 |
Thanks again for your contribution @baothientran! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with |
See the Unreal side of this, with more discussion: |
Thanks again for your contribution @baothientran! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with |
6 similar comments
Thanks again for your contribution @baothientran! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with |
Thanks again for your contribution @baothientran! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with |
Thanks again for your contribution @baothientran! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with |
Thanks again for your contribution @baothientran! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with |
Thanks again for your contribution @baothientran! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with |
Thanks again for your contribution @baothientran! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with |
Thanks again for your contribution @baothientran! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with |
@baothientran and @kring Feel free to reopen, if you want to. |
This PR experiments with dynamic screen space error that is implemented in CesiumJS [here] (https://github.com/CesiumGS/cesium/blob/a0c6ff34dff12ffede139e8978260cd9ba5c9d15/Source/Scene/Cesium3DTileset.js#L2208)
However, this deviates from the CesiumJS implementation a little bit. In the CesiumJS, it uses fog functions to control the sse based on distance between the camera and tile. The further the tile is away from camera, the more coarse the tile is going to get compared to its original sse. But the fog function doesn't allow the user to configure the near distance at which we want to apply dynamic SSE. This PR uses the Hermite interpolation or smoothstep() to do that. Also the fog function and hermite is quite pretty similar for x > 0. e.g https://www.desmos.com/calculator/bvcofnekxw
Also in CesiumJS, it automatically tries to configure the minimum height and max height of the root to apply dynamic SSE. Outside of that range, dynamic SSE will not apply. But that doesn't work for tileset that covers the whole earth, so I opt it to be a parameter to let the user set by themselves. The CesiumJS method can be implemented by client if desired though.