Re: [osg-users] How can I get last frame time inn order to create indepent FPS aniamtions?

2009-11-23 Thread Rafa Gaitan
Hi Ricardo,

On Mon, Nov 23, 2009 at 3:58 PM, Ricardo Ruiz  wrote:
> Thanks Rafa, but it does not work.

Try something like this:

Code:

        double angle=0;
        while (!viewer.done()) {
                angle=viewer.getFrameStamp()->getReferenceTime();

viewer.getCamera()->setViewMatrixAsLookAt(osg::Vec3(0,-400,150),
osg::Vec3(0,0,0), osg::Vec3(0,0,1));

viewer.getCamera()->setViewMatrix(osg::Matrix::rotate(angle,0,0,1)*viewer.getCamera()->getViewMatrix());
                viewer.frame();
        }
        return 0;

You can also use osg::Matrixd to configure the final View Matrix, it
has convenient methods to also configure view matrix.

>
> By the way Rafa, I'm also studing at UPV, a master in software engineering.
>

Nice!, If you need something you can find me in the CPI building. :)

Rafa.


-- 
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [forum] help me with osg::Imagestream and osg::Image

2009-11-23 Thread Ivan Salguero
Hi,
I tried compile osgmovie and I have problems with that classes because i have 3 
errors say me getFrameRate isn't member of osg::Imagestream and
getPixelAspecRatio isn't member of osg::Image. so what happened somebody 
have any idea because i download that classes of osg page and replace the 
oldest  i use osg 2.8.0 and visualStudio 2008 please some help
... 


Thank you!

Cheers,
Ivan

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





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


Re: [osg-users] [forum] how add SDL in osg project

2009-11-23 Thread Ivan Salguero
Hi,

thanks for help but really i need add SDL to my osg project How i do that??
some body help me
... 


Thank you!

Cheers,
Ivan

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





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


Re: [osg-users] [osgOcean] Wake effects?

2009-11-23 Thread Tian Ma
Hi Kim,

I update the source code from SVN today and generate the new ocean project. 
When run the example, some errors emerge. The error image is as follow link:

http://storage.openlab.net.cn/forums/2009-11-24/1981569/%e9%94%99%e8%af%af.JPG

Something wrong with the "water.frag"?

Thank you!

Cheers,
Tian



Kim Bale wrote:
> Hello Erik,
> 
> Sorry I missed your post yesterday. There isn't really any support for
> wakes on the sea surface at the moment, although it's definitely
> something that needs addressing.
> 
> However, I just had a submission which uses the depth buffer to add
> breaking foam to the shoreline. This does sort for work for other
> objects on sea, like ships, but it doesn't look very pretty at the
> moment. You're more than welcome to have a play with the effect and
> see if you can do anything with it. From what I understand what you'd
> need to do is add a sort of sloped geometry which tracks you your
> boat, that would get picked up in the depth buffer and the same foam
> texture used on the wave crests is applied to it.
> 
> It's been checked into the trunk, but like I say it needs a little work.
> 
> There was a discussion about it here:
> 
> http://thread.gmane.org/gmane.comp.graphics.openscenegraph.cvs/6252
> 
> Cheers.
> 
> Kim.
> 
> 
> 
> 2009/11/18 Erik Johnson <>:
> 
> > Hi,
> > 
> > I thought this would have come up before, but does anyone have suggestions 
> > how to render a boat's wake?  Using osgParticle provides an "ok" solution, 
> > but falls apart rapidly if the ocean waves are too large (the particles go 
> > underwater).
> > 
> > Would be cool to leverage the same texturing effects as the "wave crest 
> > foam" stuff - just not sure how.  :)
> > 
> > Thanks for any suggestions,
> > Erik
> > 
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=19849#19849
> > 
> > 
> > 
> > 
> > ___
> > osg-users mailing list
> > 
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > 
> > 
> > 
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


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





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


Re: [osg-users] broken osgconv.exe

2009-11-23 Thread Mourad Boufarguine
Hi Ted,

You can use the Dependency Walker (http://www.dependencywalker.com/) to
check the version number of the runtime, the dependencies were compiled
against.

I just tried it with the zlib and png dlls contained in "VisualStudio 9
(2008) SP1" prebuild dependencies (
http://www.openscenegraph.org/projects/osg/wiki/Downloads/Dependencies), and
I found that the release versions were compiled with the 9.0.30729 runtime,
which is actually "2008 SP1". The debug version, though, was compiled with
the 9.0.21022 runtime , which is the "2008" runtime. The zlib is used in
both ive and gz plugins. I don't see  how you get the message about the 2005
runtime dependency. Double check in the "output" window of VS that the zlib
and png dlls that are actually loaded are the good ones.

Regards,
Mourad

On Tue, Nov 24, 2009 at 1:21 AM, ted morris  wrote:

> credist_x86 VisualStudio 2005 (v8) runtimes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] broken osgconv.exe

2009-11-23 Thread ted morris
Hi Mattias,

OK, after checking PATH,
and  setting OSG_NOTIFY_LEVEL=DEBUG,  it finds all the libraries in the
pluggin
and 3rdparty path  but I still get

"This application has failed to start because MSVCR80.dll was not found.
Re-installing the application may
fix this problem"

for the following pluggins for the RELEASE:

gz
curl
ive
png
tiff

and the following pluggins for the DEBUG:

tiffd

ps: the vcredist_x86 VisualStudio 2005 (v8) runtimes were already installed.
I tried uninstalling them,
re-installing them still no luck.

ps2: I have VisualStudio 2008 (v9) IDE C++ installed.

thanks,
Ted


On Mon, Nov 23, 2009 at 10:17 AM, Mattias Helsing wrote:

> Hi Ted,
>
> I finally got some time to check this out, but can't find any module
> that depends on the vc80 runtime. Everything runs fine and loads pngs
> and fonts without complaints on my xp.
> The machine I have tested on (unfortunatly) have the vc80 runtime on
> it but I'll test this on a clean xp later today or tomorrow. Meanwhile
> could you double check that your system picks up the dll's from the
> 3rdParty_binaries_vc90 zip *first*, i.e. if you have libpng13.dll
> and/or friends already in your PATH they may mess things up for you.
> Also - could you crank up OSG_NOTIFY_LEVEL and see if anything gets
> reported there?
>
> cheers
> Mattias
>
> > On Wed, Nov 18, 2009 at 8:45 AM, Jean-Sébastien Guay
> >  wrote:
> >>
> >> Hi Ted,
> >>
> >>> "This application has failed to start because MSVCR80.dll was not
> found.
> >>> Re-installing the application may
> >>> fix this problem"
> >>
> >> Hmmm, that would seem to indicate that the VC9 binaries depend on the
> VC8
> >> runtime (probably in addition to the VC9 one). That's pretty weird.
> >>
> >> Could whoever compiled those binaries (I don't remember) check that?
> >>
> >> J-S
> >> --
> >> __
> >> Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
> >>   http://www.cm-labs.com/
> >>http://whitestar02.webhop.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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [build] How to properly use the OSG_GL3_AVAILABLE CMake option?

2009-11-23 Thread John Price
Hi,

My nVidia graphics driver supports GL 3.2. So I enabled OSG_GL3_AVAILABLE and 
got hundreds of errors about gl3.h. I downloaded gl3.h from OpenGL.org and 
placed it where it would be found, and got hundreds of new errors.

I know I am doing something wrong and was wondering if someone would be kind 
enough to provide a quick tutorial. I don't need complete newbie instructions, 
just the necessary steps to compile OSG with gl3.

Thank you!

Cheers,
John

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





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


Re: [osg-users] Export osgAnimation callbacks into osg files

2009-11-23 Thread Peter Wrobrl
Hi, and thanks for your fast answer.

To reconstruct my problem I take the osgAnimationNode Example and tweak its 
"main", so that it writes an osg file instead of creating the viewer ( 
Attachment ).
When I open the osg file with an text editor, the UpdeteCallbacks are empty, 
and the file crashes the osganimationviewer with the error message: no 
osgAnimation::AnimationManagerBase found in the subgraph, no animations 
available 

Files that I export from Blender do have osgAnimation::BasicAnimationManager 
and keyframe data in the UpdateCallback Block.

I think the problem is, that in my case AnimtkUpdateCallback should be derived 
from osgAnimation::BasicAnimationManager insted of osg::NodeCallback, but I 
don't get it to work.

Could you tweak this file so that it works ? That would be a great help, thx.


Cheers, searching for Pivot of my Soul, PP !!! ( <- ParticlePeter )

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



/*  -*-c++-*- 
 *  Copyright (C) 2008 Cedric Pinson 
 *
 * This library is open source and may be redistributed and/or modified under  
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
 * (at your option) any later version.  The full license is in LICENSE file
 * included with this distribution, and on the openscenegraph.org website.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 * OpenSceneGraph Public License for more details.
*/

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

class AnimtkUpdateCallback : public osg::NodeCallback
{
public:
META_Object(osgAnimation, AnimtkUpdateCallback);

AnimtkUpdateCallback() 
{
_sampler = new osgAnimation::Vec3CubicBezierSampler;
_playing = false;
_lastUpdate = 0;
}
AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& 
copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::NodeCallback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),
_currentTime(val._currentTime),
_playing(val._playing),
_lastUpdate(val._lastUpdate)
{
}

/** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{ 
if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR && 
nv->getFrameStamp() && 
nv->getFrameStamp()->getFrameNumber() != _lastUpdate) {

_lastUpdate = nv->getFrameStamp()->getFrameNumber();
_currentTime = osg::Timer::instance()->tick();

if (_playing && _sampler.get() && _sampler->getKeyframeContainer()) 
{
osg::MatrixTransform* transform = 
dynamic_cast(node);
if (transform) {
osg::Vec3 result;
float t = osg::Timer::instance()->delta_s(_startTime, 
_currentTime);
float duration = _sampler->getEndTime() - 
_sampler->getStartTime();
t = fmod(t, duration);
t += _sampler->getStartTime();
_sampler->getValueAt(t, result);
transform->setMatrix(osg::Matrix::translate(result));
}
}
}
// note, callback is responsible for scenegraph traversal so
// they must call traverse(node,nv) to ensure that the
// scene graph subtree (and associated callbacks) are traversed.
traverse(node,nv);
}

void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = 
_startTime; _playing = true;}
void stop() { _currentTime = _startTime; _playing = false;}

osg::ref_ptr _sampler;
osg::Timer_t _startTime;
osg::Timer_t _currentTime;
bool _playing;
int _lastUpdate;
};


class AnimtkStateSetUpdateCallback : public osg::StateSet::Callback
{
public:
META_Object(osgAnimation, AnimtkStateSetUpdateCallback);

AnimtkStateSetUpdateCallback() 
{
_sampler = new osgAnimation::Vec4LinearSampler;
_playing = false;
_lastUpdate = 0;
}

AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const 
osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::StateSet::Callback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),
_currentTime(val._currentTime),
_playing(val._playing),
_lastUpdate(val._lastUpdate)
{
}

/** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(osg::StateSet* state, osg::NodeVisitor* nv)
{ 
if (state && 
nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR && 
 

Re: [osg-users] heightfield change height crashes

2009-11-23 Thread Thomas Maier
Hi,

i use SingleThreaded, i got no multithreading enum property only these

   SingleThreaded,
   CullDrawThreadPerContext,
ThreadPerContext = CullDrawThreadPerContext,
DrawThreadPerContext,
CullThreadPerCameraDrawThreadPerContext,
ThreadPerCamera = CullThreadPerCameraDrawThreadPerContext,
AutomaticSelection

i got osg 2.4.0, not the newest, but for this test-app it should work. What 
enum property should i use, AutomaticSelection ?

i dont get it to paint the following setHeight() calls, even if i use 
automaticSelection?

Thank you!

Cheers,
Thomas

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





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


Re: [osg-users] newbie question about osgTerrain yet again

2009-11-23 Thread Anton Lauridsen
Hi,


> 
> It's usually best to break this up into smaller tiles. OSGDEM/VPB uses 64x64 
> tiles, and
> LODs each group of four of those into a smaller 64x64 tile, etc, etc. 
> 


Thanks for the quick reply, 2 million polys shouldn't be able to pull the 
framerate that far down, especially since the stats show that the gpu is hardly 
busy at all, almost all time is spent in the CPU, is there a way for me to 
prevent the CPU from processing the terrain?

But I'm ok with slizing things up into 64x64 hunks.


> 
> I am not familiar with this class. 
> 

osgTerrain has a ContourLayer class, which takes a 1 dimensional 
transferfunction (osg::TransferFunction1D), the osgTerrain has a section of 
code where that ContourLayer is assigned to the ColorLayer of the terraintile. 
I assumed that the intention was to use color bands for depicting the altitude 
(contour) of the terrain, but maybe I'm mistaken

Thank you!

Cheers,
Anton
.

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





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



Re: [osg-users] heightfield change height crashes

2009-11-23 Thread Thomas Maier
Hi,

i only have set ->setDataVariance(osg::Object::DYNAMIC); to the geode, now i 
also have set it to the shapeDrawable. Should i apply it only to the 
shapeDrawable or to both?

After this change it draws the first point of my setHeight() changes, any 
following setHeight() call doesnt paint anything?  If i use 
->dirtyDisplayList(); on the shapeDrawable directly after calling setHeight() 
crashes the application.

what should i do, that it paints also the following setHeight() calls?

Thank you!

Cheers,
Thomas

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





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


Re: [osg-users] newbie question about osgTerrain yet again

2009-11-23 Thread Chris 'Xenon' Hanson
Anton Lauridsen wrote:
> I have - by using the osgTerrain example code - constructed a heightmap based 
> terraintile.
> I'm having two issues, the terrain is ridiculously slow, showing about 15 fps 
> for a 1024x1024 map. showing a huge amount of time in the draw phase, what 
> have I done wrong?

  Is this a single tile? 1024x1024x2 is two million polys.

  It's usually best to break this up into smaller tiles. OSGDEM/VPB uses 64x64 
tiles, and
LODs each group of four of those into a smaller 64x64 tile, etc, etc.

> The other, which surprises me a bit, is how the osgTerrain::ContourLayer is 
> applied, I would have expected the ContourLayer to apply to the Z axis rather 
> than the X axis as can be seen on the attached image, what have I done wrong 
> there?

  I am not familiar with this class.


  Is this actually terrain data? If so, why are you building it by hand as 
opposed to
letting VPB do it and manage the LOD for you?

> Thank you!
> Cheers,
> Anton

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"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] newbie question about osgTerrain yet again

2009-11-23 Thread Anton Lauridsen
Hi,

By searching the forums I have found quite a few questions regarding the use of 
osgTerrain, but somehow I have never found a satisfactory solution.

I have - by using the osgTerrain example code - constructed a heightmap based 
terraintile.

I'm having two issues, the terrain is ridiculously slow, showing about 15 fps 
for a 1024x1024 map. showing a huge amount of time in the draw phase, what have 
I done wrong?

The other, which surprises me a bit, is how the osgTerrain::ContourLayer is 
applied, I would have expected the ContourLayer to apply to the Z axis rather 
than the X axis as can be seen on the attached image, what have I done wrong 
there?

Thank you!

Cheers,
Anton

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





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


Re: [osg-users] Height fields implementation

2009-11-23 Thread Chris 'Xenon' Hanson
Janna Terde wrote:
> When I use  osg::Terrain::TerrainTile/HeightFieldLayer regardless of X/Y 
> intervals I set while creation of the HeightField I always get the same 
> result (as if I set X/Y to 1). When I used only HeightFields+ShapeDrawable it 
> worked fine. I am wondering if something like this happened to anyone or 
> maybe I have some bug. 

  This may have something to do with the way TerrainTile normally uses a 
Locator object to
position it and scale it into the real 3D world. This is something done for you 
by
VirtualPlanetBuilder/osgDEM. I've never done it by hand.

> I also noticed that when I use osg::Terrain::TerrainTile/HeightFieldLayer  
> the loading time increases significantly (for 2000 by 2000  I get 70 
> seconds). 

  This could also be a result of some misconfiguration. Try building the tile 
database
with VPB/osgDEM. I know this route works.

> What I am trying to make now is functionality for selecting a vertex (or 
> several vertices around it) and modifying its height. Before I was using 
> HeightField::setHeight and then calling dirtyDisplayList for the 
> ShapeDrawable.
> Can anyone suggest what is the right way to do the same using 
> osg::Terrain::TerrainTile/HeightFieldLayer? I am trying to access a 
> HeightField and then setHeight() but I am not sure if this is the correct way 
> and if I need to update my scene somehow. 

  I think you can modify the HeightField and then just dirty() it.

> Cheers,
> Janna

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"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


Re: [osg-users] Frame Count/Threading Models

2009-11-23 Thread paul1492
Any help would be appreciated. 

How do I get a valid graphics context in a Pre Draw Callback so I can call 
glXQueryFrameCountNV()? 

See below for details.

Thanks,
Paul P.


- Original Message 
From: "paul1...@yahoo.com" 
To: osg-users@lists.openscenegraph.org
Sent: Wed, November 4, 2009 9:20:40 AM
Subject: [osg-users] Frame Count/Threading Models

I was using glXWaitVideoSyncSGI() in a Pre Draw Callback (the place I need it 
to be) to get the current Frame Count from the video card. I've recently found 
out that this Frame Count number from this function can be incorrect when I'm 
reading textures from the GPU to the CPU or writing textures from the CPU to 
the GPU. In particular, I would see about 100ms between calls to 
glXWaitVideoSyncSGI but the frame counter returned would either be consecutive 
(i.e. no missed frames) or skipping one number (i.e. one missed frame). I'm 
running at 60 Hz (16ms frames).

Therefore, I'm now trying to use glXQueryFrameCountNV() (I have G-SYNC II card 
and have enabled Frame Lock). It would appear I need to call this when I have a 
valid Graphics Context. I assume this isn't normally the case in a 
PreDrawCallback.  I've had to do this in the PreDrawCallback:
    if (camera.getGraphicsContext() &&
    camera.getGraphicsContext()->valid() &&
    camera.getGraphicsContext()->isRealized())
    {
    osg::GraphicsContext* gc = 
const_cast(camera.getGraphicsContext());
    gc->makeCurrent();
    }
followed by my call to glXQueryFrameCountNV().

However, to make this work, I've had to set my osgViewer's threading model to 
SingleThreaded. If I don't do this I usually see a "Xlib: unexpected async 
reply (sequence 0x6a)!" message followed by a segmentation fault.

What am I doing wrong? Is there some better way to do something in a valid 
graphics context when not in a draw callback?

Paul P.


      
___
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] Height fields implementation

2009-11-23 Thread Janna Terde
Hi!
Chris, thank you for your advice! I will definitely take a look into VPB!

I got some results but couple of things did not work as I expected, yet.
Sorry in advanced for so many questions. 

When I use  osg::Terrain::TerrainTile/HeightFieldLayer regardless of X/Y 
intervals I set while creation of the HeightField I always get the same result 
(as if I set X/Y to 1). When I used only HeightFields+ShapeDrawable it worked 
fine. I am wondering if something like this happened to anyone or maybe I have 
some bug. 

I also noticed that when I use osg::Terrain::TerrainTile/HeightFieldLayer  the 
loading time increases significantly (for 2000 by 2000  I get 70 seconds). 

What I am trying to make now is functionality for selecting a vertex (or 
several vertices around it) and modifying its height. Before I was using 
HeightField::setHeight and then calling dirtyDisplayList for the ShapeDrawable.
Can anyone suggest what is the right way to do the same using 
osg::Terrain::TerrainTile/HeightFieldLayer? I am trying to access a HeightField 
and then setHeight() but I am not sure if this is the correct way and if I need 
to update my scene somehow. 
 
I am going to keep working on the selection and I will appreciate any 
suggestions/comments! 
Thanks a lot for your help!

Cheers,
Janna

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





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


Re: [osg-users] heightfield change height crashes

2009-11-23 Thread Jean-Sébastien Guay

Hello Thomas,


i created a geode and a heightfield, then i created a shapeDrawable with the 
geode as argument. After that i addDrawable to the geode, and the geode to the 
group. Now i can see the heightfield, but when i now try to change a height it 
does not update the frame?
when i use dirtyDisplayList() after setting the heigth, it crashes all the 
time. what do i wrong?


Is your viewer multithreaded? If so, have you set the data variance on 
your ShapeDrawable to DYNAMIC? And are you calling dirtyDisplayList() 
from an update callback (or somewhere else in the update phase, not the 
cull nor draw)?


Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] heightfield change height crashes

2009-11-23 Thread Thomas Maier
Hi,

i created a geode and a heightfield, then i created a shapeDrawable with the 
geode as argument. After that i addDrawable to the geode, and the geode to the 
group. Now i can see the heightfield, but when i now try to change a height it 
does not update the frame?
when i use dirtyDisplayList() after setting the heigth, it crashes all the 
time. what do i wrong?

i read about the terrainTile and its layer, but now i want to simply try to 
change the heigth of this simple app, what must i change?

Thank you!

Cheers,
Thomas

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





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


Re: [osg-users] Height fields implementation

2009-11-23 Thread Chris 'Xenon' Hanson
Janna Terde wrote:
> Hi Chris,
> Sorry for mentioning HeightFields again.
> But thank you for taking your time replying! Currently I am 
> implementing functionality using osg::Terrain::TerrainTile/HeightFieldLayer. 

  Let us know how it performs for you. I think you will be satisfied with the 
result.

  Remember too, that for terrain-like surfaces, VirtualPlanetBuilder is the 
preferred way
to make osg::Terrain::TerrainTile/HeightFieldLayer databases. It will construct 
the LOD
quadtrees for you so that you always see the level of detail you require (right 
down to
facets smaller than a screen-pixel, if you adjust the LOD Scale to request 
that) at the
most optimal framerate. VPB terrains typically run at a rock solid 60fps in OSG.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"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


Re: [osg-users] Refactoring DatabasePagerNeedToRemovestringflagging technique

2009-11-23 Thread Wojciech Lewandowski
Thanks Glenn. I will look at this. Wojtek
  - Original Message - 
  From: Glenn Waldron 
  To: OpenSceneGraph Users 
  Sent: Monday, November 23, 2009 5:41 PM
  Subject: Re: [osg-users] Refactoring DatabasePagerNeedToRemovestringflagging 
technique


  On Mon, Nov 23, 2009 at 11:10 AM, Robert Osfield  
wrote:

Hi Wojtek,

On Mon, Nov 23, 2009 at 2:34 PM, Wojciech Lewandowski

 wrote:

> But I would strongly defend merits of arguments in the post. You say we 
did
> wrong, but whats you recommendation on mixing many intersections with
> rendering ?  Its very common scenario. How  should we tackle it, if 
current
> approach is wrong ?


The right approach is a difficult one.  Getting a paged scene graph to
work with intersections at highest resolutions and at the same time
manage things for rendering with requires just the appropriate LOD
child for the needs of visuals is awkward.   I know often vis-sim apps
don't even try to mix the two, and have a separate process entirely
for dealing intersections as for doing the visuals.  Some sims even
run the visuals and intersection testing on entirely different
machines.  Other sims use entirely separate databases for intersection
testing and visuals.  Then there are others that use a height field
for height above terrain testing...


  Wojtek,

  The "keep it separate" approach is what we use in osgEarth. The idea is to 
fetch terrain tiles directly, based on your target sampling resolution, instead 
of traversing the whole LOD hierarchy. Take a took at the ElevationManager 
utility. Perhaps it can provide some inspiration:

  http://wush.net/trac/osgearth/browser/trunk/src/osgEarthUtil/ElevationManager

  Glenn
   




--


  ___
  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] Refactoring DatabasePager NeedToRemovestringflagging technique

2009-11-23 Thread Wojciech Lewandowski

Hi Chris,


Robert Osfield wrote:

Second important issue for me is usage of _name in scene graph. I always
expected that _name is reserved for users and its a normal rule in all 
Scene
Graph implementations that libraries do not change it.  Names are 
ususlly
used to identify certain portions of models and hook up the code 
properly.
Thats something that provide standard linking mechanisms between artists 
and

programmers works.

I agree, but... in this instance the DatabasePager's algorithm was
about deleting a subgraph that would no longer have any role to play
in the applications life so the changing of name should never have got
outside that algorithm as the subgraph would be just deleted.  So it
is in theory just a black box, how it does it's job shouldn't effect
anything else.  Alas in this case it looks like the algorithm in
DatabasePager is flawed.


 This is the part that I couldn't tell from a simple reading of the code. 
Once a node is
renamed to "NeedToRemove", under normal circumstances (ignoring the cache 
trick above), is
there any possibility that that node can "return to life"? It sounds like 
you're saying
there is no possibility, in which case I sort of agree with Robert that 
altering the name
is fair game, as the node is now "the walking dead" and anything is 
permissible.


I disagree, when Scene is available in update traversal for various visitors 
you could expect that some user may want to do some specific decoration of 
the PageLOD node. Modify texture attributes, attach some objects etc. So 
once you allowed user to get to PagedLOD via update traversal vistiors you 
should expect that this PagedLOD ref_count increases. In such case 
DatabasePager should not longer assume it posses this node completely.


Other case could be following. We overrite ReadFileCallback and generate and 
reuse some procedural generic tile (for example spherical sector of ocean 
mesh). This is again a case where PageLOD is not directly loaded by 
DatabasePager but only used by it. So DatabasePager should behave politely 
with this node...


Cheers,
Wojtek 


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


Re: [osg-users] Refactoring DatabasePagerNeedToRemovestringflagging technique

2009-11-23 Thread Wojciech Lewandowski

Hi Robert,


How should we tackle it, if current
approach is wrong ?


[..]


If you do want to mix the two then you need to ask questions about how
you want to do intersections and how your thread them.  Do you do
intersections in the main loop?  In a separate thread?  Do you run the
intersections multi-threaded?  I.e. multiple intersections traversals
at one time?  Should the intersection traversal wait to load external
tiles to get the result, or should then just return the intersections
for what is already loaded into memory.
What approach you will want to use will depend upon all of this.


Our case is following: We mostly have to update camera position and some 
objects around camera. And ocassionaly we reposition a camera to new 
location in the world. We are doing our intersections in update traversal. I 
assume its allowed to use IntersectVisitor in update and load new tiles 
then. We load many objects in update traversal.


And believe it or not but our scheme was working. Cache kept nodes bit 
longer than DatabasePager wanted, but not used tiles were eventually freed. 
I know it did work, because we made quick dirty fix by renaming 
"NeedToRemove" nodes to empty string name when fetching PagedLODs back to 
activePageLOD list from cache (described in Pawel Ksiezopolski post I 
mentioned earlier). Unfortuantely this fix was not appropriate as elegant 
submission. Sharing  loaded PageLOD tiles through cache was actually working 
as some preload for DatabasePager. DatabasePager still could load whatever 
it wanted.



Second important issue for me is usage of _name in scene graph. I always
expected that _name is reserved for users and its a normal rule in all 
Scene

 Graph implementations that libraries do not change it. Names are ususlly
used to identify certain portions of models and hook up the code 
properly.
Thats something that provide standard linking mechanisms between artists 
and

programmers works.



I agree, but... in this instance the DatabasePager's algorithm was
about deleting a subgraph that would no longer have any role to play
in the applications life so the changing of name should never have got
outside that algorithm as the subgraph would be just deleted.  So it
is in theory just a black box, how it does it's job shouldn't effect
anything else. Alas in this case it looks like the algorithm in
DatabasePager is flawed.


Please also note that we use cache becuse we otherwise were loading 
PageLOD

files twice. Is it reasonable ?.



Using a cache to prevent a subgraph from being deleted defeats the
load balancing that the DatabasePager will be attempting to do, so
it's a dangerous thing to do - it's a recipe for relentless growth in
memory usage.


Well yes, but in our case PagedLOD usage timeframe should be extended to 
period when the tiles were used for intersections and cache maybe in bit 
hacky way provided this prolonged life time. And use of cache is not direct 
cause of leaks becaus osgDB cache is freed when node ref_count reaches zero 
so when DatabasePager & IntersectionVisitor stopped using the tile it was 
effectively removed from the cache as well.
Memory leaks were the result of extra NeedToRemove nodes that appeared in 
activePageLOD lists when some nodes were resurected from Cache because 
camera moved over them again. I know its sophistry, but in some way, it was 
more effective than native DatabasePager management because it loaded nodes 
in no time while DatabasePager would have to load them from disk in this 
case ;-).



Even if we skip intersections, other
situations are also possible. For example we may have few highly detailed
special PageLOD tiles with ariports which we want to preload and keep in
memory for whole application runtime. So we modify readFileCallback to 
work

for such cache and return these preloaded models each time thery are
requested.



Use of the cache in conjunction with a paged database should be used
very sparingly and for only very specific types of assets.  It does
also open the question of how DatabasePager should deal with such
datasets, without lots of reflection on the issue I can't say.  I can
say in the design and development of DatabasePager I have made the
assumption that it'd be the master of the PagedLOD's and manage all
reading and expiring, and not have code on the outside managing things
in a parallel.


Well I thought that if PagedLOD class is public and offers public interface 
and methods we could use it as long as we do not hit compiler errors. 
Perhaps different set of classes should be created for use in more VPB 
specific closed way.



It's worth noting that PagedLOD has settings that allow you to control
what happens with expiry - so you can individually switch off the
expiry.


I have not thought about it. I will have to learn what we can do using this 
mechanism, perhaps we could do something smarter.


Wojtek

___
osg-users mailing list
osg-users@lists.openscene

Re: [osg-users] Height fields implementation

2009-11-23 Thread Janna Terde
Hi Chris,

Sorry for mentioning HeightFields again.
But thank you for taking your time replying! Currently I am 
implementing functionality using osg::Terrain::TerrainTile/HeightFieldLayer. 

Thanks again!

Cheers,
Janna

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





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


Re: [osg-users] Refactoring DatabasePager NeedToRemovestringflagging technique

2009-11-23 Thread Chris 'Xenon' Hanson
Robert Osfield wrote:
>> Second important issue for me is usage of _name in scene graph. I always
>> expected that _name is reserved for users and its a normal rule in all Scene
>> Graph implementations that libraries do not change it.  Names are ususlly
>> used to identify certain portions of models and hook up the code properly.
>> Thats something that provide standard linking mechanisms between artists and
>> programmers works.
> I agree, but... in this instance the DatabasePager's algorithm was
> about deleting a subgraph that would no longer have any role to play
> in the applications life so the changing of name should never have got
> outside that algorithm as the subgraph would be just deleted.  So it
> is in theory just a black box, how it does it's job shouldn't effect
> anything else.  Alas in this case it looks like the algorithm in
> DatabasePager is flawed.

  This is the part that I couldn't tell from a simple reading of the code. Once 
a node is
renamed to "NeedToRemove", under normal circumstances (ignoring the cache trick 
above), is
there any possibility that that node can "return to life"? It sounds like 
you're saying
there is no possibility, in which case I sort of agree with Robert that 
altering the name
is fair game, as the node is now "the walking dead" and anything is permissible.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"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


Re: [osg-users] Running VPBMaster

2009-11-23 Thread Chris 'Xenon' Hanson
Jacob Armstrong wrote:
> Well, let me ask you this then...I launched vpbmaster.exe passing in a
> list of 490 bitmaps with --xt, --yt, --xx, --yy, and --t arguments.
> Earlier in this thread I showed the last line output to the screen. It
> has generated a .task file at Level 0, 16 at Level 3, and 256 at Level
> 7. It sat for 2 days without doing anything. All 4113 tasks were still
> pending after 2 days. How long do you think it would normally take for
> 4113 tasks to at least begin running? Also, isn't there something I can
> do with the build_master.source file? Can't I cancel the run and pass
> the .source file to osgdem or vpbmaster? How does it work? Forget about
> what it's doing now...what is it supposed to do?

  One thing I would try off the top of my head is to set the notify level up 
higher:

http://www.3drealtimesimulation.com/osg/osg_faq_1.htm#f20


  and see if any warnings are being overlooked. A common problem many people 
have is that
osgDEM.exe is not in their path or can't be run for some reason.

  Also, you might try launching OSGDEM by itself (as you originally did before 
upgrading
to the whole VPB kit) with the same input data, and make sure it doesn't report 
any
issues. OSGDEM can be easier to debug since it's just one local process and not 
a
distributed build.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"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


Re: [osg-users] Height fields implementation

2009-11-23 Thread Chris 'Xenon' Hanson
Janna Terde wrote:
> Hi Robert,
> Thank you very much for your reply!
> I am going to look into the osg::Terrain. 
> The other goal is to make an interactive editing of the height field so we 
> can change the layout of the terrain on fly. However when I used Height Field 
> class and alternated the values of the height with setHeight() functionality, 
> the performance was very slow. 
> Would the usage of the osg::Terrain::TerrainTile with HeightFieldLayer 
> improve this aspect? 

  It is generally understood that aspects of the design of Heightfield make its
performance poor compared to osg::Terrain::TerrainTile/HeightFieldLayer.

> I found out that currently (using plain HeightField ) the slowdown happens 
> when I search for the intersection using LineSegmentIntersector and
> when I reset a height of the grid cell using osg::HeightField::setHeight().

  Yes. My understanding is that the data storage of HeightField is sub-optimal 
for
transfer-speed to OpenGL, and it may not be especially fast for intersection 
either. Try
the osg::Terrain::TerrainTile/HeightFieldLayer combination as we've suggested 
several
times. It's not a good use of anyone's time to keep speculating on why 
HeightField isn't a
good choice. It just isn't.

> Cheers,
> Janna

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"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


Re: [osg-users] Refactoring DatabasePager NeedToRemovestringflagging technique

2009-11-23 Thread Glenn Waldron
On Mon, Nov 23, 2009 at 11:10 AM, Robert Osfield
wrote:

> Hi Wojtek,
>
> On Mon, Nov 23, 2009 at 2:34 PM, Wojciech Lewandowski
>  wrote:
> > But I would strongly defend merits of arguments in the post. You say we
> did
> > wrong, but whats you recommendation on mixing many intersections with
> > rendering ?  Its very common scenario. How  should we tackle it, if
> current
> > approach is wrong ?
>
> The right approach is a difficult one.  Getting a paged scene graph to
> work with intersections at highest resolutions and at the same time
> manage things for rendering with requires just the appropriate LOD
> child for the needs of visuals is awkward.   I know often vis-sim apps
> don't even try to mix the two, and have a separate process entirely
> for dealing intersections as for doing the visuals.  Some sims even
> run the visuals and intersection testing on entirely different
> machines.  Other sims use entirely separate databases for intersection
> testing and visuals.  Then there are others that use a height field
> for height above terrain testing...
>

Wojtek,

The "keep it separate" approach is what we use in osgEarth. The idea is to
fetch terrain tiles directly, based on your target sampling resolution,
instead of traversing the whole LOD hierarchy. Take a took at the
ElevationManager utility. Perhaps it can provide some inspiration:

http://wush.net/trac/osgearth/browser/trunk/src/osgEarthUtil/ElevationManager

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


Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Robert Osfield
Hi Stephan,

On Mon, Nov 23, 2009 at 4:15 PM, Stephan Kussmaul
 wrote:
> The problem we encountered was when the TriStripVisitor was used with double
> data (e.g. for OpenFlight with double precision). As far as I can remember
> in this case the wrong member function (remap(...))  in the base class was
> used. That's why we had to add those additional overloads. Otherwise we
> later encountered crashes with indices pointing to Nirvana.

Could you send me the whole modified file to osg-submissions so I can
do a full review.

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


Re: [osg-users] broken osgconv.exe

2009-11-23 Thread Mattias Helsing
Hi Ted,

I finally got some time to check this out, but can't find any module
that depends on the vc80 runtime. Everything runs fine and loads pngs
and fonts without complaints on my xp.
The machine I have tested on (unfortunatly) have the vc80 runtime on
it but I'll test this on a clean xp later today or tomorrow. Meanwhile
could you double check that your system picks up the dll's from the
3rdParty_binaries_vc90 zip *first*, i.e. if you have libpng13.dll
and/or friends already in your PATH they may mess things up for you.
Also - could you crank up OSG_NOTIFY_LEVEL and see if anything gets
reported there?

cheers
Mattias

> On Wed, Nov 18, 2009 at 8:45 AM, Jean-Sébastien Guay
>  wrote:
>>
>> Hi Ted,
>>
>>> "This application has failed to start because MSVCR80.dll was not found.
>>> Re-installing the application may
>>> fix this problem"
>>
>> Hmmm, that would seem to indicate that the VC9 binaries depend on the VC8
>> runtime (probably in addition to the VC9 one). That's pretty weird.
>>
>> Could whoever compiled those binaries (I don't remember) check that?
>>
>> J-S
>> --
>> __
>> Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
>>                               http://www.cm-labs.com/
>>                        http://whitestar02.webhop.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] TriStripVisitor issue

2009-11-23 Thread Stephan Kussmaul

Hi Robert,

We are using OSG 2.8.2.

The problem we encountered was when the TriStripVisitor was used with 
double data (e.g. for OpenFlight with double precision). As far as I can 
remember in this case the wrong member function (remap(...))  in the 
base class was used. That's why we had to add those additional 
overloads. Otherwise we later encountered crashes with indices pointing 
to Nirvana.


-Stephan



Robert Osfield schrieb:

HI Stephan,

On Mon, Nov 23, 2009 at 2:31 PM, Stephan Kussmaul
 wrote:
  

We found a bug those days in TriStripVisitor.cpp. I didn't really read your
latest email, but this might be related to your precision issues:



What bug was this?  Could you explain?  Which version of the OSG?

  

class WriteValue : public osg::ConstValueVisitor
{
  ...
  // add those 3 lines
  virtual void apply(const Vec2d& v) { _o << v; }
  virtual void apply(const Vec3d& v) { _o << v; }
  virtual void apply(const Vec4d& v) { _o << v; }
  ...
}

class RemapArray : public osg::ArrayVisitor
{
  ...
  // add those 3 lines
  virtual void apply(osg::Vec2dArray& array) { remap(array); }
  virtual void apply(osg::Vec3dArray& array) { remap(array); }
  virtual void apply(osg::Vec4dArray& array) { remap(array); }
  ...
}



And these lines do what?  To address what issue?

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


  


--
-
Stephan Kussmaul
Geschaeftsfuehrender Gesellschafter / Managing Director
TrianGraphics GmbH
Schoenhauser Allee 45
10435 Berlin
Germany
Tel: +49 (0)30 48495565   FAX: +49 (0)30 48495581
Email: stephan.kussm...@triangraphics.de
Web: www.triangraphics.de
-
Sitz der Gesellschaft / Corporate Headquarters:
TrianGraphics GmbH, Berlin
Registereintragung / Registration:
Amtsgericht Berlin-Charlottenburg HRB 93807 B
Geschaeftsfuehrer / Managing Directors:
Stephan Kussmaul, Mirco Nierenz, Volker Walkiewicz 



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


Re: [osg-users] Refactoring DatabasePager NeedToRemovestringflagging technique

2009-11-23 Thread Robert Osfield
Hi Wojtek,

On Mon, Nov 23, 2009 at 2:34 PM, Wojciech Lewandowski
 wrote:
> But I would strongly defend merits of arguments in the post. You say we did
> wrong, but whats you recommendation on mixing many intersections with
> rendering ?  Its very common scenario. How  should we tackle it, if current
> approach is wrong ?

The right approach is a difficult one.  Getting a paged scene graph to
work with intersections at highest resolutions and at the same time
manage things for rendering with requires just the appropriate LOD
child for the needs of visuals is awkward.   I know often vis-sim apps
don't even try to mix the two, and have a separate process entirely
for dealing intersections as for doing the visuals.  Some sims even
run the visuals and intersection testing on entirely different
machines.  Other sims use entirely separate databases for intersection
testing and visuals.  Then there are others that use a height field
for height above terrain testing...

If you do want to mix the two then you need to ask questions about how
you want to do intersections and how your thread them.  Do you do
intersections in the main loop?  In a separate thread?  Do you run the
intersections multi-threaded?  I.e. multiple intersections traversals
at one time?  Should the intersection traversal wait to load external
tiles to get the result, or should then just return the intersections
for what is already loaded into memory.

What approach you will want to use will depend upon all of this.


> Second important issue for me is usage of _name in scene graph. I always
> expected that _name is reserved for users and its a normal rule in all Scene
> Graph implementations that libraries do not change it.  Names are ususlly
> used to identify certain portions of models and hook up the code properly.
> Thats something that provide standard linking mechanisms between artists and
> programmers works.

I agree, but... in this instance the DatabasePager's algorithm was
about deleting a subgraph that would no longer have any role to play
in the applications life so the changing of name should never have got
outside that algorithm as the subgraph would be just deleted.  So it
is in theory just a black box, how it does it's job shouldn't effect
anything else.  Alas in this case it looks like the algorithm in
DatabasePager is flawed.

> Please also note that we use cache becuse we otherwise were loading PageLOD
> files twice. Is it reasonable ?.

Using a cache to prevent a subgraph from being deleted defeats the
load balancing that the DatabasePager will be attempting to do, so
it's a dangerous thing to do - it's a recipe for relentless growth in
memory usage.

> Even if we skip intersections,  other
> situations are also possible. For example we may have few highly detailed
> special PageLOD tiles with ariports which we want to preload and keep in
> memory for whole application runtime. So we modify readFileCallback to work
> for such cache and return these preloaded models each time thery are
> requested.

Use of the cache in conjunction with a paged database should be used
very sparingly and for only very specific types of assets.  It does
also open the question of how DatabasePager should deal with such
datasets, without lots of reflection on the issue I can't say.  I can
say in the design and development of DatabasePager I have made the
assumption that it'd be the master of the PagedLOD's and manage all
reading and expiring, and not have code on the outside managing things
in a parallel.

It's worth noting that PagedLOD has settings that allow you to control
what happens with expiry - so you can individually switch off the
expiry.

> Their names will be changed as well and "NeedToRemove" scheme
> stops working anyway.

I suspect the "NeedToRemove" scheme is only scratching the surface of
the issue of apps that try to mix paging and caching.

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


Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Robert Osfield
HI Stephan,

On Mon, Nov 23, 2009 at 2:31 PM, Stephan Kussmaul
 wrote:
> We found a bug those days in TriStripVisitor.cpp. I didn't really read your
> latest email, but this might be related to your precision issues:

What bug was this?  Could you explain?  Which version of the OSG?

>
> class WriteValue : public osg::ConstValueVisitor
> {
>   ...
>       // add those 3 lines
>       virtual void apply(const Vec2d& v) { _o << v; }
>       virtual void apply(const Vec3d& v) { _o << v; }
>       virtual void apply(const Vec4d& v) { _o << v; }
>   ...
> }
>
> class RemapArray : public osg::ArrayVisitor
> {
>   ...
>       // add those 3 lines
>       virtual void apply(osg::Vec2dArray& array) { remap(array); }
>       virtual void apply(osg::Vec3dArray& array) { remap(array); }
>       virtual void apply(osg::Vec4dArray& array) { remap(array); }
>   ...
> }

And these lines do what?  To address what issue?

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


Re: [osg-users] TrackballManipulator possible bug; definite issue

2009-11-23 Thread Allen Saucier
Hi,

Thx JP I'll look @ those threads for sure!
... 

Thank you!

Cheers,
Allen

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





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


Re: [osg-users] Running VPBMaster

2009-11-23 Thread Jacob Armstrong

Well, let me ask you this then...I launched vpbmaster.exe passing in a list of 
490 bitmaps with --xt, --yt, --xx, --yy, and --t arguments. Earlier in this 
thread I showed the last line output to the screen. It has generated a .task 
file at Level 0, 16 at Level 3, and 256 at Level 7. It sat for 2 days without 
doing anything. All 4113 tasks were still pending after 2 days. How long do you 
think it would normally take for 4113 tasks to at least begin running? Also, 
isn't there something I can do with the build_master.source file? Can't I 
cancel the run and pass the .source file to osgdem or vpbmaster? How does it 
work? Forget about what it's doing now...what is it supposed to do?

 

 


 
> Date: Mon, 23 Nov 2009 09:12:46 +
> From: robert.osfi...@gmail.com
> To: osg-users@lists.openscenegraph.org
> Subject: Re: [osg-users] Running VPBMaster
> 
> HI Jacob,
> 
> There really is much that others can do to help without be able to run
> the same test and see the same behaviour and then run vpbmaster in a
> debugger to see what is going on. vpbmaster should be dispatching the
> osgdem tasks and then sitting most idle while the osgdem tasks do the
> actual build, and then re-submit new tasks as they are finished.
> 
> Try running vpbmaster in a debugger and see what is happening when it's 
> hanging.
> 
> Robert.
> 
> On Mon, Nov 23, 2009 at 1:36 AM, Jacob Armstrong  wrote:
> > So I had VPBMaster running for over two days and it didn't seem to be doing
> > anything so I used Ctrl+C to cancel the task and the following was output to
> > the screen:
> >
> > "
> > Recieved signal 2, doing TERMINATE_RUNNING_TASKS_THEN_EXIT.
> > MachinePool::signal(2)
> > Machine::signal(2)
> > Machine::cancelThreads() hostname= , threads=2
> >  Cancel thread
> >  Cancel thread
> > Completed Machine::cancelThreads() hostname= , threads=2
> > End of TaskSet: tasksPending=4113 taskCompleted=0 taskRunning=0
> > tasksFailed=0
> > Continuing with existing TaskSet.
> > End of Run: tasksPending=4113 taskCompleted=0 taskRunning=0 tasksFailed=0
> > MachinePool::reportTimingStats()
> >  Machine :
> >   Task::type='' minTime=1.120172 maxTime=1.122734
> > averageTime=1.121453 totalComputeTime=2.242906 numTasks=2
> > Finished run, but did not complete 4113 tasks.
> > Total elapsed time = 191483.915636
> > "
> >
> > The total elapsed time equates to 2.2 days, which is about how long it was
> > running before I cancelled it. Can anyone tell me what it was doing for 2.2
> > days, if no tasks were completed in that time? I kicked it off again and
> > cancelled it and I had the same number of tasks created, with all of them
> > Pending, and nothing completing. Am I missing a piece of the puzzle here.
> > Can anyone please help me?
> >
> > Thanks,
> > Jake
> >
> >
> >
> > 
> > From: jaco...@hotmail.com
> > To: osg-users@lists.openscenegraph.org
> > Date: Sun, 22 Nov 2009 19:02:07 -0500
> > Subject: Re: [osg-users] Running VPBMaster
> >
> > Any suggestions here? Should I be doing something with the .source file?
> >
> >
> >
> > 
> > From: jaco...@hotmail.com
> > To: osg-users@lists.openscenegraph.org
> > Date: Fri, 20 Nov 2009 15:36:05 -0500
> > Subject: [osg-users] Running VPBMaster
> >
> > Alright, it looks like I've finally gotten VPBMaster-0.9.10 up and running
> > (with OSG-2.8.0) and I attempted to feed it the input I was previously
> > trying to feed to OSGDem with my older version of OSG. It spit a lot of text
> > to the screen, and now seems to have hung. The last thing on the screen is
> > "scheduling task :
> > tasks/build_subtile_L3_X3_Y3/build_subtile_L7_X63_Y63.task". I tried
> > pressing ENTER and it didn't do anything.
> >
> > I've noticed that I now have a couple new files: build_master.source (0 kb)
> > and build_master.tasks (284 kb). I've also got a new "tasks" directory,
> > which has 17 files ("build_root_L0_X0_Y0.task" and
> > "build_subtile_L3_X0_Y0.task"-"build_subtile_L3_X3_Y3.task") and 16
> > directories ("build_subtile_L3_X0_Y0"-"build_subtile_L3_X3_Y3", each
> > consisting of 256 files). Do I need to do something next, or is it
> > processing something behind the curtain, or did something go wrong since my
> > .source file is 0 kb? Any help is appreciated!
> >
> > Thanks,
> > Jake
> >
> > 
> > Windows 7: It works the way you want. Learn more.
> > 
> > Hotmail: Trusted email with powerful SPAM protection. Sign up now.
> > 
> > Windows 7: I wanted simpler, now it's simpler. I'm a rock star.
> > ___
> > 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/listi

Re: [osg-users] Height fields implementation

2009-11-23 Thread Janna Terde
Hi Robert,

Thank you very much for your reply!
I am going to look into the osg::Terrain. 

The other goal is to make an interactive editing of the height field so we can 
change the layout of the terrain on fly. However when I used Height Field class 
and alternated the values of the height with setHeight() functionality, the 
performance was very slow. 

Would the usage of the osg::Terrain::TerrainTile with HeightFieldLayer improve 
this aspect? 

I found out that currently (using plain HeightField ) the slowdown happens when 
I search for the intersection using LineSegmentIntersector and
when I reset a height of the grid cell using osg::HeightField::setHeight().

Thank you for any suggestions!

Cheers,
Janna

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





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


Re: [osg-users] How can I get last frame time inn order to create indepent FPS aniamtions?

2009-11-23 Thread Ricardo Ruiz
Thanks Rafa, but it does not work.



Code:

double angle=0;
float delta=1;
while (!viewer.done()) {
float start=viewer.getFrameStamp()->getReferenceTime();
angle=angle+0.05*delta;

viewer.getCamera()->setViewMatrixAsLookAt(osg::Vec3(0,-400,150), 
osg::Vec3(0,0,0), osg::Vec3(0,0,1));

viewer.getCamera()->setViewMatrix(osg::Matrix::rotate(angle*DEG_TO_RAD,0,0,1)*viewer.getCamera()->getViewMatrix());
 
viewer.frame();
float delta=viewer.getFrameStamp()->getReferenceTime()-start;   

}
return 0;




Animation is smooth, (I have a ATI 3870 and quadcore) but faster in release 
than debug (I mean animation, not FPS).
I has no sense. Maybe release version uses some threads that debug not.

Is this the correct way to implement independent animation time?


By the way Rafa, I'm also studing at UPV, a master in software engineering.

Thanks.

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





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


Re: [osg-users] Refactoring DatabasePager NeedToRemovestringflagging technique

2009-11-23 Thread Wojciech Lewandowski

Hi Robert,

My apologies for "SARCASM". I wanted to be provocative because former posts 
went unnoticed. Maybe I have gone too far...


But I would strongly defend merits of arguments in the post. You say we did 
wrong, but whats you recommendation on mixing many intersections with 
rendering ?  Its very common scenario. How  should we tackle it, if current 
approach is wrong ?


Second important issue for me is usage of _name in scene graph. I always 
expected that _name is reserved for users and its a normal rule in all Scene 
Graph implementations that libraries do not change it.  Names are ususlly 
used to identify certain portions of models and hook up the code properly. 
Thats something that provide standard linking mechanisms between artists and 
programmers works.


Please also note that we use cache becuse we otherwise were loading PageLOD 
files twice. Is it reasonable ?.  Even if we skip intersections,  other 
situations are also possible. For example we may have few highly detailed 
special PageLOD tiles with ariports which we want to preload and keep in 
memory for whole application runtime. So we modify readFileCallback to work 
for such cache and return these preloaded models each time thery are 
requested. Their names will be changed as well and "NeedToRemove" scheme 
stops working anyway.


With all due Respect ;-)
Wojtek Lewandowski

- Original Message - 
From: "Robert Osfield" 

To: "OpenSceneGraph Users" 
Sent: Monday, November 23, 2009 2:59 PM
Subject: Re: [osg-users] Refactoring DatabasePager 
NeedToRemovestringflagging technique



Hi Wojtek,

On Mon, Nov 23, 2009 at 11:53 AM, Wojciech Lewandowski
 wrote:

3. I don't know if this was deliberate or not, but IntersectionVisitor
in USE_HGHEST_LEVEL_OF_DETAIL mode does load highest level tiles 
temporary.

It does intersections and free them. It does not hook them up to their
parents.


This is deliberate - if you start modifying the scene graph during the
Intersection traversal then you can't run it multi-threaded anymore.

There is also the issue of having to maintain a PageLOD with it's
children loaded from lowest res to highest res - you can't skip
intermediate children and just attach the highest rest one, keeping
the loaded subgraph local.

It's also worth mentioning that IntersectionVsitor itself does do any
loaded of data, it's callback that you attach to it that do it so
usual usage of IntersectionVisitor doesn't load highest level of
detail - it doesn't load anything.  Hence the
DatabaseCacheReadCallback...


4. Above has this horrible effect that if some node was not already loaded
by DatabasePager it will be constantly loaded and removed by
IntersectionVisitor. SARCASM#1: But don't loose faith there is a solution.
See next point.


Well if you want the IntersectionVisitor to happen asynchronously from
the DatabasePager loaded then you have to have keep the two separate,
or manage the integration very careful by using a
IntersectionReadCallback that is design to integrate the two.

Please note DatabaseCacheReadCallback is not designed to integrate
DatabasePager and IntersectionVisitor, it's a specific solution for
IntersectionVisition and is wholly parallel and independent to
DatabasePager and is meant to be this way.  IntersectionVisitor is
synchronous - you have to get the subgraph immediately, so the reading
of external tiles has to be done in the same thread.


5. We found out that we can use osgSim::DatabaseCacheReadCallback to
mitigate former problem. This is an IntersectVisitor read callback that
keeps internal cache to avoid repetitive loading and freeing. Well...this
works but only for IntesectVisitor. DatabasePager does not know anything
about this cache so when DatabasePager finally decides to load a tile it
does it again, although IntersectionVisitor have already loaded it.
SARCASM#2: But don't loose hope yet, because we found a solution to this 
as

well
6. How to make sure DatabasePager sees the tile IntersectVisitor already
loaded ? Its simple: We could use osgDB cache. So we started to load tiles
with CACHE_NODES option and everything seemed to be fine
7 But after some time we started to observe crashes and memory leaks. Long
story about them is in my friend Pawel Ksiezopolski post "Re: [osg-users]
PagedLOD experts?" from November 5th. Short story is that caching tiles
does not free renamed "NeedToRemove" nodes, but keep them in memory so 
with

time some if them land int the scene again. When this happens, logic that
was invented to remove not used nodes removes wrong ones leaving those 
that
should be removed. Hence we get PageLOD thrashing and memory leaks. Cool 
HUH

? (Yes its SARCASM#3)


Well if you do start mixing stuff that wasn't intended to be mixed in
the way you are mixing it well perhaps we shouldn't be too surprised
that problems eventually do ensue.

Also the SCARCASM stuff really isn't helpful and just lowers to tone
of communication.  Please stop it, it has no place on osg-use

Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Stephan Kussmaul

Hi Manu,

We found a bug those days in TriStripVisitor.cpp. I didn't really read 
your latest email, but this might be related to your precision issues:


class WriteValue : public osg::ConstValueVisitor
{
   ...
   // add those 3 lines
   virtual void apply(const Vec2d& v) { _o << v; }
   virtual void apply(const Vec3d& v) { _o << v; }
   virtual void apply(const Vec4d& v) { _o << v; }
   ...
}

class RemapArray : public osg::ArrayVisitor
{
   ...
   // add those 3 lines
   virtual void apply(osg::Vec2dArray& array) { remap(array); }
   virtual void apply(osg::Vec3dArray& array) { remap(array); }
   virtual void apply(osg::Vec4dArray& array) { remap(array); }
   ...
}

Hope this helps.

Regards,

Stephan

Emmanuel Roche schrieb:

Hi Robert,

Actually, I've noticed that the problem doesn't come from the 
underlying tristripper library:


instead, it seems that the indice array generated from my vertices is 
incorrect: I suspect that the comparison function to find if too 
vertices are the same or not is too precise in my case. Do you have a 
clear idea where this is done ? (otherwise, I will just read more code 
and find it...)


cheers,

Manu.



2009/11/23 Emmanuel Roche >


Actually, I also noticed that OSG v2.8.1 uses version 1.0 of the
tristripper library.

As I'm quite in an hurry, I think I will re-implement my own
tristripvisitor with the latest version of tristripper and check
if this makes a difference. Will let you know what's the result of
this test.

But I believe this could really be a generic issue (it happens
with all the models I tested) and thus would mean many people are
currently using "not so well tri-stripped" geometries if they use
this optimiser feature !  (it is the case for instance in the
OSGExp export plugin for 3DS max as I've noticed this issue there
for the first time).

regards,
Manu.



2009/11/23 Robert Osfield mailto:robert.osfi...@gmail.com>>

Hi Manu,

If the tristripper doesn't connect the triangles together well
then it
can result on few tristrips and lots of unconnected traingles
that it
has to put into a single list of triangles to avoid lots of
separate
primitive calls.

As to why your model is not being stripped well I can't say.
 We've
used 3rd party code to do the tri-stripping so I'm not best
placed to
answer the low level questions, but... the original author of
the cdoe
Tanguy Fautre is now an OSG user and I believe still on the
list so
perhaps he'll be able to chip in ;-)

Robert.

On Mon, Nov 23, 2009 at 11:08 AM, Emmanuel Roche
mailto:roche.emman...@gmail.com>>
wrote:
> Hi everyone,
>
> I have a strange problem with the TryStripVisitor:
>
> When I use it on a model (with about 6000 triangles,
described as TRIANGLES
> [thus using 18000 vertices]) I get trip strip primitive sets
indeed BUT
> actually I get a few TRIANGLE_STRIP primitive sets with 4
vertices in each,
> and then a single big TRIANGLES primitive set with about
17950 vertices 
>
> So, most of the model is just not stripped at all ! any idea
what I could be
> doing wrong ???
>
> Moreother, I've noticed that the geometry is then
transformed as an indexed
> geometry... correct me if I'm wrong but indexed geometries
are slower that
> simple vertices ordered arrays. If there a way to switch
this or am I on my
> own on this ?
>
> Regards,
> Manu.
>
>
>
> ___
> 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
  


--
-
Stephan Kussmaul
Geschaeftsfuehrender Gesellschafter / Managing Director
TrianGraphics GmbH
Schoenhauser Allee 45
10435 Berlin
Germany
Tel: +49 (0)30 48495565   FAX: +49 (0)30 48495581
Email: stephan.kussm...@triangraphics.de
Web: www.triangraphics.de
--

Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Robert Osfield
Hi Manu,

The TriStripVisitor shouldn't change anything in the data apart form
re-organize it.  Adding in tolerances to the vertex comparisons would
require the vertex data to modified to collapse adjacent vertices's
onto the same position in space.

Would could add such functionality as an extra pass to
TriStripVisitor, but the default would have to be not to do this.
Personally I'd suggest having a separate visitor do this operation of
collapsing nearby vertices on to one another, and then pre-process the
data before tri-stripping it.

Robert.



On Mon, Nov 23, 2009 at 2:25 PM, Emmanuel Roche
 wrote:
> Okay,
>
> more details on this:
>
> the problem comes from the helper structure "VertexAttribComparitor"
>
> in the function VertexAttribComparitor::compare(unsigned int lhs, unsigned
> int rhs) we call the template array compare(unsigned int lhs, unsigned int
> rhs) function, and there we just use regular comparisons:
>
>     virtual int compare(unsigned int lhs,unsigned int rhs) const
>     {
>     const T& elem_lhs = (*this)[lhs];
>     const T& elem_rhs = (*this)[rhs];
>     if (elem_lhs     if (elem_rhs     return 0;
>     }
>
> here we don't take any "precision" into account at all... whereas my
> vertices are given in meter units and may have a little resolution of about
> 0.1 millimeter !
>
> So this implementation won't fit for my needs (and I think there is an high
> chance it may not fit the needs for many other people no ?) maybe we should
> add a "precision" parameter at some point, but for now I just don't have the
> time to deal with this properly :-)
>
> Cheers,
> Manu.
>
>
> 2009/11/23 Emmanuel Roche 
>>
>> Hi Robert,
>>
>> Actually, I've noticed that the problem doesn't come from the underlying
>> tristripper library:
>>
>> instead, it seems that the indice array generated from my vertices is
>> incorrect: I suspect that the comparison function to find if too vertices
>> are the same or not is too precise in my case. Do you have a clear idea
>> where this is done ? (otherwise, I will just read more code and find it...)
>>
>> cheers,
>>
>> Manu.
>>
>>
>>
>> 2009/11/23 Emmanuel Roche 
>>>
>>> Actually, I also noticed that OSG v2.8.1 uses version 1.0 of the
>>> tristripper library.
>>>
>>> As I'm quite in an hurry, I think I will re-implement my own
>>> tristripvisitor with the latest version of tristripper and check if this
>>> makes a difference. Will let you know what's the result of this test.
>>>
>>> But I believe this could really be a generic issue (it happens with all
>>> the models I tested) and thus would mean many people are currently using
>>> "not so well tri-stripped" geometries if they use this optimiser feature !
>>> (it is the case for instance in the OSGExp export plugin for 3DS max as I've
>>> noticed this issue there for the first time).
>>>
>>> regards,
>>> Manu.
>>>
>>>
>>>
>>> 2009/11/23 Robert Osfield 

 Hi Manu,

 If the tristripper doesn't connect the triangles together well then it
 can result on few tristrips and lots of unconnected traingles that it
 has to put into a single list of triangles to avoid lots of separate
 primitive calls.

 As to why your model is not being stripped well I can't say.  We've
 used 3rd party code to do the tri-stripping so I'm not best placed to
 answer the low level questions, but... the original author of the cdoe
 Tanguy Fautre is now an OSG user and I believe still on the list so
 perhaps he'll be able to chip in ;-)

 Robert.

 On Mon, Nov 23, 2009 at 11:08 AM, Emmanuel Roche
  wrote:
 > Hi everyone,
 >
 > I have a strange problem with the TryStripVisitor:
 >
 > When I use it on a model (with about 6000 triangles, described as
 > TRIANGLES
 > [thus using 18000 vertices]) I get trip strip primitive sets
 > indeed BUT
 > actually I get a few TRIANGLE_STRIP primitive sets with 4 vertices in
 > each,
 > and then a single big TRIANGLES primitive set with about 17950
 > vertices 
 >
 > So, most of the model is just not stripped at all ! any idea what I
 > could be
 > doing wrong ???
 >
 > Moreother, I've noticed that the geometry is then transformed as an
 > indexed
 > geometry... correct me if I'm wrong but indexed geometries are slower
 > that
 > simple vertices ordered arrays. If there a way to switch this or am I
 > on my
 > own on this ?
 >
 > Regards,
 > Manu.
 >
 >
 >
 > ___
 > 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-opens

Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Emmanuel Roche
Okay,

more details on this:

the problem comes from the helper structure "VertexAttribComparitor"

in the function VertexAttribComparitor::compare(unsigned int lhs, unsigned
int rhs) we call the template array compare(unsigned int lhs, unsigned int
rhs) function, and there we just use regular comparisons:

virtual int compare(unsigned int lhs,unsigned int rhs) const
{
const T& elem_lhs = (*this)[lhs];
const T& elem_rhs = (*this)[rhs];
if (elem_lhs

> Hi Robert,
>
> Actually, I've noticed that the problem doesn't come from the underlying
> tristripper library:
>
> instead, it seems that the indice array generated from my vertices is
> incorrect: I suspect that the comparison function to find if too vertices
> are the same or not is too precise in my case. Do you have a clear idea
> where this is done ? (otherwise, I will just read more code and find it...)
>
> cheers,
>
> Manu.
>
>
>
> 2009/11/23 Emmanuel Roche 
>
> Actually, I also noticed that OSG v2.8.1 uses version 1.0 of the
>> tristripper library.
>>
>> As I'm quite in an hurry, I think I will re-implement my own
>> tristripvisitor with the latest version of tristripper and check if this
>> makes a difference. Will let you know what's the result of this test.
>>
>> But I believe this could really be a generic issue (it happens with all
>> the models I tested) and thus would mean many people are currently using
>> "not so well tri-stripped" geometries if they use this optimiser feature !
>> (it is the case for instance in the OSGExp export plugin for 3DS max as I've
>> noticed this issue there for the first time).
>>
>> regards,
>> Manu.
>>
>>
>>
>> 2009/11/23 Robert Osfield 
>>
>> Hi Manu,
>>>
>>> If the tristripper doesn't connect the triangles together well then it
>>> can result on few tristrips and lots of unconnected traingles that it
>>> has to put into a single list of triangles to avoid lots of separate
>>> primitive calls.
>>>
>>> As to why your model is not being stripped well I can't say.  We've
>>> used 3rd party code to do the tri-stripping so I'm not best placed to
>>> answer the low level questions, but... the original author of the cdoe
>>> Tanguy Fautre is now an OSG user and I believe still on the list so
>>> perhaps he'll be able to chip in ;-)
>>>
>>> Robert.
>>>
>>> On Mon, Nov 23, 2009 at 11:08 AM, Emmanuel Roche
>>>  wrote:
>>> > Hi everyone,
>>> >
>>> > I have a strange problem with the TryStripVisitor:
>>> >
>>> > When I use it on a model (with about 6000 triangles, described as
>>> TRIANGLES
>>> > [thus using 18000 vertices]) I get trip strip primitive sets indeed
>>> BUT
>>> > actually I get a few TRIANGLE_STRIP primitive sets with 4 vertices in
>>> each,
>>> > and then a single big TRIANGLES primitive set with about 17950 vertices
>>> 
>>> >
>>> > So, most of the model is just not stripped at all ! any idea what I
>>> could be
>>> > doing wrong ???
>>> >
>>> > Moreother, I've noticed that the geometry is then transformed as an
>>> indexed
>>> > geometry... correct me if I'm wrong but indexed geometries are slower
>>> that
>>> > simple vertices ordered arrays. If there a way to switch this or am I
>>> on my
>>> > own on this ?
>>> >
>>> > Regards,
>>> > Manu.
>>> >
>>> >
>>> >
>>> > ___
>>> > 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] TriStripVisitor issue

2009-11-23 Thread Emmanuel Roche
Hi Robert,

Actually, I've noticed that the problem doesn't come from the underlying
tristripper library:

instead, it seems that the indice array generated from my vertices is
incorrect: I suspect that the comparison function to find if too vertices
are the same or not is too precise in my case. Do you have a clear idea
where this is done ? (otherwise, I will just read more code and find it...)

cheers,

Manu.



2009/11/23 Emmanuel Roche 

> Actually, I also noticed that OSG v2.8.1 uses version 1.0 of the
> tristripper library.
>
> As I'm quite in an hurry, I think I will re-implement my own
> tristripvisitor with the latest version of tristripper and check if this
> makes a difference. Will let you know what's the result of this test.
>
> But I believe this could really be a generic issue (it happens with all the
> models I tested) and thus would mean many people are currently using "not so
> well tri-stripped" geometries if they use this optimiser feature !  (it is
> the case for instance in the OSGExp export plugin for 3DS max as I've
> noticed this issue there for the first time).
>
> regards,
> Manu.
>
>
>
> 2009/11/23 Robert Osfield 
>
> Hi Manu,
>>
>> If the tristripper doesn't connect the triangles together well then it
>> can result on few tristrips and lots of unconnected traingles that it
>> has to put into a single list of triangles to avoid lots of separate
>> primitive calls.
>>
>> As to why your model is not being stripped well I can't say.  We've
>> used 3rd party code to do the tri-stripping so I'm not best placed to
>> answer the low level questions, but... the original author of the cdoe
>> Tanguy Fautre is now an OSG user and I believe still on the list so
>> perhaps he'll be able to chip in ;-)
>>
>> Robert.
>>
>> On Mon, Nov 23, 2009 at 11:08 AM, Emmanuel Roche
>>  wrote:
>> > Hi everyone,
>> >
>> > I have a strange problem with the TryStripVisitor:
>> >
>> > When I use it on a model (with about 6000 triangles, described as
>> TRIANGLES
>> > [thus using 18000 vertices]) I get trip strip primitive sets indeed
>> BUT
>> > actually I get a few TRIANGLE_STRIP primitive sets with 4 vertices in
>> each,
>> > and then a single big TRIANGLES primitive set with about 17950 vertices
>> 
>> >
>> > So, most of the model is just not stripped at all ! any idea what I
>> could be
>> > doing wrong ???
>> >
>> > Moreother, I've noticed that the geometry is then transformed as an
>> indexed
>> > geometry... correct me if I'm wrong but indexed geometries are slower
>> that
>> > simple vertices ordered arrays. If there a way to switch this or am I on
>> my
>> > own on this ?
>> >
>> > Regards,
>> > Manu.
>> >
>> >
>> >
>> > ___
>> > 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] Refactoring DatabasePager NeedToRemove stringflagging technique

2009-11-23 Thread Robert Osfield
Hi Wojtek,

On Mon, Nov 23, 2009 at 11:53 AM, Wojciech Lewandowski
 wrote:
> 3. I don't know if this was deliberate or not, but IntersectionVisitor
> in USE_HGHEST_LEVEL_OF_DETAIL mode does load highest level tiles temporary.
> It does intersections and free them. It does not hook them up to their
> parents.

This is deliberate - if you start modifying the scene graph during the
Intersection traversal then you can't run it multi-threaded anymore.

There is also the issue of having to maintain a PageLOD with it's
children loaded from lowest res to highest res - you can't skip
intermediate children and just attach the highest rest one, keeping
the loaded subgraph local.

It's also worth mentioning that IntersectionVsitor itself does do any
loaded of data, it's callback that you attach to it that do it so
usual usage of IntersectionVisitor doesn't load highest level of
detail - it doesn't load anything.  Hence the
DatabaseCacheReadCallback...

> 4. Above has this horrible effect that if some node was not already loaded
> by DatabasePager it will be constantly loaded and removed by
> IntersectionVisitor. SARCASM#1: But don't loose faith there is a solution.
> See next point.

Well if you want the IntersectionVisitor to happen asynchronously from
the DatabasePager loaded then you have to have keep the two separate,
or manage the integration very careful by using a
IntersectionReadCallback that is design to integrate the two.

Please note DatabaseCacheReadCallback is not designed to integrate
DatabasePager and IntersectionVisitor, it's a specific solution for
IntersectionVisition and is wholly parallel and independent to
DatabasePager and is meant to be this way.  IntersectionVisitor is
synchronous - you have to get the subgraph immediately, so the reading
of external tiles has to be done in the same thread.

> 5. We found out that we can use osgSim::DatabaseCacheReadCallback to
> mitigate former problem. This is an IntersectVisitor read callback that
> keeps internal cache to avoid  repetitive loading and freeing. Well...this
> works but only for IntesectVisitor. DatabasePager does not know anything
> about this cache so when DatabasePager finally decides to load a tile it
> does it again, although IntersectionVisitor have already loaded it.
> SARCASM#2: But don't loose hope yet, because we found a solution to this as
> well
> 6. How to make sure DatabasePager sees the tile IntersectVisitor already
> loaded ? Its simple: We could use osgDB cache. So we started to load tiles
> with CACHE_NODES option and everything seemed to be fine
> 7 But after some time we started to observe crashes and memory leaks. Long
> story about them is in my friend Pawel Ksiezopolski post "Re: [osg-users]
> PagedLOD experts?" from  November 5th. Short story is that caching tiles
> does not free renamed "NeedToRemove" nodes, but keep them in memory so with
> time some if them land int the scene again. When this happens, logic that
> was invented to remove not used nodes removes wrong ones leaving those that
> should be removed. Hence we get PageLOD thrashing and memory leaks. Cool HUH
> ? (Yes its SARCASM#3)

Well if you do start mixing stuff that wasn't intended to be mixed in
the way you are mixing it well perhaps we shouldn't be too surprised
that problems eventually do ensue.

Also the SCARCASM stuff really isn't helpful and just lowers to tone
of communication.  Please stop it, it has no place on osg-users.  If
you have a technical point to make it without the extra crap.

> Now to conclusion:
> In my opinion PageLOD renaming is the reason our elaborated scheme failed. I
> am both unhappy and glad that it happened because it clearly shows that
> Object::_name should not be modified by internal OSG methods. It should be
> never ever changed by OSG.  Management of node name belongs to creators or
> users of the node.

Um your elaborate scheme illustrates a weakness in the flexibility
of the performance trick in DatabasePager, not anything about using
Object::_name.  It also illustrates problems your elaborate scheme.

The performance trick in DatabasePager is a bug because it just is
robust in the presence of multiple-viewpoints and mixing of threading
of loading.

> Thats why I am going to prepare a fix that will not rename nodes to remove.
>  But will instead drop their addresses into a set (or sorted vector) and
> will later us this set to test if node is marked for removal. It may be not
> O(n) but O(n log n) but it will work at least.  Is anyone preparing
> similar fix ?

Ironically, I originally did implement the code with a std::set<> but
went for using setName/getName() to make the code more efficient.  In
hindsight this optimization this may have been a mistake, but until
I've actually recreated the multi-viewpoint bug and dug down into
exactly what was going wrong I can't say for sure where just replace
it with std::set will fix all the problems.

In your case you will need to think more deeply about mixing
Int

[osg-users] CMake Dashboard showing incorrect information

2009-11-23 Thread Alberto Luaces
Hi,

did anyone noticed that the dashboard at
http://cdash.openscenegraph.org/index.php?project=OpenSceneGraph
displays incorrect information?

It reports successful builds even they are not; furthermore, it is
evident that the number of updated files every day is also incorrect: in
the last ten days, the board shows at most 1 updated file per day, when
a lot of changes has been made to the trunk in the last week.

--

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


Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Emmanuel Roche
Actually, I also noticed that OSG v2.8.1 uses version 1.0 of the tristripper
library.

As I'm quite in an hurry, I think I will re-implement my own tristripvisitor
with the latest version of tristripper and check if this makes a difference.
Will let you know what's the result of this test.

But I believe this could really be a generic issue (it happens with all the
models I tested) and thus would mean many people are currently using "not so
well tri-stripped" geometries if they use this optimiser feature !  (it is
the case for instance in the OSGExp export plugin for 3DS max as I've
noticed this issue there for the first time).

regards,
Manu.



2009/11/23 Robert Osfield 

> Hi Manu,
>
> If the tristripper doesn't connect the triangles together well then it
> can result on few tristrips and lots of unconnected traingles that it
> has to put into a single list of triangles to avoid lots of separate
> primitive calls.
>
> As to why your model is not being stripped well I can't say.  We've
> used 3rd party code to do the tri-stripping so I'm not best placed to
> answer the low level questions, but... the original author of the cdoe
> Tanguy Fautre is now an OSG user and I believe still on the list so
> perhaps he'll be able to chip in ;-)
>
> Robert.
>
> On Mon, Nov 23, 2009 at 11:08 AM, Emmanuel Roche
>  wrote:
> > Hi everyone,
> >
> > I have a strange problem with the TryStripVisitor:
> >
> > When I use it on a model (with about 6000 triangles, described as
> TRIANGLES
> > [thus using 18000 vertices]) I get trip strip primitive sets indeed
> BUT
> > actually I get a few TRIANGLE_STRIP primitive sets with 4 vertices in
> each,
> > and then a single big TRIANGLES primitive set with about 17950 vertices
> 
> >
> > So, most of the model is just not stripped at all ! any idea what I could
> be
> > doing wrong ???
> >
> > Moreother, I've noticed that the geometry is then transformed as an
> indexed
> > geometry... correct me if I'm wrong but indexed geometries are slower
> that
> > simple vertices ordered arrays. If there a way to switch this or am I on
> my
> > own on this ?
> >
> > Regards,
> > Manu.
> >
> >
> >
> > ___
> > 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] Refactoring DatabasePager NeedToRemove stringflagging technique

2009-11-23 Thread Wojciech Lewandowski
Hi Guys,

I wish to join the discussion because we are currently dealing with real 
problem related to this topic. 

First some background. Its a long comedy of circumstances and sideffects. But 
please bear with me...: 

1. We use PagedLOD database. We used our tools to build it, but it does not 
really differ from osgDEM produced DB. We use it for rendering and 
intersections. 
2. Its a simulation. We need to position and move many entities over terrain  
so we need exact intersections. To get exact elevations we use 
setLODSelectionMode( USE_HGHEST_LEVEL_OF_DETAIL ) to make sure 
IntersectionVisitor computes correct intersection.
3. I don't know if this was deliberate or not, but IntersectionVisitor in 
USE_HGHEST_LEVEL_OF_DETAIL mode does load highest level tiles temporary. It 
does intersections and free them. It does not hook them up to their parents.
4. Above has this horrible effect that if some node was not already loaded by 
DatabasePager it will be constantly loaded and removed by IntersectionVisitor. 
SARCASM#1: But don't loose faith there is a solution. See next point.
5. We found out that we can use osgSim::DatabaseCacheReadCallback to mitigate 
former problem. This is an IntersectVisitor read callback that keeps internal 
cache to avoid  repetitive loading and freeing. Well...this works but only for 
IntesectVisitor. DatabasePager does not know anything about this cache so when 
DatabasePager finally decides to load a tile it does it again, although 
IntersectionVisitor have already loaded it. SARCASM#2: But don't loose hope 
yet, because we found a solution to this as well
6. How to make sure DatabasePager sees the tile IntersectVisitor already loaded 
? Its simple: We could use osgDB cache. So we started to load tiles with 
CACHE_NODES option and everything seemed to be fine
7 But after some time we started to observe crashes and memory leaks. Long 
story about them is in my friend Pawel Ksiezopolski post "Re: [osg-users] 
PagedLOD experts?" from  November 5th. Short story is that caching tiles does 
not free renamed "NeedToRemove" nodes, but keep them in memory so with time 
some if them land int the scene again. When this happens, logic that was 
invented to remove not used nodes removes wrong ones leaving those that should 
be removed. Hence we get PageLOD thrashing and memory leaks. Cool HUH ? (Yes 
its SARCASM#3) 

Now to conclusion: 
In my opinion PageLOD renaming is the reason our elaborated scheme failed. I am 
both unhappy and glad that it happened because it clearly shows that 
Object::_name should not be modified by internal OSG methods. It should be 
never ever changed by OSG.  Management of node name belongs to creators or 
users of the node. 

Thats why I am going to prepare a fix that will not rename nodes to remove.  
But will instead drop their addresses into a set (or sorted vector) and will 
later us this set to test if node is marked for removal. It may be not O(n) but 
O(n log n) but it will work at least.  Is anyone preparing similar fix ?

Cheers,
Wojtek


- Original Message - 
From: "Robert Osfield" 
To: "OpenSceneGraph Users" 
Sent: Friday, November 20, 2009 10:58 AM
Subject: Re: [osg-users] Refactoring DatabasePager NeedToRemove stringflagging 
technique


Hi Chris,

On Mon, Nov 2, 2009 at 4:05 PM, Chris 'Xenon' Hanson
 wrote:
> I'm kind of an old-school C-flavor programmer, so my instinctive response is 
> rather
> C-like. I don't like bloating people's in-memory objects, so I'd lean towards 
> defining a
> 32-bit flag member on class Node called something like 
> _ephemeralInternalStateFlags. This
> would not be saved or restored, and the definitions of each flag bit would be 
> enumerated
> as 1< distribution would be
> prohibited (by policy, can't really enforce it in the compiler) from defining 
> and
> utilizing these flag bits, but code within OSG core could. The first bit 
> allocated would
> be used to replace the NeedToRemove indicator.

I'm not sure whether this is really needed.  The NeedToRemove trick in
DatabasePager is very specific to a piece of code embedded in
DatabasePager it has no value outside this specific bit of code, and I
believe it's not appropriate to build algorithm specific such support
into the core OSG.

> Also, while the read-modify-write cycle used to toggle just one bit of a flag 
> is not as
> fast as the blind-write cycle used when you dedicate a whole boolean variable 
> (and consume
> more memory), both the setting operation AND the testing operation should be 
> faster than
> the current string-marking technique.
>
> If Robert has no objections to this solution, I'll code it up quick and share 
> it.

I think the right thing to do is nothing in the core OSG, and look at
the specific DatabasePager algorithm to retain the O(1) cost of the
check that I was using, with the bugs with handling multiple
viewpoints.


> I'm also concerned about the amount of very similar-but-not-quite-the-same 
> code between
> Datab

Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Robert Osfield
Hi Manu,

If the tristripper doesn't connect the triangles together well then it
can result on few tristrips and lots of unconnected traingles that it
has to put into a single list of triangles to avoid lots of separate
primitive calls.

As to why your model is not being stripped well I can't say.  We've
used 3rd party code to do the tri-stripping so I'm not best placed to
answer the low level questions, but... the original author of the cdoe
Tanguy Fautre is now an OSG user and I believe still on the list so
perhaps he'll be able to chip in ;-)

Robert.

On Mon, Nov 23, 2009 at 11:08 AM, Emmanuel Roche
 wrote:
> Hi everyone,
>
> I have a strange problem with the TryStripVisitor:
>
> When I use it on a model (with about 6000 triangles, described as TRIANGLES
> [thus using 18000 vertices]) I get trip strip primitive sets indeed BUT
> actually I get a few TRIANGLE_STRIP primitive sets with 4 vertices in each,
> and then a single big TRIANGLES primitive set with about 17950 vertices 
>
> So, most of the model is just not stripped at all ! any idea what I could be
> doing wrong ???
>
> Moreother, I've noticed that the geometry is then transformed as an indexed
> geometry... correct me if I'm wrong but indexed geometries are slower that
> simple vertices ordered arrays. If there a way to switch this or am I on my
> own on this ?
>
> Regards,
> Manu.
>
>
>
> ___
> 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] Trees, Grass and Shadows

2009-11-23 Thread Dominic Stalder

Hi Peter

I can't help you with your problem. I am a newbie to OSG, but I'm 
actually trying to have a nice (back)ground for our scene and thought 
that grass and a tree would look very nice. And I have to say that your 
video looks amazing!


Where can I find some helpful information for modeling the grass with 
billboards and how did you create the shadows, with osgShadow or a shader?


Thanks and regards
Dominic

Peter Wraae Marino schrieb:

Hi osgUsers,

I have question about rendering shadows on grass billboards. This is
not a question about anything missing or not working in
OpenSceneGraph, but a question how to solve a problem with shadows and
grass.

The problem is the grass are created using a shader that creates
billboard instances, so all grass you see in the video are billboards.
When the shadowmap is applied to the grass billboard I get streaks at
certain camera angles. Does anyone know how to fix this problem so the
grass looks more natural on a grass billboard.

Here is the video:
http://www.youtube.com/watch?v=iuEVJ-2xQO0

regards,
Peter Wraae Marino

  


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


Re: [osg-users] Texture wrapping for a geometry object

2009-11-23 Thread Dominic Stalder
Hi everybody

thanks for the help. It's really that easy, but I didn't see the hint ;-)

Sorry for that. Now I just set the value of the geometry width instead just 1.0.

Cheers,
Dominic

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





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


[osg-users] TriStripVisitor issue

2009-11-23 Thread Emmanuel Roche
Hi everyone,

I have a strange problem with the TryStripVisitor:

When I use it on a model (with about 6000 triangles, described as TRIANGLES
[thus using 18000 vertices]) I get trip strip primitive sets indeed BUT
actually I get a few TRIANGLE_STRIP primitive sets with 4 vertices in each,
and then a single big TRIANGLES primitive set with about 17950 vertices 

So, most of the model is just not stripped at all ! any idea what I could be
doing wrong ???

Moreother, I've noticed that the geometry is then transformed as an indexed
geometry... correct me if I'm wrong but indexed geometries are slower that
simple vertices ordered arrays. If there a way to switch this or am I on my
own on this ?

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


Re: [osg-users] [forum] OSG Forum image attachments

2009-11-23 Thread Art Tevs
Good to hear,

due to the current implementation of the forum<->mailing list connection, users 
are allowed to specify the settings of how their attachments are treated. So a 
user can force real attachments to be used (instead of links in emails). He can 
also force thumbnails to be attached instead of full size images. The default 
behavior for all users is currently as in my previous post, just to submit a 
link.
The issue with the strange colors is solved, that was a problem of using wrong 
lib for creating thumbnails.

cheers,
art



Kim Bale wrote:
> Hi Art,
> 
> That appears to work perfectly.
> 
> Cheers!
> 
> Kim.
> 
> 
> 2009/11/23 Art Tevs <>:
> 
> > Hi folks,
> > 
> > OK, it seems, I've corrected the issue. Since mailing list has a quota of 
> > 300KB, I changed the forum settings in the way, so that any attachment sent 
> > with a message from the forum will not be attached to the mail, but a link 
> > will be used instead. So that this attachments can then be downloaded from 
> > the forum's webpage. A file limiation on the forum side is 10MB. Let see, 
> > if this will make any troubles.
> > 
> > I've attached a test image to check this behaviour.
> > 
> > 
> > Cheers,
> > Art
> > 
> > P.S. Sorry this is a second try to send this message. It seems some of the 
> > settings were still incorrect
> > 
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=20125#20125
> > 
> > 
> > 
> > 
> > Attachments:
> > http://forum.openscenegraph.org//files/demo_237.png
> > 
> > 
> > ___
> > osg-users mailing list
> > 
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > 
> > 
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


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





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


Re: [osg-users] [forum] OSG Forum image attachments

2009-11-23 Thread Kim Bale
Hi Art,

That appears to work perfectly.

Cheers!

Kim.


2009/11/23 Art Tevs :
> Hi folks,
>
> OK, it seems, I've corrected the issue. Since mailing list has a quota of 
> 300KB, I changed the forum settings in the way, so that any attachment sent 
> with a message from the forum will not be attached to the mail, but a link 
> will be used instead. So that this attachments can then be downloaded from 
> the forum's webpage. A file limiation on the forum side is 10MB. Let see, if 
> this will make any troubles.
>
> I've attached a test image to check this behaviour.
>
>
> Cheers,
> Art
>
> P.S. Sorry this is a second try to send this message. It seems some of the 
> settings were still incorrect
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=20125#20125
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/demo_237.png
>
>
> ___
> 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] [forum] OSG Forum image attachments

2009-11-23 Thread Art Tevs
Hi folks,

OK, it seems, I've corrected the issue. Since mailing list has a quota of 
300KB, I changed the forum settings in the way, so that any attachment sent 
with a message from the forum will not be attached to the mail, but a link will 
be used instead. So that this attachments can then be downloaded from the 
forum's webpage. A file limiation on the forum side is 10MB. Let see, if this 
will make any troubles.

I've attached a test image to check this behaviour.


Cheers,
Art

P.S. Sorry this is a second try to send this message. It seems some of the 
settings were still incorrect

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




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


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


Re: [osg-users] Texture wrapping for a geometry object

2009-11-23 Thread Ulrich Hertlein

On 23/11/09 10:09 AM, Dominic Stalder wrote:

I will try the texture coordinates scaling. But just for interesting,
how would the texture matrix work, do you have some basic code snippet?


osg::TexMat provides a matrix and any texture coordinates you specify will be multiplied 
by that.


The matrix can translate, scale, and rotate the texture coordinates.  For example if you 
specify a x2 scaling matrix and the texture coordinates are 0..1 then that has the same 
effect as if you specified texture coordinates 0..2.


Hope this helps,
/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [forum] OSG Forum image attachments

2009-11-23 Thread Robert Osfield
Hi Art et. al,

The mailing list has a max email size of 300KB to keep down how much
bandwidth the mailing list consumes, as those 300Kb+ has to be sent to
each of nearly 2000 recipients.

Robert.

On Mon, Nov 23, 2009 at 10:09 AM, Art Tevs  wrote:
> Hi,
>
> ok, I tried to post some images and was stopped by the mailing list, because 
> to big :) There is a limitation of 300KB on the mailing list side. On the 
> forum side, I see the problem. The thumbnail of the attachment is the 
> downsized version with strange colors. I'll check this. However, if one do 
> click on the thumbnail the full image is shown, without any filters. So, 
> either the forum software do resize the attachment before submitting to the 
> list or the mailing list software do resize the image attachments before 
> posting to the world.
> So, I will try to check first. Could you try to post some big image (greater 
> than 300KB) to the mailing list in this thread, to make sure that not the 
> second case is responsible for the issue?
>
> regards
> Art
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=20118#20118
>
>
>
>
>
> ___
> 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] [forum] OSG Forum image attachments

2009-11-23 Thread Art Tevs
Hi,

ok, I tried to post some images and was stopped by the mailing list, because to 
big :) There is a limitation of 300KB on the mailing list side. On the forum 
side, I see the problem. The thumbnail of the attachment is the downsized 
version with strange colors. I'll check this. However, if one do click on the 
thumbnail the full image is shown, without any filters. So, either the forum 
software do resize the attachment before submitting to the list or the mailing 
list software do resize the image attachments before posting to the world.
So, I will try to check first. Could you try to post some big image (greater 
than 300KB) to the mailing list in this thread, to make sure that not the 
second case is responsible for the issue?

regards
Art

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





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


[osg-users] Trees, Grass and Shadows

2009-11-23 Thread Peter Wraae Marino
Hi osgUsers,

I have question about rendering shadows on grass billboards. This is
not a question about anything missing or not working in
OpenSceneGraph, but a question how to solve a problem with shadows and
grass.

The problem is the grass are created using a shader that creates
billboard instances, so all grass you see in the video are billboards.
When the shadowmap is applied to the grass billboard I get streaks at
certain camera angles. Does anyone know how to fix this problem so the
grass looks more natural on a grass billboard.

Here is the video:
http://www.youtube.com/watch?v=iuEVJ-2xQO0

regards,
Peter Wraae Marino

-- 
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::Drawable::DrawCallback issue

2009-11-23 Thread Robert Osfield
On Mon, Nov 23, 2009 at 8:09 AM, Harold Comere  wrote:
> Hi Robert,
>
> I used dynamic data variance and it seems to have fixed the issue, thank
> you.
> Anyway i work with a single thread. But the text update is called by an
> event handler in MOVE event, maybe is it called too much in a short time ?
>
> What does DYNAMIC data variance change ? Is it a kind of synchronization
> with mutex ?

Have a search through the archives as I've answered this many times.

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


Re: [osg-users] Running VPBMaster

2009-11-23 Thread Robert Osfield
HI Jacob,

There really is much that others can do to help without be able to run
the same test and see the same behaviour and then run vpbmaster in a
debugger to see what is going on.  vpbmaster should be dispatching the
osgdem tasks and then sitting most idle while the osgdem tasks do the
actual build, and then re-submit new tasks as they are finished.

Try running vpbmaster in a debugger and see what is happening when it's hanging.

Robert.

On Mon, Nov 23, 2009 at 1:36 AM, Jacob Armstrong  wrote:
> So I had VPBMaster running for over two days and it didn't seem to be doing
> anything so I used Ctrl+C to cancel the task and the following was output to
> the screen:
>
> "
> Recieved signal 2, doing TERMINATE_RUNNING_TASKS_THEN_EXIT.
> MachinePool::signal(2)
> Machine::signal(2)
> Machine::cancelThreads() hostname= , threads=2
>  Cancel thread
>  Cancel thread
> Completed Machine::cancelThreads() hostname= , threads=2
> End of TaskSet: tasksPending=4113 taskCompleted=0 taskRunning=0
> tasksFailed=0
> Continuing with existing TaskSet.
> End of Run: tasksPending=4113 taskCompleted=0 taskRunning=0 tasksFailed=0
> MachinePool::reportTimingStats()
>  Machine :
>   Task::type='' minTime=1.120172 maxTime=1.122734
> averageTime=1.121453 totalComputeTime=2.242906 numTasks=2
> Finished run, but did not complete 4113 tasks.
> Total elapsed time = 191483.915636
> "
>
> The total elapsed time equates to 2.2 days, which is about how long it was
> running before I cancelled it. Can anyone tell me what it was doing for 2.2
> days, if no tasks were completed in that time? I kicked it off again and
> cancelled it and I had the same number of tasks created, with all of them
> Pending, and nothing completing. Am I missing a piece of the puzzle here.
> Can anyone please help me?
>
> Thanks,
> Jake
>
>
>
> 
> From: jaco...@hotmail.com
> To: osg-users@lists.openscenegraph.org
> Date: Sun, 22 Nov 2009 19:02:07 -0500
> Subject: Re: [osg-users] Running VPBMaster
>
> Any suggestions here? Should I be doing something with the .source file?
>
>
>
> 
> From: jaco...@hotmail.com
> To: osg-users@lists.openscenegraph.org
> Date: Fri, 20 Nov 2009 15:36:05 -0500
> Subject: [osg-users] Running VPBMaster
>
> Alright, it looks like I've finally gotten VPBMaster-0.9.10 up and running
> (with OSG-2.8.0) and I attempted to feed it the input I was previously
> trying to feed to OSGDem with my older version of OSG. It spit a lot of text
> to the screen, and now seems to have hung. The last thing on the screen is
> "scheduling task :
> tasks/build_subtile_L3_X3_Y3/build_subtile_L7_X63_Y63.task". I tried
> pressing ENTER and it didn't do anything.
>
> I've noticed that I now have a couple new files: build_master.source (0 kb)
> and build_master.tasks (284 kb). I've also got a new "tasks" directory,
> which has 17 files ("build_root_L0_X0_Y0.task" and
> "build_subtile_L3_X0_Y0.task"-"build_subtile_L3_X3_Y3.task") and 16
> directories ("build_subtile_L3_X0_Y0"-"build_subtile_L3_X3_Y3", each
> consisting of 256 files). Do I need to do something next, or is it
> processing something behind the curtain, or did something go wrong since my
> .source file is 0 kb? Any help is appreciated!
>
> Thanks,
> Jake
>
> 
> Windows 7: It works the way you want. Learn more.
> 
> Hotmail: Trusted email with powerful SPAM protection. Sign up now.
> 
> Windows 7: I wanted simpler, now it's simpler. I'm a rock star.
> ___
> 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] Texture wrapping for a geometry object

2009-11-23 Thread Dominic Stalder

Hi Robert

thanks a lot, I got it from this mailing list message:

http://www.mail-archive.com/osg-us...@openscenegraph.net/msg11209.html

I will try the texture coordinates scaling. But just for interesting, 
how would the texture matrix work, do you have some basic code snippet?


Regards
Dominic

Robert Osfield schrieb:

Hi Dominc,

I don't know where you might have got the impression that you can't
set up texture repeats with geometry - you just using texture
coordinates beyond the 0.0 to 1.0 range and you'll get repeats.
Another way is to use a texture matrix to up the tex coords from 0.0
to 1.0 range to what you want.

Robert.

On Sun, Nov 22, 2009 at 3:28 PM, Dominic Stalder
 wrote:
  

Hi there

I would like to wrap (repeated) my texture image on a geometry object. I
read somewhere, that this is not possible directly on the geometry, but how
can I do it otherwise? Here is my code:

  /*
   * creates the ground geometry
   */
  // creates the vertices array
  ref_ptr verticesGround = new Vec3Array;
  verticesGround->push_back(Vec3(-WORLD_INFINITY, 0.0, -WORLD_INFINITY)); //
back left
  verticesGround->push_back(Vec3(WORLD_INFINITY, 0.0, -WORLD_INFINITY));  //
back right
  verticesGround->push_back(Vec3(WORLD_INFINITY, 0.0, WORLD_INFINITY));   //
front right
  verticesGround->push_back(Vec3(-WORLD_INFINITY, 0.0, WORLD_INFINITY));  //
front left
// creates the normal array
  ref_ptr normalsGround = new Vec3Array;
  normalsGround->push_back(Vec3(0.0, 1.0, 0.0));
// creates the texture coordinates array
  ref_ptr texCoordGround = new Vec2Array;
  texCoordGround->push_back(Vec2(0.0, 0.0));
  texCoordGround->push_back(Vec2(1.0, 0.0));
  texCoordGround->push_back(Vec2(1.0, 1.0));
  texCoordGround->push_back(Vec2(0.0, 1.0));
// loads the texture image
  ref_ptr imgGrass =
osgDB::readImageFile(Utilities::filePath("res/osg/grass.png").toStdString());
// attaches the image to the texture
  ref_ptr texGround = new Texture2D;
  texGround->setDataVariance(Object::DYNAMIC);
  texGround->setWrap(Texture::WRAP_S, Texture::REPEAT);
  texGround->setWrap(Texture::WRAP_T, Texture::REPEAT);
  texGround->setImage(imgGrass.get());
// releases the image after applying
  texGround->setUnRefImageDataAfterApply(true);
// creates the geometry
  ref_ptr geomGround = new Geometry;
  geomGround->setVertexArray(verticesGround.get());
  geomGround->setNormalArray(normalsGround.get());
  geomGround->setTexCoordArray(0, texCoordGround.get());

  // adds the primitive set to the geometry
  geomGround->addPrimitiveSet(new DrawArrays(PrimitiveSet::QUADS, 0, 4));
// enables all the necessary states for the ground geometry node
  ref_ptr stateGroundGeometry = geomGround->getOrCreateStateSet();
  stateGroundGeometry->setTextureAttributeAndModes(0, texGround.get(),
StateAttribute::ON);

  // creates the geode
  ref_ptr geoGround = new Geode;
  geoGround->addDrawable(geomGround.get());

Thanks a lot in advance!

Best regards
Dominic
___
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] Mac bundle distribution can't use plugin

2009-11-23 Thread Filip Wänström
Hi, thanks for the answer but I am using CMake/regular makefiles to do
all my building and using the "OSX Ingest into bundle" script that
comes with osg. I just presumed it did all magic but maybe I should
check out the actual paths in the libs. I'll be back with a report.
/Filip

On Fri, Nov 20, 2009 at 6:21 PM, Stephan Maximilian Huber
 wrote:
> Hi Filip,
>
> check your system.log-file -- I am pretty sure the osgdb_obj pluging
> refers to the osg-dylibs in /usr/lib or similar.
>
> You'll have to massage the paths to the libs stored in the plugin via
> install_name_tool in a post-build-step.
>
> Paths to libs are hardcoded in the object-file when linked. You can
> change them to something better suited like @loader_path.../pipapo. Try
> googling for install_name_tool and @loader_path to get an idea.
>
> If you are using the deprecated XCode-project and embed the osg
> frameworks into your app and the obj-plugin into plugins it should work
> out of the box whithout fiddling around with install_name_tool.
>
> cheers,
> Stephan
>
>
>
> Filip Wänström schrieb:
>> Hi,
>>
>> I have problems with distributing self-contained applications on the
>> mac. I have reduced my issues by building a very simple example that
>> basically only opens a window and loads an .obj file.
>>
>> Using OSG_NOTIFY_LEVEL=INFO (DEBUG is the same + a lot more, but
>> unrelated) I get the following output:
>>
>> [fi...@mpq]:[~/Documents/Code/OSGTests/]$
>> ./_CPack_Packages/Darwin/DragNDrop/BasicApp-1.0.0-Darwin/BasicApp.app/Contents/MacOS/BasicApp
>> GraphicsContext::setWindowingSystemInterface() 0xc0e930 0xa13c50
>> Initiating 
>> Constructing BasicApp 1
>> Listing plugins
>> plugin: 
>> /Users/filip/Documents/Code/OSGTests/_CPack_Packages/Darwin/DragNDrop/BasicApp-1.0.0-Darwin/BasicApp.app/Contents/PlugIns/osgPlugins-2.9.6/osgdb_obj.so
>> Found file: "data/models/clogo.obj"
>> Opened DynamicLibrary osgPlugins-2.9.6/osgdb_obj.so
>> Warning: Could not find plugin to read objects from file
>> "data/models/clogo.obj".
>> Failed to load model
>>
>> This seems self contradictory to me...
>>
>> So as far as I can tell:
>> 1) the bundled osglibs are found correctly and the app starts
>> 2) the file in the Resources directory in the app bundle is found correctly
>> 3) the right plugin is chosen and found in the app bundle
>> PlugIns/osgPlugins-2.9.6 directory
>> 4) The lib is opened ok
>> 5) it fails
>>
>> All .dylibs/.so are copied from my /usr/local/ osg install into the app 
>> bundle
>>
>> I tried to see if there were some hidden depencies on osgdb_obj.so
>> using otool but as far as I could tell there were no extra Non-system
>> dependencies
>>
>> I'm at a loss here and tearing my nonexistent hair. Any help would be
>> greatly appreciated.
>>
>> Best
>> /Filip
>> ___
>> 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] osg::Drawable::DrawCallback issue

2009-11-23 Thread Harold Comere
Hi Robert,

I used dynamic data variance and it seems to have fixed the issue, thank
you.
Anyway i work with a single thread. But the text update is called by an
event handler in MOVE event, maybe is it called too much in a short time ?

What does DYNAMIC data variance change ? Is it a kind of synchronization
with mutex ?

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