<div dir="ltr">Could you explain your actual goal with specifics? It's hard to recommend a method that will be successful when we don't know what success even looks like.<div><br></div><div>If you give is some detailed info we can probably recommend something specific.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 18, 2019 at 3:41 PM <a href="mailto:speterson@idealaero.com">speterson@idealaero.com</a> <<a href="mailto:speterson@idealaero.com">speterson@idealaero.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div class="gmail-m_-672716914191491768WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hi Chis,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Any examples on how to do this?  I tried that so many ways and gave up.  I could never get anything to update at all.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">I have been having a hard time finding any examples on how to do this, so any help would be great.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Thanks<u></u><u></u></span></p>
<p class="MsoNormal"><a name="m_-672716914191491768__MailEndCompose"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></a></p>
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> osg-users [mailto:<a href="mailto:osg-users-bounces@lists.openscenegraph.org" target="_blank">osg-users-bounces@lists.openscenegraph.org</a>]
<b>On Behalf Of </b>Chris Hanson<br>
<b>Sent:</b> Wednesday, September 18, 2019 4:35 PM<br>
<b>To:</b> OpenSceneGraph Users <<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a>><br>
<b>Subject:</b> Re: [osg-users] questions about developing drivers for osg/osgEarth<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">You kind of seem to be going about this a difficult way. <u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Is dynamically altering a surface texture layer really the best way to add an arrow to the scene?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">It seems like you're trying to use a screwdriver to hammer nails.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Is it not more effective to use some kind of symbology and render passes to overlay it onto the surface without testing or rewriting the Z buffer?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Wed, Sep 18, 2019 at 2:57 PM <a href="mailto:speterson@idealaero.com" target="_blank">
speterson@idealaero.com</a> <<a href="mailto:speterson@idealaero.com" target="_blank">speterson@idealaero.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">Hello again,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">I have gotten
<a name="m_-672716914191491768_m_-187406158781350168__MailEndCompose">some of the things I want done somewhat working.</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">I am now having an issue attempting to get a layer to update within a system thread I made.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">First off I built all this using the Simple Ocean plugin code as my base line.  I then added a way to get a simple yellow box to show where I wanted
 programically with osgEarth.  I do have shader code working but what I need help with now is updating my layer ever so often with new data for my shaders to run on.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">Below is my simple function that my thread runs,  layer is a valid layer that is displayed named “newlayer”. 
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">The code runs and ramps up the alpha channel for a while (sometimes few seconds, sometimes minutes) and starts the ramp again with almost transparent,
 but eventually I get a read access violation in osg/NodeVisitor.cpp line 107.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">Can anyone look and hint to what might be causing this issue?</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">It is almost as if my code and osg code are conflicting with some pointer somewhere and I am not sure how to mutex my code correctly.  Maybe it is my
 thread?  I am using a std::thread to run this function on.  Am I updating my layer wrong completely by removing and adding a new one?</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">Thanks in advance.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:blue">void</span><span style="font-size:8pt;font-family:Consolas;color:black">
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">mysimpleocean</span><span style="font-size:8pt;font-family:Consolas;color:black">::mylayer_redraw(osg::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">ref_ptr</span><span style="font-size:8pt;font-family:Consolas;color:black"><osgEarth::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">ImageLayer</span><span style="font-size:8pt;font-family:Consolas;color:black">>
</span><span style="font-size:8pt;font-family:Consolas;color:gray">layer</span><span style="font-size:8pt;font-family:Consolas;color:black">) {</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">int</span><span style="font-size:8pt;font-family:Consolas;color:black"> width = 200;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">int</span><span style="font-size:8pt;font-family:Consolas;color:black"> height = 200;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">double</span><span style="font-size:8pt;font-family:Consolas;color:black"> wlon = -104.00;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">double</span><span style="font-size:8pt;font-family:Consolas;color:black"> nlat = 49.00;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">double</span><span style="font-size:8pt;font-family:Consolas;color:black"> elon = -96.00;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">double</span><span style="font-size:8pt;font-family:Consolas;color:black"> slat = 45.00;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">int</span><span style="font-size:8pt;font-family:Consolas;color:black"> target_height = 200;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">int</span><span style="font-size:8pt;font-family:Consolas;color:black"> target_width = 200;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">double</span><span style="font-size:8pt;font-family:Consolas;color:black"> geoTransform[6];</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    geoTransform[0] = wlon;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    geoTransform[1] = (elon - wlon) / width;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    geoTransform[2] = 0.00;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    geoTransform[3] = nlat;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    geoTransform[4] = 0.00;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    geoTransform[5] = (slat - nlat) / height;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    GDALAllRegister();</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">GDALDataset</span><span style="font-size:8pt;font-family:Consolas;color:black">* nmemDS;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    osgEarth::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">SpatialReference</span><span style="font-size:8pt;font-family:Consolas;color:black">*
 srs = </span><span style="font-size:8pt;font-family:Consolas;color:blue">const_cast</span><span style="font-size:8pt;font-family:Consolas;color:black"><osgEarth::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">SpatialReference</span><span style="font-size:8pt;font-family:Consolas;color:black">*>(_map->getProfile()->getSRS());</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">GDALRasterBand</span><span style="font-size:8pt;font-family:Consolas;color:black">* bandRed;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">GDALRasterBand</span><span style="font-size:8pt;font-family:Consolas;color:black">* bandGreen;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">GDALRasterBand</span><span style="font-size:8pt;font-family:Consolas;color:black">* bandBlue;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">GDALRasterBand</span><span style="font-size:8pt;font-family:Consolas;color:black">* bandAlpha;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    osgEarth::Drivers::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">GDALOptions</span><span style="font-size:8pt;font-family:Consolas;color:black">
 gdaloptions;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    osg::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">ref_ptr</span><span style="font-size:8pt;font-family:Consolas;color:black"><osgEarth::Drivers::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">GDALOptions</span><span style="font-size:8pt;font-family:Consolas;color:black">::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">ExternalDataset</span><span style="font-size:8pt;font-family:Consolas;color:black">>
 eds;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    Threading::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">Mutex</span><span style="font-size:8pt;font-family:Consolas;color:black">
 _mutex;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    osg::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">ref_ptr</span><span style="font-size:8pt;font-family:Consolas;color:black"><osgEarth::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">ImageLayer</span><span style="font-size:8pt;font-family:Consolas;color:black">>
 tlayer;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> 
</span><span style="font-size:8pt;font-family:Consolas;color:blue">int</span><span style="font-size:8pt;font-family:Consolas;color:black"> alpha = 143;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> 
</span><span style="font-size:8pt;font-family:Consolas;color:blue">while</span><span style="font-size:8pt;font-family:Consolas;color:black"> (</span><span style="font-size:8pt;font-family:Consolas;color:blue">true</span><span style="font-size:8pt;font-family:Consolas;color:black">)
 {</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    nmemDS = (</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">GDALDataset</span><span style="font-size:8pt;font-family:Consolas;color:black">*)GDALCreate(GDALGetDriverByName(</span><span style="font-size:8pt;font-family:Consolas;color:rgb(163,21,21)">"MEM"</span><span style="font-size:8pt;font-family:Consolas;color:black">),
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(163,21,21)">""</span><span style="font-size:8pt;font-family:Consolas;color:black">, 200, 200, 0,
</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8pt;font-family:Consolas;color:black">,
</span><span style="font-size:8pt;font-family:Consolas;color:blue">nullptr</span><span style="font-size:8pt;font-family:Consolas;color:black">);   
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    GDALSetProjection(nmemDS, srs->getWKT().c_str());</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    GDALSetGeoTransform(nmemDS, geoTransform);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    nmemDS->AddBand(</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8pt;font-family:Consolas;color:black">,
</span><span style="font-size:8pt;font-family:Consolas;color:blue">nullptr</span><span style="font-size:8pt;font-family:Consolas;color:black">);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    nmemDS->AddBand(</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8pt;font-family:Consolas;color:black">,
</span><span style="font-size:8pt;font-family:Consolas;color:blue">nullptr</span><span style="font-size:8pt;font-family:Consolas;color:black">);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    nmemDS->AddBand(</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8pt;font-family:Consolas;color:black">,
</span><span style="font-size:8pt;font-family:Consolas;color:blue">nullptr</span><span style="font-size:8pt;font-family:Consolas;color:black">);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    nmemDS->AddBand(</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8pt;font-family:Consolas;color:black">,
</span><span style="font-size:8pt;font-family:Consolas;color:blue">nullptr</span><span style="font-size:8pt;font-family:Consolas;color:black">);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    bandRed = nmemDS->GetRasterBand(1);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    bandGreen = nmemDS->GetRasterBand(2);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    bandBlue = nmemDS->GetRasterBand(3);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    bandAlpha = nmemDS->GetRasterBand(4);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">BYTE</span><span style="font-size:8pt;font-family:Consolas;color:black">* rrowbuff =
</span><span style="font-size:8pt;font-family:Consolas;color:blue">new</span><span style="font-size:8pt;font-family:Consolas;color:black">
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">BYTE</span><span style="font-size:8pt;font-family:Consolas;color:black">[width];</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">BYTE</span><span style="font-size:8pt;font-family:Consolas;color:black">* growbuff =
</span><span style="font-size:8pt;font-family:Consolas;color:blue">new</span><span style="font-size:8pt;font-family:Consolas;color:black">
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">BYTE</span><span style="font-size:8pt;font-family:Consolas;color:black">[width];</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">BYTE</span><span style="font-size:8pt;font-family:Consolas;color:black">* browbuff =
</span><span style="font-size:8pt;font-family:Consolas;color:blue">new</span><span style="font-size:8pt;font-family:Consolas;color:black">
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">BYTE</span><span style="font-size:8pt;font-family:Consolas;color:black">[width];</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">BYTE</span><span style="font-size:8pt;font-family:Consolas;color:black">* arowbuff =
</span><span style="font-size:8pt;font-family:Consolas;color:blue">new</span><span style="font-size:8pt;font-family:Consolas;color:black">
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">BYTE</span><span style="font-size:8pt;font-family:Consolas;color:black">[width];</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">for</span><span style="font-size:8pt;font-family:Consolas;color:black"> (</span><span style="font-size:8pt;font-family:Consolas;color:blue">int</span><span style="font-size:8pt;font-family:Consolas;color:black">
 y = 0; y < height; y++) {</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">     
</span><span style="font-size:8pt;font-family:Consolas;color:blue">for</span><span style="font-size:8pt;font-family:Consolas;color:black"> (</span><span style="font-size:8pt;font-family:Consolas;color:blue">int</span><span style="font-size:8pt;font-family:Consolas;color:black">
 x = 0; x < width; x++) {</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">        rrowbuff[x] = (</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">BYTE</span><span style="font-size:8pt;font-family:Consolas;color:black">)255;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">        growbuff[x] = (</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">BYTE</span><span style="font-size:8pt;font-family:Consolas;color:black">)253;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">        browbuff[x] = (</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">BYTE</span><span style="font-size:8pt;font-family:Consolas;color:black">)143;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">        arowbuff[x] = (</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">BYTE</span><span style="font-size:8pt;font-family:Consolas;color:black">)alpha;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">      }</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">     
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">CPLErr</span><span style="font-size:8pt;font-family:Consolas;color:black"> rerr = bandRed->RasterIO(</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GF_Write</span><span style="font-size:8pt;font-family:Consolas;color:black">,
 0, 0, target_width, target_height, rrowbuff, target_width * ((elon - wlon) / target_width), target_height * abs((slat - nlat) / target_height),
</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8pt;font-family:Consolas;color:black">, 4, 0);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">     
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">CPLErr</span><span style="font-size:8pt;font-family:Consolas;color:black"> gerr = bandGreen->RasterIO(</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GF_Write</span><span style="font-size:8pt;font-family:Consolas;color:black">,
 0, 0, target_width, target_height, growbuff, target_width * ((elon - wlon) / target_width), target_height * abs((slat - nlat) / target_height),
</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8pt;font-family:Consolas;color:black">, 4, 0);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">     
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">CPLErr</span><span style="font-size:8pt;font-family:Consolas;color:black"> berr = bandBlue->RasterIO(</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GF_Write</span><span style="font-size:8pt;font-family:Consolas;color:black">,
 0, 0, target_width, target_height, browbuff, target_width * ((elon - wlon) / target_width), target_height * abs((slat - nlat) / target_height),
</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8pt;font-family:Consolas;color:black">, 4, 0);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">     
</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">CPLErr</span><span style="font-size:8pt;font-family:Consolas;color:black"> aerr = bandAlpha->RasterIO(</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GF_Write</span><span style="font-size:8pt;font-family:Consolas;color:black">,
 0, 0, target_width, target_height, arowbuff, target_width * ((elon - wlon) / target_width), target_height * abs((slat - nlat) / target_height),
</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8pt;font-family:Consolas;color:black">, 4, 0);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    }</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    alpha = alpha + 10;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">if</span><span style="font-size:8pt;font-family:Consolas;color:black"> (alpha > 255)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">      alpha = alpha - 255;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    eds
</span><span style="font-size:8pt;font-family:Consolas;color:teal">=</span><span style="font-size:8pt;font-family:Consolas;color:black">
</span><span style="font-size:8pt;font-family:Consolas;color:blue">new</span><span style="font-size:8pt;font-family:Consolas;color:black"> osgEarth::Drivers::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">GDALOptions</span><span style="font-size:8pt;font-family:Consolas;color:black">::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">ExternalDataset</span><span style="font-size:8pt;font-family:Consolas;color:black">(nmemDS,
</span><span style="font-size:8pt;font-family:Consolas;color:blue">true</span><span style="font-size:8pt;font-family:Consolas;color:black">);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    gdaloptions.externalDataset()
</span><span style="font-size:8pt;font-family:Consolas;color:teal">=</span><span style="font-size:8pt;font-family:Consolas;color:black"> eds;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    tlayer
</span><span style="font-size:8pt;font-family:Consolas;color:teal">=</span><span style="font-size:8pt;font-family:Consolas;color:black">
</span><span style="font-size:8pt;font-family:Consolas;color:blue">dynamic_cast</span><span style="font-size:8pt;font-family:Consolas;color:black"><osgEarth::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">ImageLayer</span><span style="font-size:8pt;font-family:Consolas;color:black">*>(_map->getLayerByName(</span><span style="font-size:8pt;font-family:Consolas;color:rgb(163,21,21)">"newlayer"</span><span style="font-size:8pt;font-family:Consolas;color:black">));</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    tlayer</span><span style="font-size:8pt;font-family:Consolas;color:teal">-></span><span style="font-size:8pt;font-family:Consolas;color:black">setDataVariance(osg::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">Object</span><span style="font-size:8pt;font-family:Consolas;color:black">::</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">DYNAMIC</span><span style="font-size:8pt;font-family:Consolas;color:black">);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    tlayer</span><span style="font-size:8pt;font-family:Consolas;color:teal">-></span><span style="font-size:8pt;font-family:Consolas;color:black">getOrCreateStateSet()->setDataVariance(osg::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">Object</span><span style="font-size:8pt;font-family:Consolas;color:black">::</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">DYNAMIC</span><span style="font-size:8pt;font-family:Consolas;color:black">);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    // tlayer</span><span style="font-size:8pt;font-family:Consolas;color:teal">-></span><span style="font-size:8pt;font-family:Consolas;color:black">disable(</span><span style="font-size:8pt;font-family:Consolas;color:rgb(163,21,21)">""</span><span style="font-size:8pt;font-family:Consolas;color:black">);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    Threading::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">ScopedMutexLock</span><span style="font-size:8pt;font-family:Consolas;color:black">
 exclusiveLock(_mutex);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    _map->removeLayer(tlayer);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:gray">layer</span><span style="font-size:8pt;font-family:Consolas;color:black">
</span><span style="font-size:8pt;font-family:Consolas;color:teal">=</span><span style="font-size:8pt;font-family:Consolas;color:black">
</span><span style="font-size:8pt;font-family:Consolas;color:blue">new</span><span style="font-size:8pt;font-family:Consolas;color:black"> osgEarth::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">ImageLayer</span><span style="font-size:8pt;font-family:Consolas;color:black">(</span><span style="font-size:8pt;font-family:Consolas;color:rgb(163,21,21)">"newlayer"</span><span style="font-size:8pt;font-family:Consolas;color:black">,
 gdaloptions);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:gray">layer</span><span style="font-size:8pt;font-family:Consolas;color:teal">-></span><span style="font-size:8pt;font-family:Consolas;color:black">setDataVariance(osg::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">Object</span><span style="font-size:8pt;font-family:Consolas;color:black">::</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">DYNAMIC</span><span style="font-size:8pt;font-family:Consolas;color:black">);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:gray">layer</span><span style="font-size:8pt;font-family:Consolas;color:teal">-></span><span style="font-size:8pt;font-family:Consolas;color:black">getOrCreateStateSet()->setDataVariance(osg::</span><span style="font-size:8pt;font-family:Consolas;color:rgb(43,145,175)">Object</span><span style="font-size:8pt;font-family:Consolas;color:black">::</span><span style="font-size:8pt;font-family:Consolas;color:darkslategray">DYNAMIC</span><span style="font-size:8pt;font-family:Consolas;color:black">);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    _map->addLayer(</span><span style="font-size:8pt;font-family:Consolas;color:gray">layer</span><span style="font-size:8pt;font-family:Consolas;color:black">);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">delete</span><span style="font-size:8pt;font-family:Consolas;color:black"> rrowbuff;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">delete</span><span style="font-size:8pt;font-family:Consolas;color:black"> growbuff;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">delete</span><span style="font-size:8pt;font-family:Consolas;color:black"> browbuff;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><span style="font-size:8pt;font-family:Consolas;color:blue">delete</span><span style="font-size:8pt;font-family:Consolas;color:black"> arowbuff;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">    Sleep(2000);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">   
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">  }</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Consolas;color:black">}</span><u></u><u></u></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b>From:</b> Shannon Peterson
<br>
<b>Sent:</b> Friday, August 30, 2019 3:27 PM<br>
<b>To:</b> '<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a>' <<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a>><br>
<b>Subject:</b> questions about developing drivers for osg/osgEarth<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I have a few questions about how to build a driver to do some specific tasks in osgEarth.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Simple example.
<u></u><u></u></p>
<p class="MsoNormal">Using simple ocean as an example replace the texture piece with geo-spacial image and then build a shader to add effect to the image.<u></u><u></u></p>
<p class="MsoNormal">Ie. Arrowed line that changes color in towards the direction a path should be followed start to end. 
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">The shader piece can be figured out by us working with the shader code.
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">The part I am having issues with is adding an arrow image or geometry polygon of an arrow to the map at the position I need it at to run the shader effect on.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Is this the correct place to aske this sort of question or is there a different mailing list or thread I should use to get help with getting this designed.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thank you in advance<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Shannon Peterson<u></u><u></u></p>
<p class="MsoNormal"><a href="mailto:speterson@idealaero.com" target="_blank">speterson@idealaero.com</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:6pt;font-family:Tahoma,sans-serif;color:rgb(31,73,125);text-transform:uppercase">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.</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" align="center" style="text-align:center">Chris 'Xenon' Hanson, omo sanza lettere.
<a href="mailto:Xenon@AlphaPixel.com" target="_blank">Xenon@AlphaPixel.com</a> <a href="http://www.alphapixel.com/" target="_blank">
http://www.alphapixel.com/</a><u></u><u></u></p>
<p class="MsoNormal" align="center" style="text-align:center">Training • Consulting • Contracting<u></u><u></u></p>
<p class="MsoNormal" align="center" style="text-align:center">3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL<u></u><u></u></p>
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:9.5pt">Legal/IP • Forensics • </span>Imaging <span style="font-size:9.5pt">• UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
 iPhone/iPad/iOS • Android</span><u></u><u></u></p>
<p class="MsoNormal" align="center" style="text-align:center"><a href="https://twitter.com/alphapixel" target="_blank">@alphapixel</a>
<a href="http://facebook.com/alphapixel" target="_blank">facebook.com/alphapixel</a> (775) 623-PIXL [7495]<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div style="text-align:center">Chris 'Xenon' Hanson, omo sanza lettere. Xenon@AlphaPixel.com <a href="http://www.alphapixel.com/" target="_blank">http://www.alphapixel.com/</a></div><div style="text-align:center">Training • Consulting • Contracting</div><div style="text-align:center">3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL</div><div style="text-align:center"><span style="font-size:12.8px">Legal/IP •</span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">Forensics •</span><span style="font-size:12.8px"> </span>Imaging <span style="font-size:12.8px">•</span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">UAVs </span><span style="font-size:12.8px">• GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android</span></div><div style="text-align:center"><a href="https://twitter.com/alphapixel" target="_blank">@alphapixel</a> <a href="http://facebook.com/alphapixel" target="_blank">facebook.com/alphapixel</a> (775) 623-PIXL [7495]<br></div></div></div></div></div></div>