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

Large missing section of primitive when switching from 3D to Columbus View #3748

Closed
hpinkos opened this issue Mar 22, 2016 · 7 comments
Closed

Comments

@hpinkos
Copy link
Contributor

hpinkos commented Mar 22, 2016

Reported on the forum: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/5A1-br_4iu4

The first example is 3D -> CV
artifact

The second example is 2D -> 3D -> CV
artifact2

As far as I can tell, this was introduced in 1.17
Run this example, and change the scene mode to 3D and then to CV. Then tilt the map to see the artifact.

var viewer = new Cesium.Viewer('cesiumContainer', {sceneMode: Cesium.SceneMode.SCENE2D});

viewer.entities.add({
    rectangle : {
        coordinates : Cesium.Rectangle.fromDegrees(-170.0, -80.0, 170.0, 90.0),
        material : Cesium.Color.YELLOW.withAlpha(0.5),
    }
});
@hpinkos
Copy link
Contributor Author

hpinkos commented Mar 22, 2016

@pjcozzi would you consider this a show stopper?

@pjcozzi
Copy link
Contributor

pjcozzi commented Mar 22, 2016

I can confirm this was introduced in 1.17. It can also be reproduced by running the following example and switching to CV:

var viewer = new Cesium.Viewer('cesiumContainer');

viewer.entities.add({
    rectangle : {
        coordinates : Cesium.Rectangle.fromDegrees(-170.0, -80.0, 170.0, 90.0),
        material : Cesium.Color.YELLOW.withAlpha(0.5),
    }
});

@bagnell and I are working on too many other pressing things to look at this in detail right now.

@pjcozzi
Copy link
Contributor

pjcozzi commented Mar 24, 2016

I think the same problem can be seen with labels in 2D in the Picking Sandcastle example:

ok

@santilland
Copy link
Contributor

Hi, so i really wanted to have a solution for this so i went hunting a little bit. The issue was introduced in commit 62c63bc
I cant quite figure out what happened, because from what i see it is just renaming and separating the updatePrimitives funtion into two functions (updatePrimitives and updateEnvironment).
In any case the clipping issue has to do with the useDepthPlane.
If you remove the if statement in line 1604 of Scene.js (62c63bc#diff-fb63af82386df4a707d9fcfb196c35fcR1604) everything seems to work as expected.
If scene._depthPlane.update(frameState); is never called it also removes the clipping but i imagine then in 3D the depth plane is not used loosing performance.
Hope this helps getting the solution into the next release :) regards!

@Lighfer
Copy link

Lighfer commented Aug 2, 2022

The problem arises again:sandcastle

@Lighfer
Copy link

Lighfer commented Aug 2, 2022

The problem arises again:sandcastle

Based on testing, this issue was reintroduced from 1.80

@Lighfer
Copy link

Lighfer commented Aug 2, 2022

I found that the problem was solved by modifying file ShadowVolumeAppearanceFS like this

// line 79
if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {
// change to
if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || (logDepthOrDepth != 0.0 && czm_sceneMode != czm_sceneMode2D)) {

// line 92
if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {
// chang to
if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || (logDepthOrDepth == 0.0 && czm_sceneMode != czm_sceneMode2D)) {

@pjcozzi Is this a correct solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants