[osg-users] questions about developing drivers for osg/osgEarth

speterson at idealaero.com speterson at idealaero.com
Thu Sep 19 09:49:46 PDT 2019


So, I theorize that you are loading a 2d vector field as a data layer, that represents the 2D wind velocity vector at every data grid point covering the area, and then you use some kind of shader to display that as a colorfield and displays the moving flow lines? And then you update the 2d vector map periodically to represent the current data?

-          Yes I have u/v vector data as wind for data grid covering an area.

-          I built a shader that uses an alpha channel value to determine its next change in opacity.  I was going to use the alpha channel to create a transparent leader for the paths I want the wind animation to flow say 0-10 values of alpha channel as they are pretty unnoticeable.  I was going to use lengths of same alpha channel setting as speed between different leaders of different data points.  I would then make a colored ball/square what have you as my object I want animated and move that color forward with the shader and then build a tail with gradient that follows to transparent.  I have tested this and it does work well enough for our purposes but if there is better shader logic I am open to suggestions.

-          And yes every so often upon command or 15-30 min when new data comes in it would build a new map based on new data and apply the shader to this and continue forward.

If that's the case, it sounds like you're just needing to load a conventional two-channel 2D image and do all the display work in shaders. That doesn't sound like how you're doing it though?

-          I was thinking I was on the right track but using a 4 channel 2D image instead of a 2 channel image 2D image so I could use the alpha channel.  As before if you have a better solution I am willing to learn the better way of doing these things.

-          My example maybe isn’t the best to show this because I pulled the bitmap image to raster band copying out of the code because in my examply I was treating everything one color and just ramping the alpha channel (with no shader connection whatsoever) just to represent a visible color change, I could have changed the RGB channels just as well.  Sorry if that caused confusion with my thought process.

There's nothing at all that is file-specific about osgEarth, its drivers or its data sources. Many of the drivers talk to network-based data sources without accessing local files, so those shouldn't be an issue.

-          Thanks I was hoping this was the case.

Glenn can probably comment better on how to best make a driver that updates itself periodically or on cue, but you ought to be able to just poll every 30 seconds or so and see if a data is available and refresh it somehow.

-          Glenn’s help an insight is most welcome.  I was only refreshing the data every second or two for my testing the real data only need refreshing every 15-30 minutes.

Wind flow indicators like that website is just one possible display we want to see, we would like to apply the same thing to paths depending on weather data and show direction along the path.  Weather may not be shown but it would suggest a path to go with least resistance or a few options and then allow a user to select one and move along the path.  Ofc we plan to have many more variables also playing into this pathing but the laying down of the path and animating the path line would be a similar task as showing wind animation lines.


From: osg-users [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Chris Hanson
Sent: Thursday, September 19, 2019 10:29 AM
To: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>
Subject: Re: [osg-users] questions about developing drivers for osg/osgEarth

Ok. That helps a lot. Thanks.

So, I theorize that you are loading a 2d vector field as a data layer, that represents the 2D wind velocity vector at every data grid point covering the area, and then you use some kind of shader to display that as a colorfield and displays the moving flow lines? And then you update the 2d vector map periodically to represent the current data?

If that's the case, it sounds like you're just needing to load a conventional two-channel 2D image and do all the display work in shaders. That doesn't sound like how you're doing it though?


There's nothing at all that is file-specific about osgEarth, its drivers or its data sources. Many of the drivers talk to network-based data sources without accessing local files, so those shouldn't be an issue.

Glenn can probably comment better on how to best make a driver that updates itself periodically or on cue, but you ought to be able to just poll every 30 seconds or so and see if a data is available and refresh it somehow.


The information contained in this email and any attachments is intended only for the personal and confidential use of the intended recipients. This email message may be or may contain privileged and confidential communications. If the reader of this e-mail is not an intended recipient, you are hereby notified that you have received this communication in error and that any retention, review, use, dissemination, distribution or copying of this communication or the information contained herein is strictly prohibited. If you have received this communication in error, please notify the sender immediately and delete the original message and all attachments from your system. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email. This communication may also contain data subject to U.S. export laws. If so, that data subject to the International Traffic in Arms Regulation (ITAR) cannot be disseminated, distributed or copied to foreign nationals, residing in the U.S. or abroad, absent the express prior approval of the U.S. Department of State. If you have received this communication in error, please notify the sender by reply e-mail and destroy the e-mail message and any physical copies made of the communication. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20190919/01e257bf/attachment.html>


More information about the osg-users mailing list