Using webgl on top of cesium

975 views
Skip to first unread message

randy....@nisc.coop

unread,
Nov 22, 2013, 10:34:53 AM11/22/13
to cesiu...@googlegroups.com, rsho...@charter.net
We use OpenGL directly to render electric utility facilities on top of NASA's Worldwind product with great success and were wondering if it is possible to use webgl directly to do the same with cesium?

Patrick Cozzi

unread,
Nov 24, 2013, 11:13:03 AM11/24/13
to cesiu...@googlegroups.com, rsho...@charter.net, randy....@nisc.coop
With Cesium, there's a few options for custom rendering.  From most common (and easiest) to less common:
  • Create geometries for your data from Cesium's large geometry collection (tutorial).  This doesn't require any WebGL.
  • Create custom geometries, basically vertex and index buffers, and appearances, basically shaders and render state (partial draft tutorial).  Mix and match your own with Cesium's collection.  This can require writing GLSL shaders, but the other WebGL features are abstracted.
  • Implement a Cesium primitive, which has full access to the Cesium renderer - including vertex arrays, buffers, textures, render state, shader programs, framebuffers, etc.  A simple example is the EllipsoidPrimitive.
Even the last option above doesn't use WebGL directly, except for writing GLSL shaders.  Modern engines, including Cesium, abstract the graphics API, which makes it easier to use and generally faster since it allows the engine to centralize optimizations like minimizing GL state changes.  Porting your OpenGL code to use the Cesium renderer should be pretty easy.  If your case is simple enough, creating or using existing geometries and appearances will be the easiest approach.

If you can tell us more about how your currently using OpenGL, I can provide more concrete advice.

Patrick

Patrick Cozzi

unread,
Nov 25, 2013, 9:00:20 PM11/25/13
to cesiu...@googlegroups.com
Hi Randy,

I'm actually in the COLLADA working group, and would recommend that you stream down glTF, instead of COLLADA, since glTF is designed with the web in mind:


You may be able to build directly on top of the glTF implementation in-progress in Cesium:


Or you could at least borrow bits of code from it if you need a more efficient implementation for batching together a large number of assets in view.

Patrick


On Mon, Nov 25, 2013 at 10:52 AM, Randy Horner <Randy....@nisc.coop> wrote:

Patrick,

 

Thanks for the quick and thorough reply.  By using a modified quadtree to determine what entities are within viewing range, and loading the 50-100 models of equipment types (from collada files) onto the GPU (VBO’s with JOGL 2.0) were we are able to render the poles and associated equipment quickly enough so the user could pan across the utility’s entire service area with a very high fps.  The utilities have between 500,000 and 1000000 pieces of equipment which is stored in a postgis, spatialite, or esri geodatabase and loaded into the quadtrees on startup. 

 

After looking into Cesium (Very impressive by the way) we feel we could achieve similar performance with webgl and Cesium that we did with JOGL 2.0 and WorldWind.  I believe we would have to use the third option you listed or perhaps webgl itself.  We have been working on our shader knowledge (which was lacking) and we will look into your EllipsoidPrimitive example to see if it is the direction we should go.  Thanks again for your reply and any further comments you might have.

 

Randy Horner

Reply all
Reply to author
Forward
0 new messages