Re: [osg-users] Clamping models to an osgTerrain

2020-01-09 Thread Brad Colbert
Robert, thank you for the reply.  The community-crickets were a little 
disconcerting.

I don't think it has to be as complicated as you described.  Simply finding 
the height at the location of the object, placing it there, and placing a 
file reference within that tile's hierarchy so that the model file is paged 
in (or not if it's already in the cache).  Do this for every tile in the 
hierarchy and you are done.  That would be a major jump in capability, at 
this point.

Either way, I'm simply looking to do the above and wondering if it appears 
feasible with current capabilities.

Best,
Brad


On Thursday, January 9, 2020 at 1:41:25 AM UTC-8, Robert Osfield wrote:
>
> I don't know of any off the open sourced tools that do this for you.  It 
> was always something I had on my wish list for VirtualPlanetBuilder but 
> never had the time/funding to tackle it.
>
> The post processing of paged database is something that has been done over 
> the years for various purposes.  
>
> Combing the TerrainTile height fields with cultral data - trees, roads, 
> houses would require one to positioning of the cultral data to the 
> appropriate height, then meshing the tile's height field taking into 
> account the outlines/points of the cultural data being added if you want an 
> exact match.  The remeshing will be the hardest part of this work, so I'd 
> suggest tackling the positioning first then add the meshing later.
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/4d820096-b297-4e6e-94b9-cc1959d41466%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Offscreen rendering of large scenes

2019-12-20 Thread Brad Colbert
Oh darn!  I had a good reply to this :)   Congrat's on the find!

On Thursday, December 12, 2019 at 12:51:02 AM UTC-8, Philipp Wagner wrote:
>
> Sorry, the issue has been that the camera automatically adjusted the near 
> and far plane when rendering the individual parts.
> Problem solved.
>
> Grettings,
> Phil
>
> Am Dienstag, 10. Dezember 2019 16:42:23 UTC+1 schrieb Philipp Wagner:
>>
>> Hi,
>>
>> I want to perform an offscreen rendering of a scene that is too large to 
>> fit into the GPU memory at once (lots of big textures).
>> My idea was to render parts of the scene each in its own frame, and 
>> disable the clearing of the depth and color buffer.
>> This does work for the color buffer, but the depth buffer seems to be 
>> cleared after each frame, which leads to incorrect results (The later parts 
>> are drawn over the previous ones, even though they are behind the other 
>> parts).
>>
>> The algorithm:
>> 1. Create camera/context/...
>> 2. Clear the buffers (i.e. Render an empty scene with a clear mask of 
>> (GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT)
>> 3. Disable buffer clearing
>> 4. Render each part in its own frame
>>  a. Add part to the scene
>>  b. Render
>>  c. Remove part from the scene
>> 5. Read back color buffer
>>
>>
>> osg::ref_ptr<::osg::Camera> camera = new osg::Camera();
>>
>> //Here we set the camera orientation/projection matrix
>>
>> camera->setClearColor(...);
>> camera->setGraphicsContext(context);
>>
>> osg::ref_ptr img = new osg::Image;
>> img->allocateImage(textureWidth, textureHeight, 1, GL_RGBA, 
>> GL_UNSIGNED_BYTE);
>> camera->attach(osg::Camera::COLOR_BUFFER0, img, numSamples);
>> camera->attach(osg::Camera::DEPTH_BUFFER, GL_DEPTH_COMPONENT32);
>> camera->setRenderOrder(osg::Camera::PRE_RENDER);
>>
>> camera->setRenderTargetImplementation(osg::Camera::RenderTargetImplementation::FRAME_BUFFER_OBJECT);
>> camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF);
>> camera->setProjectionResizePolicy(osg::Camera::FIXED);
>> camera->setViewport(0, 0, img->s(), img->t());
>> viewer->addSlave(camera);
>>
>> camera->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
>> viewer->frame();
>> camera->setClearMask(0);
>> for (auto& item : parts)
>> {
>>//Here we create and add the item to the scene...
>>viewer->frame();
>>//Here we remove item from the scene and delete it
>> }
>>
>> Thanks in advance
>> Phil
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/0ac99069-ec02-4af0-9f17-77743dcc871b%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Clamping models to an osgTerrain

2019-12-20 Thread Brad Colbert
Hi folks,

I googled but not found an answer that goes into this.  

I have what can be considered a town and want to clamp the buildings to the 
terrain (obviously).

What I would prefer is to have some pre-process that runs intersectors on 
the terrain, pushing up (or down) through the PagedLODs, placing the model 
at the appropriate height, and then saving that tile back out.  This way 
the models just get loaded in with the PagedLOD and are already at the 
right height as the terrain height pops up and down based on the LOD.

Is this even possible with 3.6?  If so, any ideas, thoughts, pointers?

Best,
Brad

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/dd3b24e4-a1da-46de-9957-c98bf330d2c1%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Test post of osg-users mailing list to osg-users googlegroup

2019-12-05 Thread Brad Colbert
Working

On Thu, Dec 5, 2019 at 9:34 AM Robert Osfield 
wrote:

> Testing reply from osg-users googlegroup
>
> On Thursday, 5 December 2019 17:31:28 UTC, Robert Osfield wrote:
>>
>> HI All,
>>
>> I am just testing the cross posting of posts to osg-users mailing list to
>> the new osg-users googlegroup.
>>
>> Cheers,
>> Robert.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSceneGraph Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osg-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osg-users/41b04413-c614-469e-9b8c-d60fe78a191d%40googlegroups.com
> <https://groups.google.com/d/msgid/osg-users/41b04413-c614-469e-9b8c-d60fe78a191d%40googlegroups.com?utm_medium=email_source=footer>
> .
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


-- 
Brad Colbert
Renaissance Sciences Corporation <https://www.rscusa.com/>
(four eight zero) two nine zero - three nine nine seven <14802903997>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Finding the edge of a frustum, or intersection with the edge of a frustum

2019-11-15 Thread Brad Colbert
Hi,

I thought I would post my solution for finding the intersection of circles with 
a rectangle.  Used to test were circles are intersecting the edge of my Ortho 
projection.


Code:
bool isPointOnSegment(const osg::Vec3d& p1, const osg::Vec3d& p2, const 
osg::Vec3d& point)
{
// First test that the point is co-linear
osg::Vec3d v1 = p2 - p1;
osg::Vec3d v2 = point - p1;

// Cross product
double z = v1.x() * v2.y() - v1.y() * v2.x();

if(z)
return false;

// Dot product will tell us if it's between the points
double dp1 = v1 * v1;
double dp2 = v1 * v2;

// On end
if((dp1 == 0) || (dp1 == dp2))
return true;

// On Segment
else if((dp1 > 0.0) && (dp2 < dp1))
return true;

return false;
}

//
template  int sgn(T val) {
return (T(0) < val) - (val < T(0));
}
std::list findLineCircleIntersections(const osg::Vec3d& p1, const 
osg::Vec3d& p2, const osg::Vec3d& center, const double r)
{
std::list points;
double dx, dy, A, B, C, dis, t;

dx = p2.x() - p1.x();
dy = p2.y() - p1.y();

A = dx * dx + dy * dy;
B = 2 * (dx * (p1.x() - center.x()) + dy * (p1.y() - center.y()));
C = (p1.x() - center.x()) * (p1.x() - center.x()) +
(p1.y() - center.y()) * (p1.y() - center.y()) -
r * r;

dis = B * B - 4 * A * C;

if(dis < 0.0)
{
// No intersection
}
else
{
// Two solutions.
double t1 = (float)((-B - sqrt(dis)) / (2 * A));
double t2 = (float)((-B + sqrt(dis)) / (2 * A));

double x1 = p1.x() + t2 * dx;
double y1 = p1.y() + t2 * dy;
osg::Vec3d point1(x1, y1, p1.z());

if (dis == 0.0) // Tangent
{
// Validate
if(isPointOnSegment(p1, p2, point1))
points.push_back(point1);
}
else if (dis > 0.0)
{
double x2 = p1.x() + t1 * dx;
double y2 = p1.y() + t1 * dy;
osg::Vec3d point2(x2, y2, p1.z());

// Two intersections
if(isPointOnSegment(p1, p2, point1))
points.push_back(osg::Vec3d(x1,y1,p1.z()));
if(isPointOnSegment(p1, p2, point2))
points.push_back(osg::Vec3d(x2,y2,p1.z()));
}
}

return points;
}

std::list findRectangleCircleIntersections(const osg::Vec3d& s1p1, 
const osg::Vec3d& s1p2,
   const osg::Vec3d& s2p1, 
const osg::Vec3d& s2p2,
   const osg::Vec3d& s3p1, 
const osg::Vec3d& s3p2,
   const osg::Vec3d& s4p1, 
const osg::Vec3d& s4p2,
   const osg::Vec3d& 
center, const double r)
{
std::list points;

std::list s1points = findLineCircleIntersections(s1p1, s1p2, 
center, r);
points.insert(points.end(), s1points.begin(), s1points.end());

std::list s2points = findLineCircleIntersections(s2p1, s2p2, 
center, r);
points.insert(points.end(), s2points.begin(), s2points.end());

std::list s3points = findLineCircleIntersections(s3p1, s3p2, 
center, r);
points.insert(points.end(), s3points.begin(), s3points.end());

std::list s4points = findLineCircleIntersections(s4p1, s4p2, 
center, r);
points.insert(points.end(), s4points.begin(), s4points.end());

return points;
}




Cheers,
Brad

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76910#76910





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Finding the edge of a frustum, or intersection with the edge of a frustum

2019-11-08 Thread Brad Colbert
Hi,

I'm using an ortho frustum to draw a map.  On the map I'm drawing a kind of 
range ring / sector pattern, starting from an origin using lines.  I want to 
draw text at the edge of the viewport where the lines intersect with the edge 
(well, just inside so the text is viewable).

The problem I'm having is I can't quite figure out how to tell where the lines 
end within the frustum.  Any ideas would be welcomed.

Picture for context is attached.

Thank you!

Cheers,
Brad

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76886#76886




Attachments: 
http://forum.openscenegraph.org//files/mapview_458.png


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Force osgDB::readNodeFile to not return cached model

2019-11-07 Thread Brad Colbert
Hello,

I'm reading a model multiple times using osgDB::readNodeFile.  I'm rotating a 
part on one of the models but the same part on all of the instances of the 
model are rotating.

I've looked at the pointer returned from osgDB::readNodeFile for all of the 
load calls (for the same model file) and they are all the same.  I'm assuming 
that the model is cached the first time and I'm getting an instance of the 
cached model for each subsequent call to osgDB::readNodeFile.

I've tried what I think should disable the caching for this instance (from one 
of the examples):


Code:
// Load the model
osg::ref_ptr options = new osgDB::Options("a=1 b=2 c=3");
options->setObjectCacheHint(osgDB::Options::CACHE_NONE);
osg::Node* model = osgDB::readNodeFile(modelName, options);




How do I turn this off or get around this?

OpenSceneGraph Library 3.6.3

Thank you!

Cheers,
Brad
Code:




--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76884#76884





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [vpb] Untextured LODs in result

2019-10-23 Thread Brad Colbert
Hi Laurens,

The data is imagery not a DEM so the black has pixel value of 0,0,0 (or 
probably 0 in each color plane).  Back in the day we contracted with Robert to 
make the texture blend logic switchable (see: --blending-policy 
DO_NOT_SET_BLENDING) but I'm wondering if this changed or is being ignored.  
Something I'll dig into later.

Thank you for your reply.

Cheers,
Brad

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76845#76845





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [vpb] Untextured LODs in result

2019-10-22 Thread Brad Colbert
Found (fixed) the issue.  The imagery was in different coordinate spaces which 
was throwing off osgdem.  I re-projected, converted to RGB (from color table), 
and cropped the high-res image.  Much better.

However (always is) I'm getting a blending issue with the black pixels in the 
high-res image and the low-res image.  I swore we paid for that to be fixed.

See attached.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76840#76840




Attachments: 
http://forum.openscenegraph.org//files/screenshot_from_2019_10_22_16_34_19_564.png
http://forum.openscenegraph.org//files/screenshot_from_2019_10_22_16_30_44_182.png


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [vpb] Untextured LODs in result

2019-10-22 Thread Brad Colbert
One small update.  I tried building a new database with the larger (geographic) 
image as well (for when we are zoomed out more), and the higher res inset is 
really not well.  See the attached image.

Additional image source:
https://aeronav.faa.gov/content/aeronav/Planning/US_WallPlan_6.zip

Command line:

Code:
osgdem --TERRAIN --BuildOverlays True --blending-policy DO_NOT_SET_BLENDING 
--PagedLOD --mip-mapping-imagery --compressed -t /tmp/maps/source -o 
/tmp/maps/PHX_MAP/PHX_VFR_Sectional.ive



--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76839#76839




Attachments: 
http://forum.openscenegraph.org//files/screenshot_from_2019_10_22_15_15_15_127.png
http://forum.openscenegraph.org//files/screenshot_from_2019_10_22_15_14_37_165.png


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [vpb] Untextured LODs in result

2019-10-22 Thread Brad Colbert
Hi,

I'm trying to build a simple map from a Geotiff but the result is not correct.  
It looks like the lower resolution LOD textures are either not loading or are 
not generated.  I've tried both vpbmaster and osgdem.

Has anyone had this problem?

Details:
Ubuntu 18.04
Nvidia GTX 1080
Nvidia driver 430.26
OpenSceneGraph Library 3.6.3
VPB from https://github.com/openscenegraph/VirtualPlanetBuilder.git
GeoTIFF from: 
https://aeronav.faa.gov/content/aeronav/sectional_files/Phoenix_102.zip

Command line (with various options turned on and off):

Code:
osgdem --TERRAIN --blending-policy DO_NOT_SET_BLENDING --PagedLOD 
--mip-mapping-hardware --RGBA --image-ext rgb -t 
/tmp/maps/source/Phoenix_SEC_102.tif -o /tmp/maps/PHX_MAP/PHX_VFR_Sectional.ive



An example of the result is attached...



Thank you!

Cheers,
Brad[img][/img]

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76838#76838




Attachments: 
http://forum.openscenegraph.org//files/screenshot_from_2019_10_22_14_28_36_464.png


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Re-purposing the performance graph

2018-08-22 Thread Brad Colbert
Hi folks,

I'm sure this has been asked before but is there an example for using the
performance graph to render custom statistics?

Cheers,
Brad

-- 
Brad Colbert
Renaissance Sciences Corporation
(four eight zero) two nine zero - three nine nine seven <14802903997>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Warning: Material::apply(State&) - not supported.

2018-07-23 Thread Brad Colbert
Thanks Chris.

It's a model I'm using for testing so it's probably not worth the effort.
Something I downloaded from TurboSquid.

Cheers,
Brad

On Mon, Jul 23, 2018 at 11:20 AM, Chris Hanson  wrote:

> That'll usually do the trick.
>
> Have you determined what Stateset is on your model that is not
> implemented? The right approach would probably be to modify the model to
> strip off the unsupported state so the error is prevented.
>
> On Mon, Jul 23, 2018 at 9:18 PM Brad Colbert  wrote:
>
>> Hi Folks,
>>
>> I have, what I hope, is an easy question.  I have a model that I'm
>> loading into my app (GL3) that is causing the following warning.  What can
>> I do to simply stop the warning from being displayed?
>>
>> *Warning: Material::apply(State&) - not supported.*
>>
>> Would simply setting the OSG_NOTIFY_LEVEL to FATAL suffice?
>>
>> Thanks,
>> Brad
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
> --
> Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
> http://www.alphapixel.com/
> Training • Consulting • Contracting
> 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4
> • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
> Legal/IP • Forensics • Imaging • UAVs • GIS • GPS •
> osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
> iPhone/iPad/iOS • Android
> @alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
> 623-PIXL [7495]
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Warning: Material::apply(State&) - not supported.

2018-07-23 Thread Brad Colbert
Hi Folks,

I have, what I hope, is an easy question.  I have a model that I'm loading
into my app (GL3) that is causing the following warning.  What can I do to
simply stop the warning from being displayed?

*Warning: Material::apply(State&) - not supported.*

Would simply setting the OSG_NOTIFY_LEVEL to FATAL suffice?

Thanks,
Brad
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] AutoTransform for scale 3.6.0

2018-06-18 Thread Brad Colbert
Hi Folks,

I have an AutoTransform set to maintain the axes model to the same screen
size but I'm guessing I'm using it incorrectly.  It behaves just like a
scale node with a constant fixed scale instead of changing the scale to
maintain a constant screen size.  I've tried all sorts of param's for
Min/Max scale.  Code snip:

// Load an example model to show the XYZ axes.
// in (m), hence the MatrixTransform.
std::string modelFilename =
std::string(getenv("APP_SIM_DATA_PATH")) +
"/models/axes.osgt";
osg::ref_ptr loadedModel =
osgDB::readRefNodeFile(modelFilename);
if (APP_VERIFY(nullptr != loadedModel.get()))
{
  // Add an autotransform to make the axes the same size on the
screen.
  osg::ref_ptr at = new osg::AutoTransform;
  at->addChild(loadedModel);
  at->setAutoScaleToScreen(true);
  at->setMinimumScale(0.1);
  at->setMaximumScale(10.0);

  // Add the model
  scene_->addChild(at);
} // if loadedModel
else {
  APP_LOG_ERROR(
  "App::DidInitialize: Model not loaded %s",
  modelFilename.c_str());
}

Thoughts?

-Brad
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] VBO Bug with 3.6.1 and Normal Arrays

2018-06-01 Thread Brad Colbert
Could this be why I'm not getting my colors?

Cheers,
Brad

On Fri, Jun 1, 2018 at 8:51 AM, Robert Osfield 
wrote:

> Hi Dan,
>
> Thanks for the explanation and example to reproduce the bug... Guess
> it looks like we'll need to make 3.6.2 rather sooner than I was
> hoping, it'll be one a month at this rate...
>
> Robert.
>
> On 1 June 2018 at 16:01, Daniel Emminizer, Code 5773
>  wrote:
> > Hi Robert,
> >
> > Oops -- I sent this earlier today but apparently to the bounces list;
> that explains the confusion on GitHub -- my mistake.  This was supposedly
> sent right before I posted the PR.  Here's the original text:
> >
> >
> > I think I found a bug in 3.6.1.  I am loading a FLT model and it's
> causing a crash in my application to draw it.  The same model does not
> crash in OSG 3.4.  I think I've finally tracked down the cause and have a
> candidate solution too.
> >
> > A few weeks back I saw a similar crash in my own code, and figured it
> was due to incorrect usage of the binding flags on osg::Array.  Much of our
> code was using osg::Geometry::setNormalBinding() (and related methods).
> During debugging, I was able to determine my normals were crashing in 3.6,
> and the problem went away when I used the osg::Array(osg::Array::Binding)
> signature -- i.e. assigning a binding on construction.  At the time I
> thought it was something I was doing wrong and moved on.
> >
> > The problem showed up again earlier this week but not in my code, and
> not manifesting in exactly the same way.  Here's the run-down of what's
> going on:
> >
> > - Loading FLT model
> > - FLT model loads a face, which has vertices, textures, and normals
> > - FLT uses getOrCreateNormalArray(), which allocates an array
> (BIND_UNDEFINED) and sets it on the geometry
> > - Geometry::addVertexBufferObjectIfRequired() is called on the normals,
> but nothing done due to BIND_UNDEFINED
> > - FLT later sets normals to BIND_PER_VERTEX appropriately, which is a
> direct set and does not do anything to the Geometry's VBOs
> > - First frame starts to render
> > - Geometry::drawVAImpl calls vas->setNormalArray()
> > - VertexArrayState::setArray() calls new_array->getOrCreateGLBufferObject(),
> which returns 0.  This is the first major problem.
> > - Because vbo is NULL, unbindindVertexBufferObject() is called, leading
> to GL_ARRAY_BUFFER to go to 0
> > - vad->enable_and_dispatch() gets called and does
> glVertexAttribPointer() with a non-NULL data ptr, which is a GL error
> because array buffer is 0
> >
> > Unwinding the error:
> > - enable_and_dispatch() shouldn't be called if ptr is non-NULL and no
> GL_ARRAY_BUFFER is 0
> > - GL_ARRAY_BUFFER is set to 0 because there is no VBO set up for the
> normal array
> > - There is no normal array because the only place it seems to be created
> is in setNormalArray(), which fails because at that time, it is
> BIND_UNDEFINED
> > - Binding gets swapped from BIND_UNDEFINED to BIND_PER_VERTEX after
> setNormalArray(), leading to the error
> >
> > There are several possible solutions I can see.  You can probably see
> more:
> > 1) Change FLT plugin to assign array binding per vertex on construction
> of array.  Seems poor because invariably this bug is crashing other code --
> maybe it's the cause of the DXF that Brian Hutchison reported earlier this
> week?
> > 2) Update Array::setBinding() to create the VBO if needed.  I do not
> know if this is possible nor how to do it.
> > 3) "Lazily" detect this issue somewhere in the rendering calls and
> create VBO there if necessary
> >
> >
> >
> > PR 554 was an attempt at approach #3 but I agree with your assessment on
> GitHub.  It does not solve the problem in all cases.
> >
> > Attached is a demo of the problem that generates a console warning.
> More complex scenes can cause crashes.  The red triangle has the problem,
> but the green one does not.
> >
> >  - Dan
> >
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> openscenegraph.org
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Updating VBO's during runtime

2018-06-01 Thread Brad Colbert
Hah!  Daniel, that was it.  Darnit!

BTW, I used to work at Code 5580.  WAY back in the day.

Thanks!

Robert, sorry, I meant to mention version 3.6.0.

Cheers,
Brad

On Fri, Jun 1, 2018 at 7:39 AM, Daniel Emminizer, Code 5773 <
dan.emmini...@nrl.navy.mil> wrote:

> Hi Brad,
>
>
>
> Check to make sure your Geometry has setDataVariance(osg::Object::DYNAMIC).
> That solved the problem for most of our similar cases.
>
>
>
> - Dan
>
>
>
>
>
> *From:* osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] *On
> Behalf Of *Brad Colbert
> *Sent:* Friday, June 01, 2018 10:20 AM
> *To:* osg-users@lists.openscenegraph.org
> *Subject:* [osg-users] Updating VBO's during runtime
>
>
>
> I'm updating my vertices at runtime.  I've found a few posts that discuss
> this:
>
>
>
> (a couple are:)
>
> http://forum.openscenegraph.org/viewtopic.php?t=14826
>
> http://forum.openscenegraph.org/viewtopic.php?t=15782
>
>
>
> Let me first mention that I've compiled OSG with GL3 support, so no
> display lists.  That said, I'm still calling:
>
>
>
>   pointsGeom->setUseDisplayList(false);
>
>   pointsGeom->setUseVertexBufferObjects(true);
>
>
>
> Here is a snippet of my call to update the vertices (v_ = vertices, c_ =
> colors, n_ = normals, da_ = DrawArrays, g_ = Geometry):
>
>
>
> for (int i = 0; i < numVertices; i++) {
>
>   // Verticies
>
>   v_.at(i)[0] = 500.f * (0.0f + (3.0f * float(rand() % 1000) / 1000.f)
> - 1.5f);
>
>   v_.at(i)[1] = 500.f * (0.0f + (4.0f * float(rand() % 1000) / 1000.f)
> - 2.f);
>
>   v_.at(i)[2] = 500.f * (1.5f + (0.1f * float(rand() % 1000) / 1000.f)
> - 0.05f);
>
>
>
>   // Colors
>
>   c_.at(i)[0] = 1.f;
>
>   c_.at(i)[1] = 1.f;
>
>   c_.at(i)[2] = 1.f;
>
>   c_.at(i)[3] = 1.f;
>
>
>
>   // Normals
>
>   n_.at(i)[0] = 0.f;
>
>   n_.at(i)[1] = 1.f;
>
>   n_.at(i)[2] = 0.f;
>
> }
>
>
>
> v_.dirty();
>
> c_.dirty();
>
> n_.dirty();
>
>
>
> da_.setCount(numVertices);
>
> da_.dirty();
>
>
>
> *// *** The dirty() calls above are supposed to tell OSG to update the
> VBO's.  For*
>
> *// some reason this isn't happening.  We are going to force it here.
> Not sure of the*
>
> *// performance implications but hopefully this is temporary.*
>
> *g_.setVertexArray(_);*
>
> *g_.setColorArray(_);*
>
> *g_.setNormalArray(_);*
>
>
>
> g_.dirtyBound();
>
>
>
> The update just doesn't happen unless I call the *setVertexArray*,
> *setColorArray*, *setNormalArray* methods which doesn't match what the
> previous posts about this topic.
>
>
>
> Is this because of GL3 or something else?
>
>
>
> Thanks,
>
> Brad
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Updating VBO's during runtime

2018-06-01 Thread Brad Colbert
I'm updating my vertices at runtime.  I've found a few posts that discuss
this:

(a couple are:)
http://forum.openscenegraph.org/viewtopic.php?t=14826
http://forum.openscenegraph.org/viewtopic.php?t=15782

Let me first mention that I've compiled OSG with GL3 support, so no display
lists.  That said, I'm still calling:

  pointsGeom->setUseDisplayList(false);
  pointsGeom->setUseVertexBufferObjects(true);

Here is a snippet of my call to update the vertices (v_ = vertices, c_ =
colors, n_ = normals, da_ = DrawArrays, g_ = Geometry):

for (int i = 0; i < numVertices; i++) {
  // Verticies
  v_.at(i)[0] = 500.f * (0.0f + (3.0f * float(rand() % 1000) / 1000.f)
- 1.5f);
  v_.at(i)[1] = 500.f * (0.0f + (4.0f * float(rand() % 1000) / 1000.f)
- 2.f);
  v_.at(i)[2] = 500.f * (1.5f + (0.1f * float(rand() % 1000) / 1000.f)
- 0.05f);

  // Colors
  c_.at(i)[0] = 1.f;
  c_.at(i)[1] = 1.f;
  c_.at(i)[2] = 1.f;
  c_.at(i)[3] = 1.f;

  // Normals
  n_.at(i)[0] = 0.f;
  n_.at(i)[1] = 1.f;
  n_.at(i)[2] = 0.f;
}

v_.dirty();
c_.dirty();
n_.dirty();

da_.setCount(numVertices);
da_.dirty();

*// *** The dirty() calls above are supposed to tell OSG to update the
VBO's.  For*
*// some reason this isn't happening.  We are going to force it here.
Not sure of the*
*// performance implications but hopefully this is temporary.*
*g_.setVertexArray(_);*
*g_.setColorArray(_);*
*g_.setNormalArray(_);*

g_.dirtyBound();

The update just doesn't happen unless I call the *setVertexArray*,
*setColorArray*, *setNormalArray* methods which doesn't match what the
previous posts about this topic.

Is this because of GL3 or something else?

Thanks,
Brad
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] VPB adding noise to imagery

2013-10-01 Thread Brad Colbert
Just to get it on record:  Specifying --no-interpolate-imagery as a global 
switch fixed the issue.

-B



-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
Sent: Thursday, September 26, 2013 12:39 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] VPB adding noise to imagery

Hi folks,

I tried --RGB-16 and I get the same effect.  There is some kind of sampling 
going on and it's hard to tell what it is.  The same pattern is in all color 
channels.

Any ideas?

-B



From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Arthur Bogard
Sent: Thursday, September 26, 2013 12:11 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] VPB adding noise to imagery

I've found that RGB-16 solves my issues, but not RGBA

On Thu, Sep 26, 2013 at 6:39 PM, Brad Colbert bcolb...@rscusa.com wrote:
Hi Robert,

Maybe I'm using the wrong switch?  From my email below the target has 
compression disabled using -RGBA.

Does this need to be specified after each -layer # switch?

-B



From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, September 26, 2013 11:27 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] VPB adding noise to imagery

HI Brad,

My guess is that it's an artefact of using OpenGL/ST3C compression that the OSG 
uses by default to keep the tile sizes.  You can disable compression when doing 
the VPB build by choosing an RGB output format.  Run osgdem --help to see all 
the options.

Robert.

On 26 September 2013 17:39, Brad Colbert bcolb...@rscusa.com wrote:
Hi folks,
 
We are building a database using an additional texture layer as a height field. 
 I'm finding that the image stored in database is coming across with what 
appears to be 1bit noise.  A constant image of say, 125 / 255 after going 
through VPB is coming out with some values of 124 / 255.  The pattern looks a 
bit like quantization noise but we are setting --disable-error-diffusion just 
in case and the target has compression disabled using -RGBA.
 
Does anyone in OSG land have an idea where I can look to see what is causing 
this?
 
I'm attaching captured images where I've applied the same stretching formula.  
One is from the rendering of the database and the other is from Mathcad, where 
I loaded the source image and displayed it with the same stretch.  The database 
image capture shows the speckles where as the source image does not.
 

 

 
 
-B
 
---
Brad Colbert
Renaissance Sciences Corporation
(480) 290-3997
 

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] VPB adding noise to imagery

2013-09-26 Thread Brad Colbert
Hi folks,



We are building a database using an additional texture layer as a height field. 
 I'm finding that the image stored in database is coming across with what 
appears to be 1bit noise.  A constant image of say, 125 / 255 after going 
through VPB is coming out with some values of 124 / 255.  The pattern looks a 
bit like quantization noise but we are setting --disable-error-diffusion just 
in case and the target has compression disabled using -RGBA.



Does anyone in OSG land have an idea where I can look to see what is causing 
this?



I'm attaching captured images where I've applied the same stretching formula.  
One is from the rendering of the database and the other is from Mathcad, where 
I loaded the source image and displayed it with the same stretch.  The database 
image capture shows the speckles where as the source image does not.



[Source.png]



[Subset_VPB_pow10_1000.jpg]





-B



---

Brad Colbert

Renaissance Sciences Corporation

(480) 290-3997


inline: image001.jpginline: image003.jpg___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] VPB adding noise to imagery

2013-09-26 Thread Brad Colbert
Hi Robert,

Maybe I'm using the wrong switch?  From my email below the target has 
compression disabled using -RGBA.

Does this need to be specified after each -layer # switch?

-B



From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, September 26, 2013 11:27 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] VPB adding noise to imagery

HI Brad,

My guess is that it's an artefact of using OpenGL/ST3C compression that the OSG 
uses by default to keep the tile sizes.  You can disable compression when doing 
the VPB build by choosing an RGB output format.  Run osgdem --help to see all 
the options.

Robert.

On 26 September 2013 17:39, Brad Colbert bcolb...@rscusa.com wrote:
Hi folks,
 
We are building a database using an additional texture layer as a height field. 
 I'm finding that the image stored in database is coming across with what 
appears to be 1bit noise.  A constant image of say, 125 / 255 after going 
through VPB is coming out with some values of 124 / 255.  The pattern looks a 
bit like quantization noise but we are setting --disable-error-diffusion just 
in case and the target has compression disabled using -RGBA.
 
Does anyone in OSG land have an idea where I can look to see what is causing 
this?
 
I'm attaching captured images where I've applied the same stretching formula.  
One is from the rendering of the database and the other is from Mathcad, where 
I loaded the source image and displayed it with the same stretch.  The database 
image capture shows the speckles where as the source image does not.
 

 

 
 
-B
 
---
Brad Colbert
Renaissance Sciences Corporation
(480) 290-3997
 

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] VPB adding noise to imagery

2013-09-26 Thread Brad Colbert
Hi folks,

I tried --RGB-16 and I get the same effect.  There is some kind of sampling 
going on and it's hard to tell what it is.  The same pattern is in all color 
channels.

Any ideas?

-B



From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Arthur Bogard
Sent: Thursday, September 26, 2013 12:11 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] VPB adding noise to imagery

I've found that RGB-16 solves my issues, but not RGBA

On Thu, Sep 26, 2013 at 6:39 PM, Brad Colbert bcolb...@rscusa.com wrote:
Hi Robert,

Maybe I'm using the wrong switch?  From my email below the target has 
compression disabled using -RGBA.

Does this need to be specified after each -layer # switch?

-B



From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, September 26, 2013 11:27 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] VPB adding noise to imagery

HI Brad,

My guess is that it's an artefact of using OpenGL/ST3C compression that the OSG 
uses by default to keep the tile sizes.  You can disable compression when doing 
the VPB build by choosing an RGB output format.  Run osgdem --help to see all 
the options.

Robert.

On 26 September 2013 17:39, Brad Colbert bcolb...@rscusa.com wrote:
Hi folks,
 
We are building a database using an additional texture layer as a height field. 
 I'm finding that the image stored in database is coming across with what 
appears to be 1bit noise.  A constant image of say, 125 / 255 after going 
through VPB is coming out with some values of 124 / 255.  The pattern looks a 
bit like quantization noise but we are setting --disable-error-diffusion just 
in case and the target has compression disabled using -RGBA.
 
Does anyone in OSG land have an idea where I can look to see what is causing 
this?
 
I'm attaching captured images where I've applied the same stretching formula.  
One is from the rendering of the database and the other is from Mathcad, where 
I loaded the source image and displayed it with the same stretch.  The database 
image capture shows the speckles where as the source image does not.
 

 

 
 
-B
 
---
Brad Colbert
Renaissance Sciences Corporation
(480) 290-3997
 

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgSim::LighPoint radius

2013-04-29 Thread Brad Colbert
Nick,

A shader would allow you to change most of those.

-B

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Trajce Nikolov 
NICK
Sent: Sunday, April 28, 2013 7:48 AM
To: OpenSceneGraph Users
Subject: [osg-users] osgSim::LighPoint radius

Hi Community,

I have faced a problem with the _radius from LighPoint. The showcase is to 
control all of the LightPoint attributes in run tim (dynamiclly change 
intensity, color ...these work just fine). However the radius can be changed on 
LightPoint re-creation,only and its can not be changed in run-time. Some hints?

Thanks a bunch.

Nick

--
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FBX 2012.1?

2012-10-16 Thread Brad Colbert
Great work, thanks!

-B

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Randall Hand
Sent: Monday, October 15, 2012 6:53 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] FBX 2012.1?

Just the other day I hacked the URL, they keep the same naming scheme.  Just 
find the 2013.3 one you want and change the URL from 20133 to 20122 or 20121 .


[cid:image001.jpg@01CDAB7E.AFB50EC0]
Brad Colbertmailto:bcolb...@rscusa.com
October 15, 2012 7:14 PM
Hi Folks,

Does anyone know of a source for getting the FBX 2012.1+ SDK? Autodesk has 
released 2013 which is currently incompatible with the OSG plugin.

-B

---
Brad Colbert
Renaissance Sciences Corporation
(480) 290-3997


___
osg-users mailing list
osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

--
Randall Hand
http://www.yeraze.com
inline: image001.jpg___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] FBX 2012.1?

2012-10-15 Thread Brad Colbert
Hi Folks,

Does anyone know of a source for getting the FBX 2012.1+ SDK?  Autodesk has 
released 2013 which is currently incompatible with the OSG plugin.

-B

---
Brad Colbert
Renaissance Sciences Corporation
(480) 290-3997


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgOpenFlight LightPointRecords parsing SEQUENCE pallet color as RGB color

2012-06-25 Thread Brad Colbert
Hi folks,

OSG 3.0.1
OpenFlight 16.4

I've been looking at the code that loads light points in the OpenFlight loader. 
 I was putting together a test and ran into an issue.  It appears that in the 
FLASHING_SEQUENCE section in LightPointsRecords.cpp:316 (IndexedLightPoint) 
that the loader is putting the color index value into the RGB component of the 
color sequence instead of the RGB values looked up from the color pallet.  

The base color of the lightpoint appears correct which has an index of 639 
(255,0,0).

The sequence is configured to go from blue to green, but what we see is Red, 
darker red.

Color index values for the sequence
383 (0,0,255)
511 (0,255,0)

Printing out the values in the sequence at the loader before they are added to 
the sequence we get:

LPAnimation::FLASHING_SEQUENCE 1 : 0.498039, 0.00392157, 0, 0
LPAnimation::FLASHING_SEQUENCE 1 : 1, 0.00392157, 0, 0

and looking at the bits of the RGB components concatenated we get:

383, 511

Which is the original color index values and not the RGB components that would 
be the result of the lookup.

Can anyone point to where the lookup of the RGB components should happen so I 
can fix this?

Also, I've attached a simple model for your viewing pleasure.

Thank you!

Cheers,
Brad

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=48494#48494




Attachments: 
http://forum.openscenegraph.org//files/pole_red_907.zip


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] LightPointNode BlinkSequence class modification questions.

2012-06-22 Thread Brad Colbert
Hello Robert,

My gut tells me that the time to make a call to a virtual function versus 
inlined code is far less than the actual code being executed.  That said, a 
little gedanken experiment to get an idea of how many blinking lights we may 
have to deal with is in order:

Let us say, for the sake of argument, for a flight simulation in a non urban 
area it would be a couple per aircraft.  Given that most simulations tend to 
not have a lot of aircraft then we aren't talking about a lot.  Let's say 10 
(why not :) ).

In an urban environment we are talking about hazard lights to indicate large 
towers and buildings of significant height (relative to the surrounding 
buildings).  Let's say 100 buildings (including towers), each with a few 
lights, so 300.  Generally not all of those lights will be in the field of 
view, and it wouldn't be prudent to render them all of the time at distance 
(LOD controlled).

So, let's say our worse case is 310 lights.

My analysis may be a bit self serving but I don't feel that it will be a 
noticeable issue in the general case.

-B

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Friday, June 22, 2012 2:19 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] LightPointNode BlinkSequence class modification 
questions.

HI Brad,

On 21 June 2012 23:23, Brad Colbert bcolb...@rscusa.com wrote:
 How would you feel about changing  the osg::Vec4 BlinkSequence::color(double 
 time,double length) const to virtual?

 I would like to customize the behaviour of this call but I'm currently unable 
 to because it is inlined and not virtual.

The method is original inline for performance reasons so the question
I'd pose is simply what performance impact would we see with changing
to virtual.  This would depend on just how many light points in the
scene might have a BlinkSequence attached.  How many are you using or
would you expect to be used on screen at any one time?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] LightPointNode BlinkSequence class modification questions.

2012-06-21 Thread Brad Colbert
Robert,

How would you feel about changing  the osg::Vec4 BlinkSequence::color(double 
time,double length) const to virtual?

I would like to customize the behaviour of this call but I'm currently unable 
to because it is inlined and not virtual.

Thank you!

Cheers,
Brad

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=48419#48419





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Error reported when using RGB_16F cubemap as FBO

2012-06-19 Thread Brad Colbert
Sergey,

That fixed it, thank you!

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sergey 
Polischuk
Sent: Tuesday, June 19, 2012 1:59 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Error reported when using RGB_16F cubemap as FBO

Hi, Brad

Add this lines and you should be ok:

texture-setSourceType(GL_HALF_FLOAT);
texture-setSourceFormat(GL_RGB);

Cheers,
Sergey.

19.06.2012, 05:01, Brad Colbert bcolb...@rscusa.com:
 Hi,

 I'm getting an error when I try to use a floating point texture as a cube map 
 for an FBO.  I'm able to repeat the error using the prerendercubemap example 
 where I changed line 223 to:

 texture-setInternalFormat(GL_RGB16F_ARB);

 The error I get is:

 RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6

 My hardware and driver versions are:

 HW: NVidia GT 540M
 Driver: 268.30

 I have not dug yet to see if this is something in OSG that may be incorrectly 
 setting up the FBO or if it's a fundamental problem.

 Any quick ideas?

 ...

 Thank you!

 Cheers,
 Brad
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Error reported when using RGB_16F cubemap as FBO

2012-06-18 Thread Brad Colbert
Hi,

I'm getting an error when I try to use a floating point texture as a cube map 
for an FBO.  I'm able to repeat the error using the prerendercubemap example 
where I changed line 223 to:

texture-setInternalFormat(GL_RGB16F_ARB);

The error I get is:

RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6

My hardware and driver versions are:

HW: NVidia GT 540M
Driver: 268.30

I have not dug yet to see if this is something in OSG that may be incorrectly 
setting up the FBO or if it's a fundamental problem.

Any quick ideas?

... 

Thank you!

Cheers,
Brad
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgOcean: Update cubemap often not working?

2012-06-07 Thread Brad Colbert
Hi folks,

Reading my post it's even hard for me to tell what I'm asking.  I'll try to 
simplify the question with this reply.

I'm trying to make the cubemap used in osgOcean (and the example osgOcean 
application) dynamic by attaching the faces of the cubemap to cameras as FBOs 
(see osgprerendercubemap example).  The problem is that I only see the effects 
of the first frame rendered to the FBO and nothing after, so they are not 
really dynamic.

I've attached (to the original message) my example source code which calls 
glCear in a draw callback for each camera.

Any insight would be helpful.

... 

Thank you!

Cheers,
Brad

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=48119#48119





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgOcean: Update cubemap often not working?

2012-06-04 Thread Brad Colbert
Hi folks,

I'm not sure what I'm missing, but I'm trying to update the cubemap used in 
osgOcean (and the example application) with a series of cameras.  The approach 
I've taken is derived from the osgprerendercubemap example.  I'm rendering our 
sky model to the cubemap but, strangely it does not appear to update when the 
time of day is changed?  

I've simplified my updates to the example application so that I can post it 
here.  In a pre-draw callback I call glClear when the camera ID  and the 
current count match.  What I expect to happen is that the clear color should 
iterate through all of the cameras (and cubemap panels), changing about once 
per second.  What I see is no effect of the clear.

If I call clear on all cameras at least once I get all of the panels in the 
cubemap with the clear color, but if the color changes during run-time, I see 
no change in the cubemap.

Debugging, I know that this pre-render call is made for all of the cubemap 
cameras every frame, but after the initial pass, it appears to not have an 
effect, although it is still called.

I appreciate any insight, thanks.

... 

Thank you!

Cheers,
Brad

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=48030#48030




Attachments: 
http://forum.openscenegraph.org//files/updatecameraandcubetexcallback_186.h
http://forum.openscenegraph.org//files/drawskyaspredrawcallback_759.h
http://forum.openscenegraph.org//files/updatecameraandcubetexcallback_737.cpp
http://forum.openscenegraph.org//files/drawskyaspredrawcallback_110.cpp
http://forum.openscenegraph.org//files/application_291.cpp


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgOcean] Dose anybody has other learing resources about osgOcean?

2012-06-01 Thread Brad Colbert
Hi Kim,

Thanks for your response.  I appreciate the paper and will give it a read.

...


Thank you!

Cheers,
Brad

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=47999#47999





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgOcean] Dose anybody has other learing resources about osgOcean?

2012-05-25 Thread Brad Colbert
Hi Kim,

I too am looking for resources about some specifics on osgOcean.

Generally, what is the ratio of wind speed to wave height?  Is there a simple 
function for this?  I want to be able to model certain wave heights and, as I 
understand it, this is driven by wind speed.

Are the top/bottom wave colors derived by hand or from a publication?  If a 
publication, which?  (Same question for the lighting color)

I'm trying to gain an understanding of the size of the OceanScene (tiles).  
Looking at the bounding sphere it starts out at roughly 12000x12000 (is that 
meters?)  When setting the parameters for osgOcean::FFTOceanSurface (gridsize, 
resolution, numtiles) to values other than what is in the example results in 
some pretty rough artifacts.  Is there a rule of thumb for setting these values?


Thank you!

Cheers,
Brad

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=47838#47838





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problem using osgconv to write OpenFlight

2012-04-03 Thread Brad Colbert
Paul,

Thanks for your reply. 

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul Martz
Sent: Thursday, March 29, 2012 9:42 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Problem using osgconv to write OpenFlight

Hi Brad -- The client that contracted with me to develop the OpenFlight 
exporter 
specifically requested that the exporter support the same feature set as the 
importer. Since the importer doesn't load image files, likewise the exporter 
doesn't export image files. I'm not saying that's a good decision, I'm just 
giving you the background. :-)

If you want to add this capability, you should probably use an export option to 
enable it, with the default being to not write the image data to files.

As far as where to add this in the code, the exporter is a NodeVisitor. You 
should probably add a map of textures so that shared textures don't get written 
multiple times.
-Paul


On 1/20/2012 5:07 PM, Brad Colbert wrote:
 Hi folks,

 I found a work around.  First, if I convert the IVE to OSG with the option 
 osgconv -O OutputTextureFiles it will write out the .dds files.  Then, I 
 convert the IVE to FLT, which picks up those .dds files.

 A bit of a kludge but was wondering where I should look to make the proper 
 changes to the OpenFlight writer to output the textures?

 -B


 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
 Sent: Friday, January 20, 2012 3:56 PM
 To: 'osg-us...@openscenegraph.org'
 Subject: [osg-users] Problem using osgconv to write OpenFlight

 Hi folks,

 I'm suspecting that something is wrong with my DDS plugin but thought I would 
 ask to see if it's something more fundamental.

 I'm trying to convert a .ive file to an OpenFlight file.  I get the (.flt) 
 file and the texture attribute files (.attr) but no texture files (.dds).  
 Any ideas why?

 Thanks,
 Brad

 P.S.

 OpenSceneGraph Library 3.0.1

 ---
 Brad Colbert
 Renaissance Sciences Corporation
 (480) 374-5073


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Retrobooster - OSG-based game

2012-03-21 Thread Brad Colbert
Fantastic!

Some hints of that old helicopter game from back in the day.  Nice!

-B

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Terry Welsh
Sent: Wednesday, March 21, 2012 10:51 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Retrobooster - OSG-based game

At the risk of sounding like a shameless self-promoter, here's level
playthrough video from a hobby project I've been working on.  I'd be
grateful to hear any critiques or ideas anyone has.  Plus, I thought
people might get a kick out of seeing a pretty involved OSG project in
development.

http://www.youtube.com/watch?v=VkVbq4jIr2k
--
Terry Welsh
mogumbo 'at' gmail.com
www.reallyslick.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Page-in notification

2012-01-23 Thread Brad Colbert
Hi Robert,

Thanks for the reply.  When the object is loaded in, is it safe to begin 
performing intersection tests on the geometry?

-B

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Sunday, January 22, 2012 8:49 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Page-in notification

HI Brad,

On 21 January 2012 15:48, Brad Colbert bcolb...@rscusa.com wrote:
 I'm sure this has been asked a few times but is there a way to be notified 
 when a tile for a VPB database is paged in?  We have some dynamically loaded 
 buildings that we would like to re-clamp as the tile underneath pages.

There isn't a specific page in callback, but you can use a
osgDB::ReadFileCallback attached to the osgDB::Registry to intercept
the read calls and keep track of when the objects are loaded in.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Page-in notification

2012-01-21 Thread Brad Colbert
Hi folks,

I'm sure this has been asked a few times but is there a way to be notified when 
a tile for a VPB database is paged in?  We have some dynamically loaded 
buildings that we would like to re-clamp as the tile underneath pages.

-B

---
Brad Colbert
Renaissance Sciences Corporation
(480) 374-5073

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Problem using osgconv to write OpenFlight

2012-01-20 Thread Brad Colbert
Hi folks,

I'm suspecting that something is wrong with my DDS plugin but thought I would 
ask to see if it's something more fundamental.

I'm trying to convert a .ive file to an OpenFlight file.  I get the (.flt) file 
and the texture attribute files (.attr) but no texture files (.dds).  Any ideas 
why?

Thanks,
Brad

P.S.

OpenSceneGraph Library 3.0.1

---
Brad Colbert
Renaissance Sciences Corporation
(480) 374-5073


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problem using osgconv to write OpenFlight

2012-01-20 Thread Brad Colbert
Hi folks,

I found a work around.  First, if I convert the IVE to OSG with the option 
osgconv -O OutputTextureFiles it will write out the .dds files.  Then, I 
convert the IVE to FLT, which picks up those .dds files.

A bit of a kludge but was wondering where I should look to make the proper 
changes to the OpenFlight writer to output the textures?

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
Sent: Friday, January 20, 2012 3:56 PM
To: 'osg-us...@openscenegraph.org'
Subject: [osg-users] Problem using osgconv to write OpenFlight

Hi folks,

I'm suspecting that something is wrong with my DDS plugin but thought I would 
ask to see if it's something more fundamental.

I'm trying to convert a .ive file to an OpenFlight file.  I get the (.flt) file 
and the texture attribute files (.attr) but no texture files (.dds).  Any ideas 
why?

Thanks,
Brad

P.S.

OpenSceneGraph Library 3.0.1

---
Brad Colbert
Renaissance Sciences Corporation
(480) 374-5073


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Running a viewer in a thread other than main thread

2011-12-06 Thread Brad Colbert
Bart,

I believe in the OSG threading model CullThreadPerCameraDrawThreadPerContext 
produced some inherit threading at some level for each camera and context.

Is there a specific reason you need a separate context?

Can the agents be in their own threads with a sync' or rendezvous mechanism to 
set up the viewing parameters for their cameras and get the imagery from their 
camera?

-B

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris 'Xenon' 
Hanson
Sent: Tuesday, December 06, 2011 1:36 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Running a viewer in a thread other than main thread

On 12/6/2011 2:15 PM, bart gallet wrote:
 thanks Chris
 I almost don't dare to ask, but I'll do it anyways, so then I will have come 
 to a full circle  :)
 I'd like to run a viewer for rendering to an FBO in a separate thread, so 
 that it is in the background since it's not for displaying. Will I get into 
 trouble doing this?

  This is not recommended.

  What are you trying to do simultaneously with the Viewer::frame() operation?

  Could you launch a new thread and do the secondary operation in THAT thread 
so that
Viewer can keep running in its original thread like it wants to?

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist. - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to create a decal on a road segment?

2011-11-28 Thread Brad Colbert
Raymond,


We had a similar problem with a few, older, air field models.  Luckily the 
polygons that represent the stripes where positioned in the models scene-graph 
to draw last (with respect to the model).  All that was required was for us to 
turn off depth for the sections that needed it (indicated by comments at the 
nodes that mattered).

//
class SetAllNodesToNoDepth : public osg::NodeVisitor
{
public:
SetAllNodesToNoDepth():
  osg::NodeVisitor( osg::NodeVisitor::TRAVERSE_ALL_CHILDREN )
  {}

  void apply( osg::Node node )
  {
  osg::StateSet* stateset = node.getStateSet();

  if ( stateset )
  {
  stateset-setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF );

  node.setStateSet( stateset );
  }

  traverse(node);
  }
};

...

model-accept( new SetAllNodesToNoDepth() );

...


I think the order can be managed with render bins as well.

There are a few ways to skin that cat.

Good luck!

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Raymond Bosman
Sent: Monday, November 28, 2011 8:25 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] How to create a decal on a road segment?

To demonstrate the problem here is a screenshot.
[Image: http://forum.openscenegraph.org/files/ramp_segment_587.png ]

The code below shows a simplified version of the problem. When you look at the 
same angle as shown in the screenshot, the 'lanes' (red triangles) will appear 
through the 'road' (green rectangles).


Code:

#include osg/Geode
#include osg/Geometry
#include osg/ShapeDrawable
#include osg/Depth
#include osgViewer/Viewer
#include osgGA/TrackballManipulator
#include osgDB/WriteFile

#include vector


#include osg/Stencil


osg::Geometry * createGeometry( const std::vectorfloat roadheight, float 
width, osg::Vec4Array *color, bool isDecal )
{
  osg::ref_ptrosg::Geometry geometry = new osg::Geometry;

  // Geometry
  osg::Vec3Array* vertices = new osg::Vec3Array;
  for( int i = 0; i  roadheight.size(); ++i )
  {
vertices-push_back(osg::Vec3( (float) i, 0 , roadheight[i]));

if( !isDecal || i % 2 == 1 )
{
  vertices-push_back(osg::Vec3( (float) i, width , roadheight[i]));
}
  }

  geometry-setVertexArray(vertices);

  // Set color
  geometry-setColorArray(color);
  geometry-setColorBinding(osg::Geometry::BIND_OVERALL);

  // Normals, all upwards for now
  osg::Vec3Array* normals = new osg::Vec3Array;
  normals-push_back(osg::Vec3(0.0f,0.0f,1.0f));
  geometry-setNormalArray(normals);
  geometry-setNormalBinding(osg::Geometry::BIND_OVERALL);

  geometry-addPrimitiveSet(new osg::DrawArrays( ( isDecal ? 
osg::PrimitiveSet::TRIANGLES : osg::PrimitiveSet::TRIANGLE_STRIP ) 
,0,vertices-size()));

  return geometry.release();
}


osg::Geode*  stencilGeometry( osg::Geometry *road, osg::Geometry *decal)
{
  osg::Geode *geode = new osg::Geode; 

// Write to stencil buffer
   {
osg::Stencil* stencil = new osg::Stencil;
stencil-setFunction(osg::Stencil::ALWAYS, 1,~0u); // Always pass where we 
draw. Write 1 to stencil buffer.
stencil-setOperation(osg::Stencil::KEEP, osg::Stencil::REPLACE, 
osg::Stencil::REPLACE);

osg::StateSet *stateset = road-getOrCreateStateSet();
stateset-setRenderBinDetails(1,RenderBin);
stateset-setAttributeAndModes(stencil,osg::StateAttribute::ON | 
osg::StateAttribute::OVERRIDE);
stateset-setMode(GL_STENCIL_TEST, osg::StateAttribute::ON | 
osg::StateAttribute::OVERRIDE);
stateset-setMode(GL_DEPTH_TEST, osg::StateAttribute::ON | 
osg::StateAttribute::OVERRIDE);
   }

geode-addDrawable( road );

{
osg::Stencil* stencil = new osg::Stencil;
stencil-setFunction(osg::Stencil::EQUAL, 1, ~0u); // Draw only if 1.
stencil-setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, 
osg::Stencil::KEEP);

osg::StateSet *stateset = decal-getOrCreateStateSet();
stateset-setRenderBinDetails(1,RenderBin);
stateset-setAttributeAndModes(stencil,osg::StateAttribute::ON | 
osg::StateAttribute::OVERRIDE);
stateset-setMode(GL_STENCIL_TEST, osg::StateAttribute::ON | 
osg::StateAttribute::OVERRIDE);
stateset-setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF | 
osg::StateAttribute::OVERRIDE);
stateset-setMode(GL_CULL_FACE, osg::StateAttribute::ON | 
osg::StateAttribute::OVERRIDE);
}
 
geode-addDrawable( decal );

return geode;
}


osg::Geode* multipassGeometry( osg::Geometry *road, osg::Geometry *decal)
{
  osg::Geode *geode = new osg::Geode; 

  // road
  {
osg::StateSet *stateset = road-getOrCreateStateSet();
stateset-setRenderBinDetails(1,RenderBin);
stateset-setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF | 
osg::StateAttribute::OVERRIDE);

geode-addDrawable( road );
  }

  // Decal
  {
osg::StateSet *stateset = 

[osg-users] Performance results? Intel (icc) or GNU gcc?

2011-11-16 Thread Brad Colbert
Hi folks,

This is a general question for those who have tried out the Intel compiler.

For those who have, I'm wondering what your experience has been with 
performance.  Did you see an increase in the performance of OSG on your system 
when compiled with the Intel compiler?  If so, can you quantify it?

Thanks!

-B

---
Brad Colbert
Renaissance Sciences Corporation
(480) 374-5073


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Explosion Effect removal

2011-10-13 Thread Brad Colbert
Hi folks,

I'm using a modification of the Explosion Effect from the osgParticle.  I want 
the effect to be removed when it's done but it's not obvious how to make this 
work.  There are quite a few being created and over time they consume quite a 
bit of the frame time.  Any ideas on how to remove them safely when they are 
done?

Thanks!

-B

---
Brad Colbert
Renaissance Sciences Corporation
(480) 374-5073

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] GLSL shaders and projective texturing

2011-09-29 Thread Brad Colbert
Funny, I should have changed my search to just projective texture and I think 
this would have popped up.

-B

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of J.P. Delport
Sent: Thursday, September 29, 2011 5:19 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] GLSL shaders and projective texturing

I think Paul Martz did already.

http://thread.gmane.org/gmane.comp.graphics.openscenegraph.cvs/9237/focus=9304

jp

On 29/09/2011 13:46, Per Nordqvist wrote:
 I also struggled with this issue once and I believe osgspotlight suffers
 from exactly the same quadrant defect if you look closely.
 Would be really nice if somebody submitted a fix.

 /Per

 On 29 September 2011 01:59, Brad Colbert bcolb...@rscusa.com
 mailto:bcolb...@rscusa.com wrote:

 Glenn,

 __ __

 Bingo!  That was it.  I wasn't quite sure that would work with
 TexGen but there you go!

 __ __

 Thanks!

 __ __

 

 __ __

 -B

 __ __

 *From:*osg-users-boun...@lists.openscenegraph.org
 mailto:osg-users-boun...@lists.openscenegraph.org
 [mailto:osg-users-boun...@lists.openscenegraph.org
 mailto:osg-users-boun...@lists.openscenegraph.org] *On Behalf Of
 *Glenn Waldron
 *Sent:* Wednesday, September 28, 2011 4:40 PM


 *To:* OpenSceneGraph Users
 *Subject:* Re: [osg-users] GLSL shaders and projective texturing

 __ __

 Brad,

 I once had the same issue; calcuating my texgen matrix like this
 worked:

 __ __

 texGenMat =

  modelViewMat *

  projectionMat *

  osg::Matrix::translate(1, 1, 1) *

  osg::Matrix::scale(0.5, 0.5, 0.5);

 __ __


 Glenn Waldron / Pelican Mapping / @glennwaldron

 

 On Wed, Sep 28, 2011 at 7:34 PM, Brad Colbert bcolb...@rscusa.com
 mailto:bcolb...@rscusa.com wrote:

 Hi Chris,

 Thanks!  I found that one too but it still doesn't help me figure
 out how to fix the coordinates so that my projected texture renders
 in the center of the projection frustum instead of the upper right
 quadrant.  It's strange and I can't figure it out.

 -B



 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org
 mailto:osg-users-boun...@lists.openscenegraph.org
 [mailto:osg-users-boun...@lists.openscenegraph.org
 mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
 Chris 'Xenon' Hanson
 Sent: Wednesday, September 28, 2011 3:31 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] GLSL shaders and projective texturing

 On 9/27/2011 7:21 PM, Brad Colbert wrote:
   I am closer!

   Looks like the other example I have is FFP not GLSL. Here's a
 working GLSL
 implementation (not OSG) that should be relatively easy to feed with
 OSG uniforms and such:

 http://www.ozone3d.net/tutorials/glsl_texturing_p08.php#part_8

 --
 Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
 http://www.alphapixel.com/
   Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training.
 Consulting. Contracting.
 There is no Truth. There is only Perception. To Perceive is to
 Exist. - Xen
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 mailto:osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 mailto:osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

 __ __


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 mailto:osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users

Re: [osg-users] GLSL shaders and projective texturing

2011-09-28 Thread Brad Colbert
Hi Chris,

Thanks!  I found that one too but it still doesn't help me figure out how to 
fix the coordinates so that my projected texture renders in the center of the 
projection frustum instead of the upper right quadrant.  It's strange and I 
can't figure it out.

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris 'Xenon' 
Hanson
Sent: Wednesday, September 28, 2011 3:31 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] GLSL shaders and projective texturing

On 9/27/2011 7:21 PM, Brad Colbert wrote:
 I am closer!

  Looks like the other example I have is FFP not GLSL. Here's a working GLSL
implementation (not OSG) that should be relatively easy to feed with OSG 
uniforms and such:

http://www.ozone3d.net/tutorials/glsl_texturing_p08.php#part_8

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist. - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] GLSL shaders and projective texturing

2011-09-27 Thread Brad Colbert
Hi folks,

I'm looking for a complete example showing projective texturing with GLSL 
shaders in OSG.  I'm simply trying to implement a spotlight just like the 
osgspotlight example.  What I've found doesn't quite paint the whole picture 
for me.  Anything would be helpful.

Cheers,
Brad

---
Brad Colbert
Renaissance Sciences Corporation
(480) 374-5073


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] GLSL shaders and projective texturing

2011-09-27 Thread Brad Colbert
Hi Chris,



Thanks for the quick reply and the lead.  I'm still fumbling around with that 
example and I think I've found an issue with it.  It appears to be sensitive to 
the camera position (ie not the correct projection solution).  This little bit 
in the shader makes me feel that it's suspect (+vec2(0.5,0.5)):



 vec4 color =  texture2D(projectionMap,dividedCoord.st+vec2(0.5,0.5)  );





Do embedded images come across in these emails:



Startup:



[cid:image001.png@01CC7D27.0D484B60]



Moving in slide to the right (projection moves to the far right):



[cid:image002.png@01CC7D27.5588D890]



-B





-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris 'Xenon' 
Hanson
Sent: Tuesday, September 27, 2011 1:44 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] GLSL shaders and projective texturing



On 9/27/2011 2:16 PM, Brad Colbert wrote:

 Hi folks,

 I'm looking for a complete example showing projective texturing with GLSL 
 shaders in OSG.  I'm simply trying to implement a spotlight just like the 
 osgspotlight example.  What I've found doesn't quite paint the whole picture 
 for me.  Anything would be helpful.



  This one seemed fairly complete.

http://www.jotschi.de/?p=378





  Ping me if you need help on the project.





--

Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/

  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.

There is no Truth. There is only Perception. To Perceive is to Exist. - 
Xen

___

osg-users mailing list

osg-users@lists.openscenegraph.org

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
inline: image001.pnginline: image002.png___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] GLSL shaders and projective texturing

2011-09-27 Thread Brad Colbert
());

return stateset;
}
 
/**
 * Load some model, scale it and apply the shader
 */
osg::Node* createModel()
{
osg::Group* root = new osg::Group;
 
/* Load the terrain which will be the receiver of out projection */
osg::Node* terr = 
osgDB::readNodeFile(C:\\Users\\bcolbert\\Documents\\JOSHVILLE_new2.ive);

root-addChild( terr );
 
/* Enable projective texturing for all objects of this node */
root-setStateSet( createProjectorState() );
return root;
}

int main( int argc, char* argv[] )
{
// Set the output level
osg::setNotifyLevel( osg::WARN );
 
osg::ArgumentParser arguments(argc, argv);
 
osg::ref_ptrosg::Group sceneA = new osg::Group;
osg::ref_ptrosg::Group sceneB = new osg::Group;
osg::ref_ptrosg::Group sceneC = new osg::Group;
sceneA-addChild(createModel());

osgViewer::CompositeViewer viewer(arguments);

viewer.addView(viewA);
viewA-setUpViewInWindow(10, 10, 640, 480);
viewA-setSceneData(sceneA.get());

//Add this to move the projector by mouse - you need to disable the set
//of the viewmatrix in the while loop below.
  osgGA::TrackballManipulator* aManipulator = new 
osgGA::TrackballManipulator;
viewA-setCameraManipulator(aManipulator);

// Create a TexGenNode to automatically update the
// planes.
osg::TexGenNode* texgenNode = new osg::TexGenNode;
texgenNode-setTextureUnit( (int)spotTUnit );

osg::TexGen* texgen = texgenNode-getTexGen();
texgen-setMode( osg::TexGen::EYE_LINEAR );

osg::MatrixTransform* posTexGen = new osg::MatrixTransform;
posTexGen-addChild( texgenNode );

osg::Vec3 position(0.0f,0.0f,0.0f);
osg::Vec3 direction(0.0f,1.0f,0.0f);
osg::Vec3 up(0.0f,0.0f,1.0f);
up = (direction ^ up) ^ direction;
up.normalize();

texgen-setPlanesFromMatrix( osg::Matrixd::lookAt(position, 
position+direction, up)*
 viewA-getCamera()-getProjectionMatrix() );
// osg::Matrixd::perspective(45.f,1.0,0.1,100));

sceneA-addChild( posTexGen );


while ( !viewer.done() )
  {
osg::Matrixd viewMatInv( viewA-getCamera()-getInverseViewMatrix() );
ViewMatInv-set( viewMatInv );

// Position the TexGenNode in the world with the camera;
posTexGen-setMatrix( aManipulator-getInverseMatrix() );

viewer.frame();
}
return 0;
}


Vertex shader:

uniform mat4 ViewMatInv;

void main()
{
vec4 posEye =  gl_ModelViewMatrix * gl_Vertex;
// vec4 posWorld = ViewMatInv * posEye;

gl_TexCoord[3].s = dot( posEye, gl_EyePlaneS[3] );
gl_TexCoord[3].t = dot( posEye, gl_EyePlaneT[3] );
gl_TexCoord[3].p = dot( posEye, gl_EyePlaneR[3] );
gl_TexCoord[3].q = dot( posEye, gl_EyePlaneQ[3] );

gl_Position = gl_ProjectionMatrix * posEye;
}


Fragment shader:

uniform sampler2D projectionMap;
varying vec4 projCoord;
 
void main()
{
gl_FragColor = texture2DProj( projectionMap, gl_TexCoord[3] );

#if TEST_FOR_REVERSE_PROJECTION
if ( gl_TexCoord[3].q  0.0 )
gl_FragColor = texture2DProj( projectionMap, gl_TexCoord[3] );
else
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
#endif
}
-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
Sent: Tuesday, September 27, 2011 1:16 PM
To: 'osg-us...@openscenegraph.org'
Subject: [osg-users] GLSL shaders and projective texturing

Hi folks,

I'm looking for a complete example showing projective texturing with GLSL 
shaders in OSG.  I'm simply trying to implement a spotlight just like the 
osgspotlight example.  What I've found doesn't quite paint the whole picture 
for me.  Anything would be helpful.

Cheers,
Brad

---
Brad Colbert
Renaissance Sciences Corporation
(480) 374-5073


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Density of the SmokeTrailEffect

2011-08-31 Thread Brad Colbert
No luck so I tried:

osgParticle::ModularEmitter* emitter =
dynamic_castosgParticle::ModularEmitter*( 
smoke-getEmitter() );

if ( emitter )
{
osgParticle::ConstantRateCounter* counter =

dynamic_castosgParticle::ConstantRateCounter*( emitter-getCounter() );

if ( counter )
counter-setNumberOfParticlesPerSecondToCreate( 
500 );
}

and still no luck.

-B

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jason Daly
Sent: Wednesday, August 31, 2011 11:23 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Density of the SmokeTrailEffect

On 08/31/2011 02:16 PM, Brad Colbert wrote:

Hi folks,



I have a simple rocket model with a SmokeTrailEffect added and the trail is 
more like a train of puffs.  How do I control the density or closeness of 
the puffs to make it look more like a trail?

The SmokeTrailEffect's ModularEmitter object has a parameter that you can tweak 
to compensate emission rate for movement rate.  I've not used it myself, so I 
don't have any advice on how exactly to adjust it.

--J
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OpenGL 3.0 support

2011-05-10 Thread Brad Colbert
Is there an example that works with GL 3?

I keep getting errors due to reliance on FFP capabilities.

-B

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
Sent: Monday, May 09, 2011 3:10 PM
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] OpenGL 3.0 support

Paul,

That was the problem, thanks.  I didn't turn them off.

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul Martz
Sent: Monday, May 09, 2011 1:49 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] OpenGL 3.0 support

On 5/9/2011 12:08 PM, Brad Colbert wrote:
 Hi folks,

 There may be a simple answer to this question but how do you successfully 
 compile osg 2.9.* with OpenGL 3.0 support?  I'm getting undefined functions, 
 such as glLoadMatrixf.

glLoadMatrixf isn't a 3.0 function. The likely cause of the problem is either 
that you've enabled FFP in CMake, or there's an issue with svn trunk calling 
FFP 
functions not wrapped by the necessary conditional compile statements.

Try fixing this in CMake first, by disabling all the checkboxes for OpenGL 2.0 
and FFP. There are on by default, and they don't turn themselves off when you 
select the box for 3.0. You might need to regenerate your CMake cache.
-Paul
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OpenGL 3.0 support

2011-05-09 Thread Brad Colbert
Hi folks,

There may be a simple answer to this question but how do you successfully 
compile osg 2.9.* with OpenGL 3.0 support?  I'm getting undefined functions, 
such as glLoadMatrixf.

-B

---
Brad Colbert
Renaissance Sciences Corporation
(480) 374-5073


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OpenGL 3.0 support

2011-05-09 Thread Brad Colbert
Paul,

That was the problem, thanks.  I didn't turn them off.

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul Martz
Sent: Monday, May 09, 2011 1:49 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] OpenGL 3.0 support

On 5/9/2011 12:08 PM, Brad Colbert wrote:
 Hi folks,

 There may be a simple answer to this question but how do you successfully 
 compile osg 2.9.* with OpenGL 3.0 support?  I'm getting undefined functions, 
 such as glLoadMatrixf.

glLoadMatrixf isn't a 3.0 function. The likely cause of the problem is either 
that you've enabled FFP in CMake, or there's an issue with svn trunk calling 
FFP 
functions not wrapped by the necessary conditional compile statements.

Try fixing this in CMake first, by disabling all the checkboxes for OpenGL 2.0 
and FFP. There are on by default, and they don't turn themselves off when you 
select the box for 3.0. You might need to regenerate your CMake cache.
-Paul
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to do a videostreaming

2011-03-03 Thread Brad Colbert
There is a VNC plugin for OSG.  I have not used it but wouldn't that allow a 
remote user to see/manipulate the model.

You can also just do normal VNC desktop sharing, or if you are on Windows lookg 
at Glance (www.glance.net) , or desktop sharing via Skype.

-B

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sergey Kurdakov
Sent: Friday, February 18, 2011 5:09 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] How to do a videostreaming

Hi Nagore,

But now, when I do a streaming, I want the remote expert to see the rendered 
model too, i.e., the remote expert sees exactly the same as the user can see 
in the glasses.

there are several steps to stream
: have an image sequence, code it, then send as some type of video stream.

osg has ffmpeg plugin which can code and then stream video ( rtsp, maybe rtmp 
in latest ffmpeg builds ).
But I did not check for a while if it is in state

but look this forum page

http://forum.openscenegraph.org/viewtopic.php?t=1758

Regards
Sergey

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Camara: PreDrawCallback and PostDrawCallBack

2011-03-03 Thread Brad Colbert
Thanks Robert and sorry for the late reply,

Our sensor package is designed to be a general drop in to any (within reason) 
OpenGL application.  It provides it's own FBO and processing.  They just need 
to be enabled and disabled at the right time.  Having something else create and 
manage an FBO for our package to use just adds complexity that we would 
prefer not to deal with.  The PreDraw and PostDraw appear to be working fine 
for this and made it simple to integrate our product with OSG.

Cheers,
Brad


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Saturday, January 22, 2011 4:42 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Camara: PreDrawCallback and PostDrawCallBack

Hi Brad,

It sounds like you are just using a mutli-pass render to texture
technique, in which case the OSG supports this without need for
callbacks or subclassing.  osgprerender or osgdistortion are good
examples to learn from.

Robert.

On Fri, Jan 21, 2011 at 11:51 PM, Brad Colbert bcolb...@rscusa.com wrote:
 Hello folks,

 We have a custom sensor model that we have used for some time with OSG.  It 
 provides an FBO for rendering the scene to, processes the captured scene, and 
 then will render the FBO when completed.  I would like to change the way we 
 use it in OSG to make it work closer to the osg::Camera class.

 My first thought was to derive a Camera class and override the applicable 
 functions.  At first glance, this appears a bit more involved than I really 
 hoped.

 While looking at the Class I see (and now remember) Pre and Post draw calls.  
 My big questions are:

 1.  Is the graphics context bound when these calls are made? (if not, why 
 not) 2.  If so, am I allowed to bind my FBO in the pre-draw, and draw in my 
 post draw?

 Thanks!

 ---
 Brad Colbert
 Renaissance Sciences Corporation


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Why does Draw skip frame number as reported from FrameStamp::getFrameNumber()?

2011-03-03 Thread Brad Colbert
Robert,

Touching back on this thread:  I guess my question is if frame number skipping 
is the designed behavior?  If so, then I'll just have to figure out a way to 
deal with it, if it is not, then I can dig in a little deeper to figure out why 
it's skipping.  Any suggestions will help.

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
Sent: Thursday, February 03, 2011 10:27 AM
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
FrameStamp::getFrameNumber()?

One more update:

I modified the code slightly in both the Pre and Post draw callbacks to compare 
frame numbers.  I would expect that they would have the same number, but they 
do not at times.

I also added a bit of code to the PostDraw to compare the last frame number to 
the current.  The results are not what I would expect.

Again, this is DrawThreadPerContext.

Output snipet:

Pre 0x7fffe5f49f90 : 1501
Pos 0x7fffe66f6ea0 : 1501

Pre 0x7fffe5f49f90 : 1502
Pos 0x7fffe66f6ea0 : 1503 ** Not Next ** previous frame was 1501

Pre 0x7fffe5f49f90 : 1503
Pos 0x7fffe66f6ea0 : 1503 ** Not Next ** previous frame was 1503

Pre 0x7fffe5f49f90 : 1504
Pos 0x7fffe66f6ea0 : 1504

Pre 0x7fffe5f49f90 : 1505
Pos 0x7fffe66f6ea0 : 1506 ** Not Next ** previous frame was 1504

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
Sent: Thursday, February 03, 2011 10:11 AM
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
FrameStamp::getFrameNumber()?

Simplifying my example, my PostDrawCallback now simply prints the pointer value 
of *this (to determine that it's the same PostDrawCallback instance) and the 
frame number and I get the following (snipet):

0x2a9a400:896
0x2a9a400:896
0x2a9a400:898
0x2a9a400:899
0x2a9a400:899
0x2a9a400:901
0x2a9a400:902
0x2a9a400:902
0x2a9a400:904

Clearly it's the same callback, there is only one camera, and the frame number 
is repeating and skipping.

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, February 03, 2011 9:14 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
FrameStamp::getFrameNumber()?

Hi Brad,

I couldn't make sense of your original email and same with this one,
I'm confused by the role of your map and would suspect that your
method is the cause of the odd output.

The way I'd check the current frame number is to simply have a draw
callback directly output the frame number.

Robert.

On Thu, Feb 3, 2011 at 5:07 PM, Brad Colbert bcolb...@rscusa.com wrote:
 I'm resending this with a new Subject: line.  Worried that it was a little 
 too cryptic.

 I'm trying to understand how the threading works in OSG when 
 DrawThreadPerContext with respect to which process is on which frame at which 
 time.  It appears to me that the draw frame is skipping values in the frame 
 count, as reported from FrameStamp::getFrameNumber().

 My test code fills a mapint,bool (the int is the frame time, and bool is 
 just there ;) ) in a cull traversal by using the following code:

 //
 const osg::FrameStamp* frameStamp = cv-getFrameStamp();

 frameMap[frameStamp-getFrameNumber()] = true;


 //
 And in a PostDrawCallback on a camera I'm printing out the current frame # : 
 the frames #'s in the map, and then I clear the current frame number entry:

 // Get the current frame number
 osg::FrameStamp* frameStamp = renderInfo.getState()-getFrameStamp();

 int frameNumber = frameStamp-getFrameNumber();

 std::cout  frameNumber   : ;

 std::mapint, bool::const_iterator framei = frameMap.begin();

 for (; framei != frameMap.end(); framei++ )
    std::cout  framei-first  , ;

 std::cout  \n\n;

 frameMap.erase( frameNumber );


 The following is the output on the console.  Again, the first number is the 
 current frame number in the PostDrawCallback of the camera.  The following 
 numbers, on the same line, are the frame numbers placed in the map during the 
 cull traversal.


 746 :

 747 :

 749 : 748, 749,

 750 : 748, 750,

 751 : 748, 751,

 752 : 748, 752,

 753 : 748, 753,

 754 : 748,

 755 : 748, 755,

 756 : 748,

 757 : 748, 756, 757,

 758 : 748, 756, 758,

 759 : 748, 756, 759,

 759 : 748, 756,

 761 : 748, 756, 760, 761,


 My question is, why is the draw skipping frame numbers?

 ---
 Brad Colbert
 Renaissance Sciences Corporation

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http

[osg-users] Drawable::UpdateCallback, Modelview and projection matrices

2011-02-14 Thread Brad Colbert
Hello all,

Is there a way to get the current ModelView and Projection matrices in the 
update() call?

Thanks,
Brad

---
Brad Colbert
Renaissance Sciences Corporation


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Drawable::UpdateCallback, Modelview and projection matrices

2011-02-14 Thread Brad Colbert
Hi Robert,

I'm computing the NDC coordinates of Particles in a derived ParticleSystem.  
I'm doing it in the drawImplementation which feels wrong, but can live with 
it.  I was interested in moving this computation to the update phase, but I'm 
starting to think this isn't the best plan.  This was just a quick 
investigation to figure out if it could be moved.

Thanks
Brad

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Monday, February 14, 2011 11:34 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Drawable::UpdateCallback, Modelview and projection 
matrices

Hi Brad

On Mon, Feb 14, 2011 at 7:10 PM, Brad Colbert bcolb...@rscusa.com wrote:
 Is there a way to get the current ModelView and Projection matrices in the 
 update() call?

There isn't necessarily any one modelview and projection matrix as the
OSG can have multiple cameras rendering the scene at one time.

Is the viewer's master Camera that you want a handle to? If so just
get the viewer's camera and get it's projection and view matrixes and
then get the model matrices using the
osg::computeLocalToWorldMatrix(NodePath) wher the NodePath is supplied
by the NodeVisitor::getNodePath().

Robert,
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Why does Draw skip frame number as reported from FrameStamp::getFrameNumber()?

2011-02-03 Thread Brad Colbert
I'm resending this with a new Subject: line.  Worried that it was a little too 
cryptic.

I'm trying to understand how the threading works in OSG when 
DrawThreadPerContext with respect to which process is on which frame at which 
time.  It appears to me that the draw frame is skipping values in the frame 
count, as reported from FrameStamp::getFrameNumber().

My test code fills a mapint,bool (the int is the frame time, and bool is just 
there ;) ) in a cull traversal by using the following code:

//
const osg::FrameStamp* frameStamp = cv-getFrameStamp();

frameMap[frameStamp-getFrameNumber()] = true;


//
And in a PostDrawCallback on a camera I'm printing out the current frame # : 
the frames #'s in the map, and then I clear the current frame number entry:

// Get the current frame number
osg::FrameStamp* frameStamp = renderInfo.getState()-getFrameStamp();

int frameNumber = frameStamp-getFrameNumber();

std::cout  frameNumber   : ;

std::mapint, bool::const_iterator framei = frameMap.begin();

for (; framei != frameMap.end(); framei++ )
std::cout  framei-first  , ;

std::cout  \n\n;

frameMap.erase( frameNumber );


The following is the output on the console.  Again, the first number is the 
current frame number in the PostDrawCallback of the camera.  The following 
numbers, on the same line, are the frame numbers placed in the map during the 
cull traversal.


746 : 

747 : 

749 : 748, 749, 

750 : 748, 750, 

751 : 748, 751, 

752 : 748, 752, 

753 : 748, 753, 

754 : 748, 

755 : 748, 755, 

756 : 748, 

757 : 748, 756, 757, 

758 : 748, 756, 758, 

759 : 748, 756, 759, 

759 : 748, 756, 

761 : 748, 756, 760, 761,


My question is, why is the draw skipping frame numbers?

---
Brad Colbert
Renaissance Sciences Corporation

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Why does Draw skip frame number as reported from FrameStamp::getFrameNumber()?

2011-02-03 Thread Brad Colbert
It was a bit hard to describe.  Let me try to take one more crack at it.

I have an object derived from an osg::Node for which I've implemented my own
virtual void traverse(osg::NodeVisitor nv).

Inside that traverse I keep track of the frame number as reported from the 
CullVisitor.

In a PostDrawCallback on the camera, I compare the frame number as reported by 
the renderInfo to the frame number(s) that where recorded in my derived nodes 
cull traversal.

I would expect that the PostDrawCallback would be one frame number behind the 
cull traversal node, but what I see is the PostDrawCallback is skipping frame 
numbers.

The print out below (all the numbers) is a per frame output from the 
PostDrawCallback.  The left most number is the frame number as reported by 
renderInfo within the PostDrawCallback.  It clearly skips and repeats numbers 
and I'm just trying to understand why, and how I should deal with it.

-B

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, February 03, 2011 9:14 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
FrameStamp::getFrameNumber()?

Hi Brad,

I couldn't make sense of your original email and same with this one,
I'm confused by the role of your map and would suspect that your
method is the cause of the odd output.

The way I'd check the current frame number is to simply have a draw
callback directly output the frame number.

Robert.

On Thu, Feb 3, 2011 at 5:07 PM, Brad Colbert bcolb...@rscusa.com wrote:
 I'm resending this with a new Subject: line.  Worried that it was a little 
 too cryptic.

 I'm trying to understand how the threading works in OSG when 
 DrawThreadPerContext with respect to which process is on which frame at which 
 time.  It appears to me that the draw frame is skipping values in the frame 
 count, as reported from FrameStamp::getFrameNumber().

 My test code fills a mapint,bool (the int is the frame time, and bool is 
 just there ;) ) in a cull traversal by using the following code:

 //
 const osg::FrameStamp* frameStamp = cv-getFrameStamp();

 frameMap[frameStamp-getFrameNumber()] = true;


 //
 And in a PostDrawCallback on a camera I'm printing out the current frame # : 
 the frames #'s in the map, and then I clear the current frame number entry:

 // Get the current frame number
 osg::FrameStamp* frameStamp = renderInfo.getState()-getFrameStamp();

 int frameNumber = frameStamp-getFrameNumber();

 std::cout  frameNumber   : ;

 std::mapint, bool::const_iterator framei = frameMap.begin();

 for (; framei != frameMap.end(); framei++ )
    std::cout  framei-first  , ;

 std::cout  \n\n;

 frameMap.erase( frameNumber );


 The following is the output on the console.  Again, the first number is the 
 current frame number in the PostDrawCallback of the camera.  The following 
 numbers, on the same line, are the frame numbers placed in the map during the 
 cull traversal.


 746 :

 747 :

 749 : 748, 749,

 750 : 748, 750,

 751 : 748, 751,

 752 : 748, 752,

 753 : 748, 753,

 754 : 748,

 755 : 748, 755,

 756 : 748,

 757 : 748, 756, 757,

 758 : 748, 756, 758,

 759 : 748, 756, 759,

 759 : 748, 756,

 761 : 748, 756, 760, 761,


 My question is, why is the draw skipping frame numbers?

 ---
 Brad Colbert
 Renaissance Sciences Corporation

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Why does Draw skip frame number as reported from FrameStamp::getFrameNumber()?

2011-02-03 Thread Brad Colbert
Simplifying my example, my PostDrawCallback now simply prints the pointer value 
of *this (to determine that it's the same PostDrawCallback instance) and the 
frame number and I get the following (snipet):

0x2a9a400:896
0x2a9a400:896
0x2a9a400:898
0x2a9a400:899
0x2a9a400:899
0x2a9a400:901
0x2a9a400:902
0x2a9a400:902
0x2a9a400:904

Clearly it's the same callback, there is only one camera, and the frame number 
is repeating and skipping.

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, February 03, 2011 9:14 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
FrameStamp::getFrameNumber()?

Hi Brad,

I couldn't make sense of your original email and same with this one,
I'm confused by the role of your map and would suspect that your
method is the cause of the odd output.

The way I'd check the current frame number is to simply have a draw
callback directly output the frame number.

Robert.

On Thu, Feb 3, 2011 at 5:07 PM, Brad Colbert bcolb...@rscusa.com wrote:
 I'm resending this with a new Subject: line.  Worried that it was a little 
 too cryptic.

 I'm trying to understand how the threading works in OSG when 
 DrawThreadPerContext with respect to which process is on which frame at which 
 time.  It appears to me that the draw frame is skipping values in the frame 
 count, as reported from FrameStamp::getFrameNumber().

 My test code fills a mapint,bool (the int is the frame time, and bool is 
 just there ;) ) in a cull traversal by using the following code:

 //
 const osg::FrameStamp* frameStamp = cv-getFrameStamp();

 frameMap[frameStamp-getFrameNumber()] = true;


 //
 And in a PostDrawCallback on a camera I'm printing out the current frame # : 
 the frames #'s in the map, and then I clear the current frame number entry:

 // Get the current frame number
 osg::FrameStamp* frameStamp = renderInfo.getState()-getFrameStamp();

 int frameNumber = frameStamp-getFrameNumber();

 std::cout  frameNumber   : ;

 std::mapint, bool::const_iterator framei = frameMap.begin();

 for (; framei != frameMap.end(); framei++ )
    std::cout  framei-first  , ;

 std::cout  \n\n;

 frameMap.erase( frameNumber );


 The following is the output on the console.  Again, the first number is the 
 current frame number in the PostDrawCallback of the camera.  The following 
 numbers, on the same line, are the frame numbers placed in the map during the 
 cull traversal.


 746 :

 747 :

 749 : 748, 749,

 750 : 748, 750,

 751 : 748, 751,

 752 : 748, 752,

 753 : 748, 753,

 754 : 748,

 755 : 748, 755,

 756 : 748,

 757 : 748, 756, 757,

 758 : 748, 756, 758,

 759 : 748, 756, 759,

 759 : 748, 756,

 761 : 748, 756, 760, 761,


 My question is, why is the draw skipping frame numbers?

 ---
 Brad Colbert
 Renaissance Sciences Corporation

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Why does Draw skip frame number as reported from FrameStamp::getFrameNumber()?

2011-02-03 Thread Brad Colbert
One more update:

I modified the code slightly in both the Pre and Post draw callbacks to compare 
frame numbers.  I would expect that they would have the same number, but they 
do not at times.

I also added a bit of code to the PostDraw to compare the last frame number to 
the current.  The results are not what I would expect.

Again, this is DrawThreadPerContext.

Output snipet:

Pre 0x7fffe5f49f90 : 1501
Pos 0x7fffe66f6ea0 : 1501

Pre 0x7fffe5f49f90 : 1502
Pos 0x7fffe66f6ea0 : 1503 ** Not Next ** previous frame was 1501

Pre 0x7fffe5f49f90 : 1503
Pos 0x7fffe66f6ea0 : 1503 ** Not Next ** previous frame was 1503

Pre 0x7fffe5f49f90 : 1504
Pos 0x7fffe66f6ea0 : 1504

Pre 0x7fffe5f49f90 : 1505
Pos 0x7fffe66f6ea0 : 1506 ** Not Next ** previous frame was 1504

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
Sent: Thursday, February 03, 2011 10:11 AM
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
FrameStamp::getFrameNumber()?

Simplifying my example, my PostDrawCallback now simply prints the pointer value 
of *this (to determine that it's the same PostDrawCallback instance) and the 
frame number and I get the following (snipet):

0x2a9a400:896
0x2a9a400:896
0x2a9a400:898
0x2a9a400:899
0x2a9a400:899
0x2a9a400:901
0x2a9a400:902
0x2a9a400:902
0x2a9a400:904

Clearly it's the same callback, there is only one camera, and the frame number 
is repeating and skipping.

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, February 03, 2011 9:14 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
FrameStamp::getFrameNumber()?

Hi Brad,

I couldn't make sense of your original email and same with this one,
I'm confused by the role of your map and would suspect that your
method is the cause of the odd output.

The way I'd check the current frame number is to simply have a draw
callback directly output the frame number.

Robert.

On Thu, Feb 3, 2011 at 5:07 PM, Brad Colbert bcolb...@rscusa.com wrote:
 I'm resending this with a new Subject: line.  Worried that it was a little 
 too cryptic.

 I'm trying to understand how the threading works in OSG when 
 DrawThreadPerContext with respect to which process is on which frame at which 
 time.  It appears to me that the draw frame is skipping values in the frame 
 count, as reported from FrameStamp::getFrameNumber().

 My test code fills a mapint,bool (the int is the frame time, and bool is 
 just there ;) ) in a cull traversal by using the following code:

 //
 const osg::FrameStamp* frameStamp = cv-getFrameStamp();

 frameMap[frameStamp-getFrameNumber()] = true;


 //
 And in a PostDrawCallback on a camera I'm printing out the current frame # : 
 the frames #'s in the map, and then I clear the current frame number entry:

 // Get the current frame number
 osg::FrameStamp* frameStamp = renderInfo.getState()-getFrameStamp();

 int frameNumber = frameStamp-getFrameNumber();

 std::cout  frameNumber   : ;

 std::mapint, bool::const_iterator framei = frameMap.begin();

 for (; framei != frameMap.end(); framei++ )
    std::cout  framei-first  , ;

 std::cout  \n\n;

 frameMap.erase( frameNumber );


 The following is the output on the console.  Again, the first number is the 
 current frame number in the PostDrawCallback of the camera.  The following 
 numbers, on the same line, are the frame numbers placed in the map during the 
 cull traversal.


 746 :

 747 :

 749 : 748, 749,

 750 : 748, 750,

 751 : 748, 751,

 752 : 748, 752,

 753 : 748, 753,

 754 : 748,

 755 : 748, 755,

 756 : 748,

 757 : 748, 756, 757,

 758 : 748, 756, 758,

 759 : 748, 756, 759,

 759 : 748, 756,

 761 : 748, 756, 760, 761,


 My question is, why is the draw skipping frame numbers?

 ---
 Brad Colbert
 Renaissance Sciences Corporation

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Why does Draw skip frame number as reported from FrameStamp::getFrameNumber()?

2011-02-03 Thread Brad Colbert
SingleThreaded and CullDrawThreadPerContext behave as I would expect.

SingleThread output:

Pre 0x2b63900 : 1692
Pos 0x22e5fa0 : 1692

Pre 0x2b63900 : 1693
Pos 0x22e5fa0 : 1693

Pre 0x2b63900 : 1694
Pos 0x22e5fa0 : 1694

Pre 0x2b63900 : 1695
Pos 0x22e5fa0 : 1695



-B

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, February 03, 2011 10:57 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
FrameStamp::getFrameNumber()?

Hi Brad,

What happens when you run SingleThreaded or CullDrawThreadPerContext?

Robert.

On Thu, Feb 3, 2011 at 6:27 PM, Brad Colbert bcolb...@rscusa.com wrote:
 One more update:

 I modified the code slightly in both the Pre and Post draw callbacks to 
 compare frame numbers.  I would expect that they would have the same number, 
 but they do not at times.

 I also added a bit of code to the PostDraw to compare the last frame number 
 to the current.  The results are not what I would expect.

 Again, this is DrawThreadPerContext.

 Output snipet:

 Pre 0x7fffe5f49f90 : 1501
 Pos 0x7fffe66f6ea0 : 1501

 Pre 0x7fffe5f49f90 : 1502
 Pos 0x7fffe66f6ea0 : 1503 ** Not Next ** previous frame was 1501

 Pre 0x7fffe5f49f90 : 1503
 Pos 0x7fffe66f6ea0 : 1503 ** Not Next ** previous frame was 1503

 Pre 0x7fffe5f49f90 : 1504
 Pos 0x7fffe66f6ea0 : 1504

 Pre 0x7fffe5f49f90 : 1505
 Pos 0x7fffe66f6ea0 : 1506 ** Not Next ** previous frame was 1504

 -B


 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
 Sent: Thursday, February 03, 2011 10:11 AM
 To: 'OpenSceneGraph Users'
 Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
 FrameStamp::getFrameNumber()?

 Simplifying my example, my PostDrawCallback now simply prints the pointer 
 value of *this (to determine that it's the same PostDrawCallback instance) 
 and the frame number and I get the following (snipet):

 0x2a9a400:896
 0x2a9a400:896
 0x2a9a400:898
 0x2a9a400:899
 0x2a9a400:899
 0x2a9a400:901
 0x2a9a400:902
 0x2a9a400:902
 0x2a9a400:904

 Clearly it's the same callback, there is only one camera, and the frame 
 number is repeating and skipping.

 -B


 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert 
 Osfield
 Sent: Thursday, February 03, 2011 9:14 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
 FrameStamp::getFrameNumber()?

 Hi Brad,

 I couldn't make sense of your original email and same with this one,
 I'm confused by the role of your map and would suspect that your
 method is the cause of the odd output.

 The way I'd check the current frame number is to simply have a draw
 callback directly output the frame number.

 Robert.

 On Thu, Feb 3, 2011 at 5:07 PM, Brad Colbert bcolb...@rscusa.com wrote:
 I'm resending this with a new Subject: line.  Worried that it was a little 
 too cryptic.

 I'm trying to understand how the threading works in OSG when 
 DrawThreadPerContext with respect to which process is on which frame at 
 which time.  It appears to me that the draw frame is skipping values in the 
 frame count, as reported from FrameStamp::getFrameNumber().

 My test code fills a mapint,bool (the int is the frame time, and bool is 
 just there ;) ) in a cull traversal by using the following code:

 //
 const osg::FrameStamp* frameStamp = cv-getFrameStamp();

 frameMap[frameStamp-getFrameNumber()] = true;


 //
 And in a PostDrawCallback on a camera I'm printing out the current frame # : 
 the frames #'s in the map, and then I clear the current frame number entry:

 // Get the current frame number
 osg::FrameStamp* frameStamp = renderInfo.getState()-getFrameStamp();

 int frameNumber = frameStamp-getFrameNumber();

 std::cout  frameNumber   : ;

 std::mapint, bool::const_iterator framei = frameMap.begin();

 for (; framei != frameMap.end(); framei++ )
    std::cout  framei-first  , ;

 std::cout  \n\n;

 frameMap.erase( frameNumber );


 The following is the output on the console.  Again, the first number is the 
 current frame number in the PostDrawCallback of the camera.  The following 
 numbers, on the same line, are the frame numbers placed in the map during 
 the cull traversal.


 746 :

 747 :

 749 : 748, 749,

 750 : 748, 750,

 751 : 748, 751,

 752 : 748, 752,

 753 : 748, 753,

 754 : 748,

 755 : 748, 755,

 756 : 748,

 757 : 748, 756, 757,

 758 : 748, 756, 758,

 759 : 748, 756, 759,

 759 : 748, 756,

 761 : 748, 756, 760, 761,


 My question is, why is the draw skipping frame numbers?

 ---
 Brad Colbert
 Renaissance Sciences Corporation

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http

Re: [osg-users] Why does Draw skip frame number as reported from FrameStamp::getFrameNumber()?

2011-02-03 Thread Brad Colbert
Robert,

I'm not sure.  I'll try making my own frame stamp and see what I get.

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, February 03, 2011 11:30 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
FrameStamp::getFrameNumber()?

Hi Brad,

Could it be simply that the same FrameStamp is used by the Viewer for
all frames with the frame number + time being updated rather than it
creating a new FrameStamp every frame.   Have a tweak of the osgViewer
code that updats the FrameStamp on each new frame so it assigns a new
FrameStamp if it doesn't already.

Robert.

On Thu, Feb 3, 2011 at 7:21 PM, Brad Colbert bcolb...@rscusa.com wrote:
 SingleThreaded and CullDrawThreadPerContext behave as I would expect.

 SingleThread output:

 Pre 0x2b63900 : 1692
 Pos 0x22e5fa0 : 1692

 Pre 0x2b63900 : 1693
 Pos 0x22e5fa0 : 1693

 Pre 0x2b63900 : 1694
 Pos 0x22e5fa0 : 1694

 Pre 0x2b63900 : 1695
 Pos 0x22e5fa0 : 1695



 -B

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert 
 Osfield
 Sent: Thursday, February 03, 2011 10:57 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
 FrameStamp::getFrameNumber()?

 Hi Brad,

 What happens when you run SingleThreaded or CullDrawThreadPerContext?

 Robert.

 On Thu, Feb 3, 2011 at 6:27 PM, Brad Colbert bcolb...@rscusa.com wrote:
 One more update:

 I modified the code slightly in both the Pre and Post draw callbacks to 
 compare frame numbers.  I would expect that they would have the same number, 
 but they do not at times.

 I also added a bit of code to the PostDraw to compare the last frame number 
 to the current.  The results are not what I would expect.

 Again, this is DrawThreadPerContext.

 Output snipet:

 Pre 0x7fffe5f49f90 : 1501
 Pos 0x7fffe66f6ea0 : 1501

 Pre 0x7fffe5f49f90 : 1502
 Pos 0x7fffe66f6ea0 : 1503 ** Not Next ** previous frame was 1501

 Pre 0x7fffe5f49f90 : 1503
 Pos 0x7fffe66f6ea0 : 1503 ** Not Next ** previous frame was 1503

 Pre 0x7fffe5f49f90 : 1504
 Pos 0x7fffe66f6ea0 : 1504

 Pre 0x7fffe5f49f90 : 1505
 Pos 0x7fffe66f6ea0 : 1506 ** Not Next ** previous frame was 1504

 -B


 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
 Sent: Thursday, February 03, 2011 10:11 AM
 To: 'OpenSceneGraph Users'
 Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
 FrameStamp::getFrameNumber()?

 Simplifying my example, my PostDrawCallback now simply prints the pointer 
 value of *this (to determine that it's the same PostDrawCallback instance) 
 and the frame number and I get the following (snipet):

 0x2a9a400:896
 0x2a9a400:896
 0x2a9a400:898
 0x2a9a400:899
 0x2a9a400:899
 0x2a9a400:901
 0x2a9a400:902
 0x2a9a400:902
 0x2a9a400:904

 Clearly it's the same callback, there is only one camera, and the frame 
 number is repeating and skipping.

 -B


 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert 
 Osfield
 Sent: Thursday, February 03, 2011 9:14 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
 FrameStamp::getFrameNumber()?

 Hi Brad,

 I couldn't make sense of your original email and same with this one,
 I'm confused by the role of your map and would suspect that your
 method is the cause of the odd output.

 The way I'd check the current frame number is to simply have a draw
 callback directly output the frame number.

 Robert.

 On Thu, Feb 3, 2011 at 5:07 PM, Brad Colbert bcolb...@rscusa.com wrote:
 I'm resending this with a new Subject: line.  Worried that it was a little 
 too cryptic.

 I'm trying to understand how the threading works in OSG when 
 DrawThreadPerContext with respect to which process is on which frame at 
 which time.  It appears to me that the draw frame is skipping values in the 
 frame count, as reported from FrameStamp::getFrameNumber().

 My test code fills a mapint,bool (the int is the frame time, and bool is 
 just there ;) ) in a cull traversal by using the following code:

 //
 const osg::FrameStamp* frameStamp = cv-getFrameStamp();

 frameMap[frameStamp-getFrameNumber()] = true;


 //
 And in a PostDrawCallback on a camera I'm printing out the current frame # 
 : the frames #'s in the map, and then I clear the current frame number 
 entry:

 // Get the current frame number
 osg::FrameStamp* frameStamp = renderInfo.getState()-getFrameStamp();

 int frameNumber = frameStamp-getFrameNumber();

 std::cout  frameNumber   : ;

 std::mapint, bool::const_iterator framei = frameMap.begin();

 for (; framei != frameMap.end(); framei

Re: [osg-users] Why does Draw skip frame number as reported from FrameStamp::getFrameNumber()?

2011-02-03 Thread Brad Colbert
Ok, that is strange ;)  I get the same results with my frame number 
(DrawThreadPerContext).  The second number on the line is my frame number which 
is a global unsigned integer that I increment in an overridden frame() call in 
my osgViewer derived class:

Pre 0x2b63230 : 1318 1318
Pos 0x147a230 : 1318 1318

Pre 0x2b63230 : 1319 1319
Pos 0x147a230 : 1320 1320 ** Not Next ** previous frame was 1318

Pre 0x2b63230 : 1320 1320
Pos 0x147a230 : 1320 1320 ** Not Next ** previous frame was 1320

Pre 0x2b63230 : 1321 1321
Pos 0x147a230 : 1321 1321

I simply did this:

//
/// Render a complete new frame.
/// Calls advance(), eventTraversal(), updateTraversal(), renderingTraversals().
//
void
myViewer :: frame( double simulationTime )
{
g_frameNumber++;

osgViewer::Viewer::frame( simulationTime );
}


-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
Sent: Thursday, February 03, 2011 11:45 AM
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
FrameStamp::getFrameNumber()?

Robert,

I'm not sure.  I'll try making my own frame stamp and see what I get.

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, February 03, 2011 11:30 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
FrameStamp::getFrameNumber()?

Hi Brad,

Could it be simply that the same FrameStamp is used by the Viewer for
all frames with the frame number + time being updated rather than it
creating a new FrameStamp every frame.   Have a tweak of the osgViewer
code that updats the FrameStamp on each new frame so it assigns a new
FrameStamp if it doesn't already.

Robert.

On Thu, Feb 3, 2011 at 7:21 PM, Brad Colbert bcolb...@rscusa.com wrote:
 SingleThreaded and CullDrawThreadPerContext behave as I would expect.

 SingleThread output:

 Pre 0x2b63900 : 1692
 Pos 0x22e5fa0 : 1692

 Pre 0x2b63900 : 1693
 Pos 0x22e5fa0 : 1693

 Pre 0x2b63900 : 1694
 Pos 0x22e5fa0 : 1694

 Pre 0x2b63900 : 1695
 Pos 0x22e5fa0 : 1695



 -B

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert 
 Osfield
 Sent: Thursday, February 03, 2011 10:57 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
 FrameStamp::getFrameNumber()?

 Hi Brad,

 What happens when you run SingleThreaded or CullDrawThreadPerContext?

 Robert.

 On Thu, Feb 3, 2011 at 6:27 PM, Brad Colbert bcolb...@rscusa.com wrote:
 One more update:

 I modified the code slightly in both the Pre and Post draw callbacks to 
 compare frame numbers.  I would expect that they would have the same number, 
 but they do not at times.

 I also added a bit of code to the PostDraw to compare the last frame number 
 to the current.  The results are not what I would expect.

 Again, this is DrawThreadPerContext.

 Output snipet:

 Pre 0x7fffe5f49f90 : 1501
 Pos 0x7fffe66f6ea0 : 1501

 Pre 0x7fffe5f49f90 : 1502
 Pos 0x7fffe66f6ea0 : 1503 ** Not Next ** previous frame was 1501

 Pre 0x7fffe5f49f90 : 1503
 Pos 0x7fffe66f6ea0 : 1503 ** Not Next ** previous frame was 1503

 Pre 0x7fffe5f49f90 : 1504
 Pos 0x7fffe66f6ea0 : 1504

 Pre 0x7fffe5f49f90 : 1505
 Pos 0x7fffe66f6ea0 : 1506 ** Not Next ** previous frame was 1504

 -B


 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
 Sent: Thursday, February 03, 2011 10:11 AM
 To: 'OpenSceneGraph Users'
 Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
 FrameStamp::getFrameNumber()?

 Simplifying my example, my PostDrawCallback now simply prints the pointer 
 value of *this (to determine that it's the same PostDrawCallback instance) 
 and the frame number and I get the following (snipet):

 0x2a9a400:896
 0x2a9a400:896
 0x2a9a400:898
 0x2a9a400:899
 0x2a9a400:899
 0x2a9a400:901
 0x2a9a400:902
 0x2a9a400:902
 0x2a9a400:904

 Clearly it's the same callback, there is only one camera, and the frame 
 number is repeating and skipping.

 -B


 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert 
 Osfield
 Sent: Thursday, February 03, 2011 9:14 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Why does Draw skip frame number as reported from 
 FrameStamp::getFrameNumber()?

 Hi Brad,

 I couldn't make sense of your original email and same with this one,
 I'm confused by the role of your map and would suspect that your
 method

[osg-users] FrameStamp::getFrameNumber() ?

2011-02-02 Thread Brad Colbert
I'm trying to understand how the threading works in OSG when 
DrawThreadPerContext with respect to which process is on which frame at which 
time.  It appears to me that the draw frame is skipping values in the frame 
count, as reported from FrameStamp::getFrameNumber().

My test code fills a mapint,bool (the int is the frame time, and bool is just 
there ;) ) in a cull traversal by using the following code:

//
const osg::FrameStamp* frameStamp = cv-getFrameStamp();

frameMap[frameStamp-getFrameNumber()] = true;


//
And in a PostDrawCallback on a camera I'm printing out the current frame # : 
the frames #'s in the map, and then I clear the current frame number entry:

// Get the current frame number
osg::FrameStamp* frameStamp = renderInfo.getState()-getFrameStamp();

int frameNumber = frameStamp-getFrameNumber();

std::cout  frameNumber   : ;

std::mapint, bool::const_iterator framei = frameMap.begin();

for (; framei != frameMap.end(); framei++ )
std::cout  framei-first  , ;

std::cout  \n\n;

frameMap.erase( frameNumber );


The following is the output on the console.  Again, the first number is the 
current frame number in the PostDrawCallback of the camera.  The following 
numbers, on the same line, are the frame numbers placed in the map during the 
cull traversal.


746 : 

747 : 

749 : 748, 749, 

750 : 748, 750, 

751 : 748, 751, 

752 : 748, 752, 

753 : 748, 753, 

754 : 748, 

755 : 748, 755, 

756 : 748, 

757 : 748, 756, 757, 

758 : 748, 756, 758, 

759 : 748, 756, 759, 

759 : 748, 756, 

761 : 748, 756, 760, 761,


My question is, is the draw skipping frame numbers?

---
Brad Colbert
Renaissance Sciences Corporation

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Camara: PreDrawCallback and PostDrawCallBack

2011-01-21 Thread Brad Colbert
Hello folks,

We have a custom sensor model that we have used for some time with OSG.  It 
provides an FBO for rendering the scene to, processes the captured scene, and 
then will render the FBO when completed.  I would like to change the way we use 
it in OSG to make it work closer to the osg::Camera class.

My first thought was to derive a Camera class and override the applicable 
functions.  At first glance, this appears a bit more involved than I really 
hoped.

While looking at the Class I see (and now remember) Pre and Post draw calls.  
My big questions are:

1.  Is the graphics context bound when these calls are made? (if not, why not) 
2.  If so, am I allowed to bind my FBO in the pre-draw, and draw in my post 
draw?

Thanks!

---
Brad Colbert
Renaissance Sciences Corporation


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Camara: PreDrawCallback and PostDrawCallBack

2011-01-21 Thread Brad Colbert
I think I answered my own question by just doing it.

BTW, it appears that the graphics context is bound and I'm able to capture what 
the camera see's, process it, and render the processed image.

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
Sent: Friday, January 21, 2011 3:51 PM
To: 'osg-us...@openscenegraph.org'
Subject: [osg-users] Camara: PreDrawCallback and PostDrawCallBack

Hello folks,

We have a custom sensor model that we have used for some time with OSG.  It 
provides an FBO for rendering the scene to, processes the captured scene, and 
then will render the FBO when completed.  I would like to change the way we use 
it in OSG to make it work closer to the osg::Camera class.

My first thought was to derive a Camera class and override the applicable 
functions.  At first glance, this appears a bit more involved than I really 
hoped.

While looking at the Class I see (and now remember) Pre and Post draw calls.  
My big questions are:

1.  Is the graphics context bound when these calls are made? (if not, why not) 
2.  If so, am I allowed to bind my FBO in the pre-draw, and draw in my post 
draw?

Thanks!

---
Brad Colbert
Renaissance Sciences Corporation


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Why is Vec not a template?

2010-10-22 Thread Brad Colbert
Gent's,

I was wondering the same.

A templated Vec class isn't all that hard to implement and maintain, it's 
pretty straight forward.  What's a pain is a templated Matrix class, although 
totally doable (from experience).  I would gladly help if someone wanted to 
start taking on the task.

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Mathias Goldau
Sent: Friday, October 22, 2010 6:46 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Why is Vec not a template?

Am 22.10.2010 14:37, Robert Osfield wrote:
 Hi Mathias,
 
 On Fri, Oct 22, 2010 at 1:01 PM, Mathias Goldau
 m...@informatik.uni-leipzig.de wrote:
 I just wondered why Vec3 and related Vec classes are all different classes 
 and
 why they aren't realized as templates?
 
 Because templates aren't always the perfect tool for the job.

 Three main reasons : specialization of types required in various
 methods makes templates more awkward to write and maintain, secondly
 templates are slow to compile - the more low level templates you use
 the greater the slow down,  and finally templates are pain in the butt
 to decifer when you get compile errors.

ok, I could imagine that at least the value_type for all Vec3 derivates would
be a good choice for a template, since the operations for Vec3f and Vec3d,
etc. are exactly the same (I guess).
I really could imagine that a template size_t, typename value_type  is
indeed really awkward and hard to maintain. But so you will have much more
code duplication.
In point of compile time: Hmm the Vec[2-4] classes are not very big, there are
many other templates in OSG which have much higher complexity.

Mathias

-- 
Institut für Informatik
Universität Leipzig
Johannisgasse 26, 04103 Leipzig
Phone: +493419732283
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Why is Vec not a template?

2010-10-22 Thread Brad Colbert
I'm not suggesting it happen, just that if anyone is interested I can give them 
moral support ;)

For the sake of argument, however, the advantage of template vector and matrix 
classes is that where any operations can be evaluated during compile time, will 
be (assuming that the operations are coded using template metaprogramming 
techniques).  This would result in less work for the CPU during run-time.

One thing I would like to see is, where possible, taking advantage of SSE(2/3) 
instructions on CPU's that have them.  I imagine that there could be some speed 
up, especially if operations could be batched (I'm sure a whole other 
can-o-worms).

Anyway, for what it's worth.

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Friday, October 22, 2010 11:36 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Why is Vec not a template?

Hi Brad,

On Fri, Oct 22, 2010 at 6:17 PM, Brad Colbert bcolb...@rscusa.com wrote:
 A templated Vec class isn't all that hard to implement and maintain, it's 
 pretty straight forward.

There are awkward, and making it templated is totally pointless.  What
is there to gain?

 What's a pain is a templated Matrix class, although totally doable (from 
 experience).  I would gladly help if someone wanted to start taking on the 
 task.

I'm not about to merge code that offers no advancement in features,
performance or maintainability.  There are plenty of things the
community can help out with, stuff that doesn't advance the OSG is a
step backwards.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OSGDEM output flattening

2010-10-22 Thread Brad Colbert
I'm passing along a question from our database team:


We would like to flatten certain areas of the terrain polygons for a given 
DTED/DEM input file. Is there an option for VPB where we can specify a 
shapefile of the flattened area?

Any help/info would be greatly appreciated.

-B

---
Brad Colbert
Renaissance Sciences Corporation

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OpenFlight: Reading the Extension Record

2010-09-23 Thread Brad Colbert
Paul,

Thanks so much.  That helps point me in the right direction.  Hopefully
adding the code will be straight forward.

-B
 
 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-
 boun...@lists.openscenegraph.org] On Behalf Of Paul Martz
 Sent: Wednesday, September 22, 2010 1:02 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] OpenFlight: Reading the Extension Record
 
 Hi Brad -- The original author of the importer isn't around these
days,
 though
 he does make an occasional rare appearance. I wrote the exporter half
 of the plugin.
 
 Looks like PrimaryRecords.cpp has a class, Extension, for processing
an
 Extension record, but it doesn't appear to parse/save any of the data.
 Looks
 like it just creates a Group node and assigns it the name from the
 extension
 record, then returns. You would probably want to add some code here to
 handle
 the extension record contents the way that you require.
 
 The code you quoted below pertains to handling the PushExtension and
 PopExtension control records, which is only tangentially related to
 Extension
 records themselves.
 -Paul
 
 
 
 Brad Colbert wrote:
  Paul,
 
  Thanks for the quick reply.
 
  I've looked through the source and find a lot of references to
  Extension but doubt that is what it's for.
 
  I was hoping to catch the eye of the author here.
 
  -B
 
  P.S.
 
  One example, I think may or may not be close:
 
  Document.cpp:void Document::pushExtension()
  Document.cpp:OSG_WARN  No current primary in
  Document::pushExtension().  std::endl;
  Document.cpp:void Document::popExtension()
  Document.cpp:OSG_WARN  Can't decide primary in
  Document::popExtension().  std::endl;
  Document.h:// Extension stack
  Document.h:void pushExtension();
  Document.h:void popExtension();
 
 
  -Original Message-
  From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-
  boun...@lists.openscenegraph.org] On Behalf Of Paul Martz
  Sent: Wednesday, September 22, 2010 10:35 AM
  To: OpenSceneGraph Users
  Subject: Re: [osg-users] OpenFlight: Reading the Extension Record
 
  Check the source code. If I recall correctly, the loader reads in
  comment
  records and stores them as UserData in the scene graph, but I'm not
  sure about
  extension records. The only way to know for certain is to check the
  source.
  -Paul
 
 
  Brad Colbert wrote:
  Hello all,
 
  We would like to store some extra meta-data along with (embedded)
 in
  our
  OpenFlight models.  Looking at the OpenFlight spec, there appears
 to
  be
  this thing called an Extension Record that can contain many
  things,
  even XML which is what we are interested in.
 
  To cut-to-the-chase, does the OpenFlight loader in OSG read in any
  way
  these Extension Records or, worse, preclude the reading of the
  record?
  I know this is a pretty open question but I'm just starting to dig
  into
  this.
 
  Any information will be more than I have now, thanks!
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-
 openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OpenFlight: Reading the Extension Record

2010-09-22 Thread Brad Colbert
Hello all,

We would like to store some extra meta-data along with (embedded) in our
OpenFlight models.  Looking at the OpenFlight spec, there appears to be
this thing called an Extension Record that can contain many things,
even XML which is what we are interested in.

To cut-to-the-chase, does the OpenFlight loader in OSG read in any way
these Extension Records or, worse, preclude the reading of the record?

I know this is a pretty open question but I'm just starting to dig into
this.

Any information will be more than I have now, thanks!

-B

---
Brad Colbert
Renaissance Sciences Corporation
W: 480 374-5073 x:5073
F: 425 675-8044

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OpenFlight: Reading the Extension Record

2010-09-22 Thread Brad Colbert
Paul,

Thanks for the quick reply.

I've looked through the source and find a lot of references to
Extension but doubt that is what it's for.

I was hoping to catch the eye of the author here.

-B

P.S.

One example, I think may or may not be close:

Document.cpp:void Document::pushExtension()
Document.cpp:OSG_WARN  No current primary in
Document::pushExtension().  std::endl;
Document.cpp:void Document::popExtension()
Document.cpp:OSG_WARN  Can't decide primary in
Document::popExtension().  std::endl;
Document.h:// Extension stack
Document.h:void pushExtension();
Document.h:void popExtension();


 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-
 boun...@lists.openscenegraph.org] On Behalf Of Paul Martz
 Sent: Wednesday, September 22, 2010 10:35 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] OpenFlight: Reading the Extension Record
 
 Check the source code. If I recall correctly, the loader reads in
 comment
 records and stores them as UserData in the scene graph, but I'm not
 sure about
 extension records. The only way to know for certain is to check the
 source.
 -Paul
 
 
 Brad Colbert wrote:
  Hello all,
 
  We would like to store some extra meta-data along with (embedded) in
 our
  OpenFlight models.  Looking at the OpenFlight spec, there appears to
 be
  this thing called an Extension Record that can contain many
things,
  even XML which is what we are interested in.
 
  To cut-to-the-chase, does the OpenFlight loader in OSG read in any
 way
  these Extension Records or, worse, preclude the reading of the
 record?
 
  I know this is a pretty open question but I'm just starting to dig
 into
  this.
 
  Any information will be more than I have now, thanks!
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-
 openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Best place to update application items

2010-03-25 Thread Brad Colbert
Hi Folks,

Where is the best place to update application level things before the
frame is drawn? (ie. network reads/writes, model updates, text
setting... )


-B

---
Brad Colbert
Renaissance Sciences Corporation
W: 480 374-5073 x:5073
F: 425 675-8044


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OSG 2.9.6 GeometryTechnique and transparency

2010-03-02 Thread Brad Colbert
Robert,

I just upgraded everything to 2.9.6.  In the process I built one of our
sensor capable databases which relies on data that is in the alpha
channel of the terrain imagery.  To my surprise, the terrain was no
translucent.  I found that in GeometryTechnique that a stateset is set
for each PagedLOD that enables blending if the image is RGBA.

I guess my question is if this is absolutely necessary?  This is a bit
of a big hammer solution, I think. 
Can't the user just enable blending on the osg::Node* that represents
the entire database?

-B

---
Brad Colbert
Renaissance Sciences Corporation
W: 480 374-5073 x:5073
F: 425 675-8044


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] NodeVisitor for PagedLOD was RE: OSG 2.9.6 GeometryTechnique and transparency

2010-03-02 Thread Brad Colbert
Hi folks,

Does anyone have an example of how one would implement the equivalent of
a NodeVisitor for a PagedLOD object such that it visits all of the paged
in LODs?

-B
 

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-
 boun...@lists.openscenegraph.org] On Behalf Of Brad Colbert
 Sent: Tuesday, March 02, 2010 1:04 PM
 To: osg-us...@openscenegraph.org
 Subject: [osg-users] OSG 2.9.6 GeometryTechnique and transparency
 
 Robert,
 
 I just upgraded everything to 2.9.6.  In the process I built one of
our
 sensor capable databases which relies on data that is in the alpha
 channel of the terrain imagery.  To my surprise, the terrain was no
 translucent.  I found that in GeometryTechnique that a stateset is set
 for each PagedLOD that enables blending if the image is RGBA.
 
 I guess my question is if this is absolutely necessary?  This is a bit
 of a big hammer solution, I think.
 Can't the user just enable blending on the osg::Node* that represents
 the entire database?
 
 -B
 
 ---
 Brad Colbert
 Renaissance Sciences Corporation
 W: 480 374-5073 x:5073
 F: 425 675-8044
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-
 openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] setUpdateOperations?

2008-12-03 Thread Brad Colbert
What are the UpdateOperations used for in the osgViewer::Viewer class?


-B

---
Brad Colbert
Renaissance Sciences Corporation
W: 480 374-5073 x:5073
F: 425 675-8044

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] DatabasePager and memory

2008-12-01 Thread Brad Colbert
Hi Robert,

 
 If a paging thread has hung then you could try and cancel the threads
 and restart the pager.  I've never tried this myself so can't give
 particular guidance on it.
 

I'll delve a bit deeper and see what I can get to work.

 Personally if threads have died you have already pushed this too far
 and you should be fixing things in your database and app usage so this
 doesn't occur in the first place rather than trying to patch a system
 that is grinding to a halt because you've pushed things too far.
 

I completely agree.  We were under a time crunch for a demonstration and
where unable to rebuild the database (3 days).  The thought was that we
could get it to limp along in the really dense areas.

Any ideas on what the performance is on 64bit systems?  I would think we
should be able to get around this issue (excluding the GPU memory) on
such a system.

-B

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] DatabasePager and memory

2008-11-26 Thread Brad Colbert
Hi Robert,

Thanks for the detailed reply.

I remember running into this once before.  I believe I was able to tell
if the pager had died, but was unable to do anything else (maybe out of
lack of knowledge).  Is there a way to flush the memory that the dead
thread left hanging and restart the paging thread?  This would at least
keep us up in the short term until we are able to attack the other
issues.

Thanks,
Brad
 

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:osg-users-
 [EMAIL PROTECTED] On Behalf Of Robert Osfield
 Sent: Wednesday, November 26, 2008 1:24 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] DatabasePager and memory
 
 Hi Brad,
 
 Load balancing is as much a database creation issue as it is a runtime
 issue so you may need to look at your database itself.  Compressed
 textures are one area that you can help keep memory requirements
 smaller.  Use of osgTerrain::TerrainTile based database can also help
 as you can dynamically change the Terrain::SampleRatio to keep down
 the memory/rendering load for lower end systems.
 
 At runtime use of viewer's Camera::setLODScale() can be very
 effective, it's something you can alter per frame so when the scene is
 looking out over the horizon where lots of tiles are required you can
 change the scale to keep the load better balanced.
 
 On the DatabasePager front, the svn trunk version has a new scheme for
 trimming the number of inactive PagedLOD back to achieve a target
 maximum number of PagedLOD.  You can use the OSG_MAX_PAGEDLOD env var
 to set this value.   Right now this mode isn't the default setting,
 but my plan is to use this scheme by default and deprecate the expiry
 delay/frame delay based scheme as these aren't so good at keep to a
 max limit in memory.
 
 Finally your hardware/OS/OpenGL drivers can have a huge effect on how
 well it copes with larger scenes.  In testing of large paged database
 Ive found linux to scale much better than vista, even when vista has
 much more the memory it grinds to a halt/crashes while the linux
 system just chungs along without dropping a frame.
 
 Robert.
 
 On Tue, Nov 25, 2008 at 10:19 PM, Brad Colbert [EMAIL PROTECTED]
 wrote:
  Hi Folks,
 
  We have an .ive PagedLOD database that is high resolution in both
  textures and poly's.  Understandably in certain situations we are
able
  to clobber both the memory on the machine and GPU memory when the
pager
  tries to page in more data then is possible to hold.  The result is
that
  the database pager thread dies and does not deallocate the memory it
was
  holding onto.
 
  We have played with a couple settings such as:
 
  * Hoping this forces immediate deletion.
 databasePager-setExpiryDelay( 0.0 );
 
  * Not sure if this helps.
 databasePager-setDoPreCompile( true );
 
  And we have played with the LOD scale but we still have some issues.
 
  Is it possible to detect the death of the paging thread, and if so,
can
  we flush the nodes it was holding onto and restart it?
 
  Any other ideas would be greatly appreciated.
 
  -Brad
 
  ---
  Brad Colbert
  Renaissance Sciences Corporation
  W: 480 374-5073 x:5073
  F: 425 675-8044
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-
 openscenegraph.org
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] DatabasePager and memory

2008-11-25 Thread Brad Colbert
Hi Folks,

We have an .ive PagedLOD database that is high resolution in both
textures and poly's.  Understandably in certain situations we are able
to clobber both the memory on the machine and GPU memory when the pager
tries to page in more data then is possible to hold.  The result is that
the database pager thread dies and does not deallocate the memory it was
holding onto.

We have played with a couple settings such as:

* Hoping this forces immediate deletion.
databasePager-setExpiryDelay( 0.0 );

* Not sure if this helps.
databasePager-setDoPreCompile( true );

And we have played with the LOD scale but we still have some issues.

Is it possible to detect the death of the paging thread, and if so, can
we flush the nodes it was holding onto and restart it?

Any other ideas would be greatly appreciated.

-Brad

---
Brad Colbert
Renaissance Sciences Corporation
W: 480 374-5073 x:5073
F: 425 675-8044

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Interest in DirectShow plugin for OpenSceneGraph?

2008-11-25 Thread Brad Colbert
Definitely!  Open source right?

I believe you can take advantage of direct to texture loads similar to
what the QuickTime library offers on OSX (sadly not for Windows).

-B
 

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:osg-users-
 [EMAIL PROTECTED] On Behalf Of Jason Beverage
 Sent: Saturday, November 22, 2008 3:07 PM
 To: osg users
 Subject: [osg-users] Interest in DirectShow plugin for OpenSceneGraph?
 
 Hi all,
 
 We're currently developing a DirectShow plugin for OpenSceneGraph and
I
 wanted to see if there was anyone else in the community that would be
 interested in this capability.
 
 Thanks!
 
 Jason
 
 -
 Jason Beverage
 Pelican Mapping
 http://www.pelicanmapping.com/

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Get pixels from a scene in a matrix in order to modifypixels color

2008-02-22 Thread Brad Colbert
Hello,

Try these steps:

1. Render the scene to an FBO
2. Render the captured buffer with an RGB to YUV shader.

-B
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jon
Sent: Wednesday, February 20, 2008 3:25 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Get pixels from a scene in a matrix in order to
modifypixels color

Hello all,

 

I would like to get pixels in a matrix of a zone in order to get colors
(yuv) and modify them.

Any way to do this quickly? 

I would like to use GPU and not CPU.

Using FBO...?

 

Thanks in advance.

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osg::Switch and update callbacks for children

2008-02-15 Thread Brad Colbert
Hi,

I may be misunderstanding what a switch node does but I have two
children of an osg::Switch, one has an update callback.  I've called
setAllChildrenOff() on the osg::Switch, but the update callback is still
being called on the child.  I thought it was supposed to not traverse
the children?  Is this not correct?

-B

---
Brad Colbert
Renaissance Sciences Corporation
W: 480 374-1202 x:202
M: 480 290-3997
F: 425 675-8044

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] PagedLOD: Notification or callback when an LOD is changed.

2008-02-01 Thread Brad Colbert
Hi folks,

I guess this question is applicable for an LOD database as well.  Here
is the background of my question, and please forgive me if this has
already been asked and answered.

I have a terrain database for which I load buildings and lights
separately.  I clamp the buildings and lights to the database to keep
things looking nice, but can't do it all the time, so when an LOD
changes, the models may be buried or floating.

Is there a way to create a callback mechanism for my models so that they
get notified whenever a terrain LOD changes?  In this callback I will
clamp the models that are over this LOD.

I guess it could work the other way as well, where I attach the models
to a given LOD and then the callback is on the LOD and it clamps the
attached models.

So, looking at it that way, is it as simple as traversing the entire
dbase on startup, looking for all of the LODs, attaching pertinent
models to each, and then providing an update callback that clamps them?
The callback will only be called when the LOD is being rendered, and I
could make sure it happens only once.

I would like to use existing mechanisms.  My database is an osgdem
PagedLOD, so is it possible to traverse the entire thing, even though
the it may not be paged in?  Could it be that the LOD structure
available when the database is first loaded?

This post is more of a stream of questions, I apologize.

Thank you.

-B

---
Brad Colbert
Renaissance Sciences Corporation

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgEphemeris

2007-08-28 Thread Brad Colbert
I think I found it on andesengineering.com.  I hope it's the correct
version.

-B
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brad
Colbert
Sent: Tuesday, August 28, 2007 8:31 AM
To: [EMAIL PROTECTED]
Subject: [osg-users] osgEphemeris

Hi Folks,

I guess this goes out to Don Burns.  How do I get the most recent
version of osgEphemeris.  CVS is reporting that it can't connect to the
address on your site.  I also have a few things to contribute.

Thanks,

-B

---
Brad Colbert
Renaissance Sciences Corporation
W: 480 290-3997
F: 425 675-8044


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org