Render ViewportQuad under other primitives

Hi,

I'm using ViewportQuad to draw a rectangle with some textures on the screen.
Currently the drawn rectangle is the top most thing visible on the canvas.

Is it possible to draw the rectangle above the globe but beneath all of the primitives/entities?
If not, is it possible to achieve the same result with another method?

Thanks.

Hi,

This sounds like a unique use case. What kind of app are you working on?

The ViewportQuad is explicitly drawn as an overlay after all the 3D elements are drawn. For example, see

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/ViewportQuad.js#L144

You may be able to change this from Pass.OVERLAY to Pass.OPAQUE (or Pass.TRANSLUCENT); however, you would be using both private and undocumented Cesium features, which could change from release to release.

Patrick

Hey Patrick, thanks for the response.

We are trying to present some kind of a video layer above the globe.

I've tried your solution, unfortunately the ViewportQuad is shown above the billboards (but indeed above the translucent primitives).

Any idea how to push it down below the billboards as well?

Thanks.

Hi,

Don’t rely on this behavior in future versions of Cesium, but if you add the ViewportQuad to scene.primitives before the billboards, it will be rendered before them, and probably fix your issue.

Patrick