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

Add dynamic screen space error #466

Closed
wants to merge 1 commit into from
Closed

Add dynamic screen space error #466

wants to merge 1 commit into from

Conversation

baothientran
Copy link
Contributor

@baothientran baothientran commented Mar 23, 2022

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.

frustum.computeScreenSpaceError(tile.getGeometricError(), distance);
if (_options.enableDynamicScreenSpaceError) {
Copy link
Contributor Author

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

@baothientran
Copy link
Contributor Author

Once this dynamic SSE is something we should add, I can properly rework the PR. It's just the prototype quality currently though

@javagl
Copy link
Contributor

javagl commented Mar 25, 2022

Related to #342

@cesium-concierge
Copy link

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

@kring
Copy link
Member

kring commented May 9, 2022

See the Unreal side of this, with more discussion:
CesiumGS/cesium-unreal#798

@cesium-concierge
Copy link

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

6 similar comments
@cesium-concierge
Copy link

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

@cesium-concierge
Copy link

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

@cesium-concierge
Copy link

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

@cesium-concierge
Copy link

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

@cesium-concierge
Copy link

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

@cesium-concierge
Copy link

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

@javagl
Copy link
Contributor

javagl commented Dec 7, 2022

Does it appear reasonable to close this?

Cesium BumpittyBump

@cesium-concierge
Copy link

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

@javagl
Copy link
Contributor

javagl commented Jan 8, 2023

@baothientran and @kring Feel free to reopen, if you want to.

@javagl javagl closed this Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants