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

Two arrow heads for polyline arrow material #628

Open
pjcozzi opened this issue Apr 11, 2013 · 11 comments
Open

Two arrow heads for polyline arrow material #628

pjcozzi opened this issue Apr 11, 2013 · 11 comments

Comments

@pjcozzi
Copy link
Contributor

pjcozzi commented Apr 11, 2013

Run the polyline Sandcastle example, switch to Columbus view, and zoom in on the polyline with the arrow material. On AMD at least, I see two arrows:

image

@raviagrwl420
Copy link
Contributor

Polylines - Cesium Sandcastle
I am unable to reproduce this bug is there something I'm doing wrong?
I think it may have something to do with AMD as you said..

@bagnell
Copy link
Contributor

bagnell commented Apr 12, 2013

@macoda The bug is in the latest version in master.

@pjcozzi I was able to reproduce the bug on NVidia. It happens when the line is drawn in multiple frustums and the line is clipped to the near plane of the farther frustum.

@raviagrwl420
Copy link
Contributor

Thanks @bagnell I was able to reproduce the bug. It is present not just in the columbus view but also in the 3D Globe view.

Polylines - Cesium Sandcastle 1

@nmschulte-aviture
Copy link
Contributor

It appears this bug still exists. This is from the Materials Sandcastle example.

The distance to the line matters, as does the angle:
cap

And, I was able to get it to render more than two arrow heads at extreme angles:
cap

This is on Intel hardware (GNU/Linux, Chromium v43), though it seems this is something in the material [shader] and not hardware specific.

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile 
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.5.8

@hpinkos
Copy link
Contributor

hpinkos commented Jul 28, 2015

@bagnell this happens in 3D and columbus view

Here's an example in 3D:

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

var polylines = scene.primitives.add(new Cesium.PolylineCollection());
var polyline = polylines.add({
    positions : Cesium.PolylinePipeline.generateCartesianArc({
        positions : Cesium.Cartesian3.fromDegreesArray([-110.0, 42.0,
                                                        -85.0, 36.0,
                                                        -100.0, 25.0,
                                                        -77.0, 12.0])
    }),
    width : 10.0,
    material: Cesium.Material.fromType('PolylineArrow')
});

viewer.camera.setView({
    destination: new Cesium.Cartesian3(1404234.8527806934, -6079977.723369969, 1316874.3368459751),
    orientation: {
        heading: 5.474598641469072,
        pitch: -0.3385580768913532,
        roll: 6.282147026410673
    }
});

@bagnell
Copy link
Contributor

bagnell commented Oct 20, 2016

The problem is clipping the line segments to the near planes of the multifrustum. For example, if the near plane of the multifrustum intersects a line segment and vertices of the line segment have the x texture coordinates 0.0 and 1.0, the vertex with x texture coordinate is 1.0 could be clipped to the near plane. This would draw the arrow head at the near plane in one frustum and again in the closer frustum.

The solution would be to add extra texture coordinates for the adjacent vertices and interpolate at the clipped point. Another idea is to have all of the vertex data in the batch table and add indices to look up the vertex data at the current vertex and the adjacent vertices.

@hpinkos
Copy link
Contributor

hpinkos commented Oct 3, 2017

@ggetz
Copy link
Contributor

ggetz commented Oct 19, 2017

@ggetz
Copy link
Contributor

ggetz commented Aug 2, 2018

Looks like this was mostly resolved with log depth as I don't see multiple arrowheads, but there are some artifacts on the arrowhead itself at extreme angles:

image

@hpinkos
Copy link
Contributor

hpinkos commented Aug 2, 2018

No, I definitely saw two arrow heads last week sometime

@mramato
Copy link
Contributor

mramato commented Aug 2, 2018

Log depth reduces the likelyhood of multiple frustums, which makes the bug less command, but there will always be cases with multiple frustums (especially when log depth off) so the root cause of the issue is still there.

@hpinkos hpinkos changed the title Two arrow heads in Columbus view Two arrow heads for polyline arrow material Aug 25, 2020
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

7 participants