Re: [osg-users] Problem with OSG Particle System

2008-05-19 Thread Ulrich Hertlein

Neusch, Dominik, SDGE1 wrote:

I absolutely agree with your suggestion and I modified my application. But
when I change the osg::ref_ptr to an osg::Node* it has no effect.
I still have the same problem.


You mean it still crashes?
Have you tried to operate on a copy of the nodepath in stead of modifying the 
NodeVisitor's nodepath?


{
osg::NodePath fullNodePath = nv->getNodePath();
fullNodePath.pop_back();
...
}

Other than that you should try to get more detailed information about the crash 
using a debugger.  Maybe it's completely unrelated to this code?


Cheers,
/uli

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


Re: [osg-users] Problem with OSG Particle System

2008-05-19 Thread Neusch, Dominik, SDGE1
Hi Ulrich,

Thanks for your fast reply.

I absolutely agree with your suggestion and I modified my application. But when 
I change the osg::ref_ptr to an osg::Node* it has no effect. I still 
have the same problem.

Thanks,

Dominic




-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Ulrich Hertlein
Gesendet: Dienstag, 20. Mai 2008 08:12
An: OpenSceneGraph Users
Betreff: Re: [osg-users] Problem with OSG Particle System

Hi Dominik,

it looks like you have a problem with reference counting:

{
osg::NodePath& fullNodePath = nv->getNodePath();
osg::ref_ptrx = fullNodePath.back();
...
fullNodePath.push_back( x.get() );
}

assigns an 'osg::Node*' (from 'getNodePath') to a smart pointer.
You later get the pointer from the smart pointer and push it onto the nodepath.
When you leave the current scope the smart pointer 'x' is destroyed which 
destroys the object it pointed to (since there apparently are no other users).

But you've pushed the object onto the nodelist, so that now contains a pointer 
to an invalid object -> segfault.

Just replace 'osg::ref_ptr' with a regular 'osg::Node*' and you 
should be good.

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

class orbit : public osg::NodeCallback {
public:
  orbit(): _angle(0.0) {}
  virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) {
osg::MatrixTransform *tx = dynamic_cast(node);
if( tx != NULL ) {
  _angle += 3.1415927/(180.0*5.0); //M_PI
  tx->setMatrix( osg::Matrix::translate( 50.0, 0.0, 8.0) * 
osg::Matrix::rotate( _angle, 0, 0, 1 ) );
}
traverse(node, nv);
  }
private:
  float _angle;
};

class psGeodeTransform : public osg::MatrixTransform
{
public:
   class psGeodeTransformCallback : public osg::NodeCallback
   {
  virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
  {
if ( psGeodeTransform* ps = dynamic_cast( node ) ) {
  
  osg::NodePath& fullNodePath = nv->getNodePath();
  osg::Node* x = fullNodePath.back(); //modified
  fullNodePath.pop_back();

  osg::Matrix localCoordMat = osg::computeLocalToWorld( fullNodePath );
  osg::Matrix inverseOfAccum = osg::Matrix::inverse( localCoordMat );

  ps->setMatrix( inverseOfAccum );
  fullNodePath.push_back( x ); //modified
}
traverse(node, nv); 
  }
   };

   psGeodeTransform() {setUpdateCallback( new psGeodeTransformCallback() );}

};

class findGeodeVisitor : public osg::NodeVisitor
{
public:
   findGeodeVisitor() : osg::NodeVisitor(TRAVERSE_ALL_CHILDREN)
   {
  foundGeode = NULL;
   }
   virtual void apply(osg::Node &searchNode)
   {
 if ( osg::Geode* g = dynamic_cast (&searchNode) ) {
   foundGeode = g;
 } else {
   traverse(searchNode);
 }
   }
   osg::Geode* getGeode() {
 return foundGeode;
   }
protected:
   osg::Geode* foundGeode;
};


class particleSystemHelper : public osg::Group 
{ 
public: 
   particleSystemHelper(osg::Group* psGroup) : osg::Group(*psGroup) 
   { 
 osg::ref_ptr fg = new findGeodeVisitor(); 
 accept(*fg.get()); 
  osg::ref_ptr psGeode = fg->getGeode(); 
  psGeodeXForm = new psGeodeTransform(); 
  psGeodeXForm->addChild (psGeode.get()); 
  replaceChild(psGeode.get(),psGeodeXForm); 
   } 
   void addEffect(osg::Group* psGroup) 
   { 
  this->addChild(psGroup); 
  osg::ref_ptr fg = new findGeodeVisitor(); 
  psGroup->accept(*fg.get()); 
  osg::ref_ptr psGeode = fg->getGeode(); 
  psGeodeXForm->addChild(psGeode.get()); 
  psGroup->removeChild( psGroup->getChildIndex(psGeode.get()) ); 
   } 
protected: 
   psGeodeTransform* psGeodeXForm; 
}; 


int main() {
  putenv( "OSG_SCREEN=1" );
  
  osg::ref_ptr rootNode = new osg::Group();
  osg::ref_ptr terrainNode = new osg::Node();
  osg::ref_ptr tankNode = new osg::Node();
  osg::ref_ptr geode = new osg::Geode();
  osg::ref_ptr geode2 = new osg::Geode();
  osgViewer::Viewer viewer;

  terrainNode = osgDB::readNodeFile( "C:\\Dokumente und 
Einstellungen\\I123066D\\Desktop\\OSG_NPS_Tutorials\\NPS_Data\\Models\\JoeDirt\\JoeDirt.flt"
 );
  if( !terrainNode ) {
return -1;
  }
  rootNode->addChild( terrainNode.get() );

  tankNode = osgDB::readNodeFile( "C:\\Dokumente und 
Einstellungen\\I123066D\\Desktop\\OSG_NPS_Tutorials\\NPS_Data\\Models\\t72-tank\\T72-tank_des.flt"
 );
  if( !tankNode ) {
return -1;
  }

  osg::ref_ptr dustParticleSystem = new 
osgParticle::ParticleSystem;
  dustParticleSystem->setDefaultAttributes( "C:\\Dokumente und

Re: [osg-users] PSSM segfaulting in cull()?

2008-05-19 Thread Adrian Egli OpenSceneGraph (3D)
Which version are you using the latest SVN, the latest PSSM (see post from
friday to yesterday) ?

2008/5/19 Alejandro Segovia <[EMAIL PROTECTED]>:

>
> On Mon, May 19, 2008 at 6:03 PM, Alejandro Segovia <[EMAIL PROTECTED]>
> wrote:
>
>> Hello List,
>>
>> I'm having a hard time using PSSM (or anything besides ShadowTexture for
>> that matter) to add shadows to my scene.
>>
>> I've got some initialization code inspired in the osgshadow example, which
>> seems to work fine when I pass the --NVidea parameter, but when I try the
>> very same technique in my code, it just crashes inside the PSSM's cull()
>> method.
>>
>> This is the backtrace I get from the core dump:
>>
>> #0  0xb6f961c9 in osgShadow::ParallelSplitShadowMap::cull ()
>>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgShadow.so.25
>> #1  0xb6f87656 in osgShadow::ShadowTechnique::traverse ()
>>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgShadow.so.25
>> #2  0xb6f8e7c0 in osgShadow::ShadowedScene::traverse ()
>>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgShadow.so.25
>> #3  0xb6d38196 in osgUtil::CullVisitor::apply ()
>>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgUtil.so.25
>> #4  0xb6f8eb11 in osgShadow::ShadowedScene::accept ()
>>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgShadow.so.25
>> #5  0xb726fa84 in osg::Group::traverse ()
>>from /usr/local/OpenSceneGraph/2.2.0/lib/libosg.so.25
>> #6  0xb6d38196 in osgUtil::CullVisitor::apply ()
>>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgUtil.so.25
>> #7  0xb727095f in osg::Group::accept ()
>>from /usr/local/OpenSceneGraph/2.2.0/lib/libosg.so.25
>> #8  0xb6dc89f7 in osgUtil::SceneView::cullStage ()
>>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgUtil.so.25
>> #9  0xb6dc7cd6 in osgUtil::SceneView::cull ()
>>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgUtil.so.25
>> #10 0xb6a596ef in Canvas::customEvent (this=0x80c4780,
>> event=0x80deb60) at Canvas.cpp:200
>>
>> Canvas is just a custom class derived from QGLWidget.
>>
>> This is the initialization code I'm using, please note the ShadowedScene
>> node is not the root of the scene graph.
>>
>> osg::ref_ptr shadowTech =
>>   new osgShadow::ParallelSplitShadowMap(NULL, 3);
>>   shadowTech->setTextureResolution(1024);
>>   shadowTech->setMinNearDistanceForSplits(0);
>>   shadowTech->setMaxFarDistance(0);
>>   shadowTech->setMoveVCamBehindRCamFactor(0);
>>   double polyoffsetfactor = 10.0f; //-0.02;
>>   double polyoffsetunit = 20.0f; //1.0;
>>
>> shadowTech->setPolygonOffset(osg::Vec2(polyoffsetfactor,polyoffsetunit));
>>
>>   _shadowNode = new osgShadow::ShadowedScene();
>>   _shadowNode->setShadowTechnique(shadowTech.get());
>>
>>   _shadowNode->setCastsShadowTraversalMask(0x2|0x8);
>>   _shadowNode->setReceivesShadowTraversalMask(0x1|0x8);
>>
>> I'm also using SceneView objects to hold the camera information such as
>> the projection and modelview matrices. There are two lights in the scene and
>> only one object (a floor).
>>
>> Thanks in advance,
>> Alejandro Segovia.-
>>
>> --
>> [EMAIL PROTECTED]
>> http://varrojo.linuxuruguay.org
>
>
>
> Setting the OSG_NOTIFY_LEVEL variable to DEBUG in order to determine what
> could possibly be wrong, I noticed the shader program is never compiled for
> PSSM! Is there some way to force program compilation in OSG?
>
> I attach the dump for osgshadow and then for my application. Notice mine
> never gets its shader compiled.
>
> Dump for osgshadow:
>
> ...
> View::init()
> ParallelSplitShadowMap : Texture ID=0 Resolution=1024
> CullSettings::readEnvironmentalVariables()
> Uniform Adding parent
> Uniform Adding parent
> Uniform Adding parent
> Uniform Adding parent
> Uniform Adding parent
> ParallelSplitShadowMap : Texture ID=1 Resolution=1024
> CullSettings::readEnvironmentalVariables()
> Uniform Adding parent
> Uniform Adding parent
> Uniform Adding parent
> Uniform Adding parent
> Uniform Adding parent
> ParallelSplitShadowMap : Texture ID=2 Resolution=1024
> CullSettings::readEnvironmentalVariables()
>
> ParallelSplitShadowMap: GLSL shader code:
> ---
> uniform sampler2D baseTexture;
> uniform sampler2D randomTexture;
> uniform float enableBaseTexture;
> uniform sampler2DShadow shadowTexture0;
> uniform float zShadow0;
> uniform sampler2DShadow shadowTexture1;
> uniform float zShadow1;
> uniform sampler2DShadow shadowTexture2;
> uniform float zShadow2;
> void main(void)
> {
> vec4 coord   = gl_FragCoord;
> float shadow0 = shadow2DProj( shadowTexture0,gl_TexCoord[1]).r;
> vec4 random0 =
> 0.0012207*coord.z*texture2D(randomTexture,gl_TexCoord[1].st);
> float shadow10 = shadow2DProj(
> shadowTexture0,gl_TexCoord[1]+random0.r*vec4(-1,-1,0,0)).r;
> float shadow20 = shadow2DProj(
> shadowTexture0,gl_TexCoord[1]+random0.g*vec4(1,-1,0,0)).r;
> float shadow30 = shadow2DProj(
> shadowTexture0,gl_TexCoord[1]+random0.b*vec4(1,1,0,0)).r;
> float shadow40 =

Re: [osg-users] Problem with OSG Particle System

2008-05-19 Thread Ulrich Hertlein

Hi Dominik,

it looks like you have a problem with reference counting:

{
   osg::NodePath& fullNodePath = nv->getNodePath();
   osg::ref_ptrx = fullNodePath.back();
...
   fullNodePath.push_back( x.get() );
}

assigns an 'osg::Node*' (from 'getNodePath') to a smart pointer.
You later get the pointer from the smart pointer and push it onto the nodepath.
When you leave the current scope the smart pointer 'x' is destroyed which 
destroys the object it pointed to (since there apparently are no other users).


But you've pushed the object onto the nodelist, so that now contains a pointer 
to an invalid object -> segfault.


Just replace 'osg::ref_ptr' with a regular 'osg::Node*' and you 
should be good.


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


[osg-users] Problem with OSG Particle System

2008-05-19 Thread Neusch, Dominik, SDGE1
Hi,
 
I have a problem with the OpenSceneGraph particle system.
 
I read tutorial 17 from the NPS Tutorials by Jason Sullivan (
http://faculty.nps.edu/jasullivan/osgTutorials/osgParticle.htm) and the
new summary about loading particle systems from a file (
http://faculty.nps.edu/jasullivan/osgTutorials/osgParticleHelper.htm).
 
My application looks almost like the tutorial, I only modified it at two
positions wich I have marked with "//modified". I attached the complete
source code to this mail.
Now if I start the application it works fine for a few seconds. But
after that, the particles are starting flying wild around a circle and
the application crashes.
Is there still a problem with the transformation?
 
Thanks,
 
Dominic Neusch
 

Dominic Neusch
Diplomand
EADS
Defence & Security
System Design Center Germany - SDGE1
88039 Friedrichshafen - Deutschland
Telephone: +49 (0) 7545 8-2686
Fax: +49 (0) 7545 8-9630
Email: mailto:[EMAIL PROTECTED]   
www.eads.com  
EADS Deutschland GmbH
Registered Office: Ottobrunn
District Court of Munich HRB 107 648
Chairman of the Supervisory Board: Dr. Thomas Enders
Managing Directors: Dr. Stefan Zoller (chairman), Michael Hecht
This E-mail and any attachment(s) to it are for the addressee's use
only.
It is strictly confidential and may contain legally privileged
information. No confidentiality or privilege is waived or lost by any
mistransmission.
If you are not the intended addressee, then please delete it from your
system and notify the sender immediateley. You are hereby notified that
any use, 
disclosure, copying or any action taken in reliance on it is strictly
prohibited and may be unlawful. - Thank you.
Before printing this e-mail, think about our environmental
responsibility
 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include  
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

class orbit : public osg::NodeCallback {
public:
  orbit(): _angle(0.0) {}
  virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) {
osg::MatrixTransform *tx = dynamic_cast(node);
if( tx != NULL ) {
  _angle += 3.1415927/(180.0*5.0); //M_PI
  tx->setMatrix( osg::Matrix::translate( 50.0, 0.0, 8.0) * 
osg::Matrix::rotate( _angle, 0, 0, 1 ) );
}
traverse(node, nv);
  }
private:
  float _angle;
};

class psGeodeTransform : public osg::MatrixTransform
{
public:
   class psGeodeTransformCallback : public osg::NodeCallback
   {
  virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
  {
if ( psGeodeTransform* ps = dynamic_cast( node ) ) {
  
  osg::NodePath& fullNodePath = nv->getNodePath();
  osg::ref_ptr x = fullNodePath.back(); //modified
  fullNodePath.pop_back();

  osg::Matrix localCoordMat = osg::computeLocalToWorld( fullNodePath );
  osg::Matrix inverseOfAccum = osg::Matrix::inverse( localCoordMat );

  ps->setMatrix( inverseOfAccum );
  fullNodePath.push_back( x.get() ); //modified
}
traverse(node, nv); 
  }
   };

   psGeodeTransform() {setUpdateCallback( new psGeodeTransformCallback() );}

};

class findGeodeVisitor : public osg::NodeVisitor
{
public:
   findGeodeVisitor() : osg::NodeVisitor(TRAVERSE_ALL_CHILDREN)
   {
  foundGeode = NULL;
   }
   virtual void apply(osg::Node &searchNode)
   {
 if ( osg::Geode* g = dynamic_cast (&searchNode) ) {
   foundGeode = g;
 } else {
   traverse(searchNode);
 }
   }
   osg::Geode* getGeode() {
 return foundGeode;
   }
protected:
   osg::Geode* foundGeode;
};


class particleSystemHelper : public osg::Group 
{ 
public: 
   particleSystemHelper(osg::Group* psGroup) : osg::Group(*psGroup) 
   { 
 osg::ref_ptr fg = new findGeodeVisitor(); 
 accept(*fg.get()); 
  osg::ref_ptr psGeode = fg->getGeode(); 
  psGeodeXForm = new psGeodeTransform(); 
  psGeodeXForm->addChild (psGeode.get()); 
  replaceChild(psGeode.get(),psGeodeXForm); 
   } 
   void addEffect(osg::Group* psGroup) 
   { 
  this->addChild(psGroup); 
  osg::ref_ptr fg = new findGeodeVisitor(); 
  psGroup->accept(*fg.get()); 
  osg::ref_ptr psGeode = fg->getGeode(); 
  psGeodeXForm->addChild(psGeode.get()); 
  psGroup->removeChild( psGroup->getChildIndex(psGeode.get()) ); 
   } 
protected: 
   psGeodeTransform* psGeodeXForm; 
}; 


int main() {
  putenv( "OSG_SCREEN=1" );
  
  osg::ref_ptr rootNode = new osg::Group();
  osg::ref_ptr terrainNode = new osg::Node();
  osg::ref_ptr tankNode = new osg::Node();
  osg::ref_ptr geode = new osg::Geode();
  osg::ref_ptr geode2 = new osg::Geode();
  osgViewer::Viewer viewer;

  terrainNode = osgDB::readNodeFile( "C:\\Dokumente und 
Einstellungen\\I123066D\\Desktop\\OSG_NPS_Tutori

Re: [osg-users] Compiling for 64 bit Vista with Windows SDK for Windows Server 2008

2008-05-19 Thread Philip Lowman
On Mon, May 19, 2008 at 5:38 PM, Roger Martin <[EMAIL PROTECTED]>
wrote:

> Hi,
>
> Trying to use CMake with Windows SDK for Windows Server 2008 on a
> Vista 64 bit box.
>
> Running into the 'NMAKE fatal error: U1065: invalid option j' issue.


Could you try to create a simplistic CMakeLists.txt in a new directory,
configure, and make sure this isn't an issue with your environment or a
CMake bug?

If this doesn't work you could take things up on the CMake mailing list?

Create CMakeLists.txt:
PROJECT(foo)
ADD_EXECUTABLE(foo foo.cc)

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


Re: [osg-users] Operating Systems + Applications -> Application Systems

2008-05-19 Thread Jan Ciger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Markus Hein wrote:

> Hi Zoltan,
> 
> this is good news for me. Probably we all using nvidia adapters under
> linux. Has someone tried if  Mandriva 2008.spring with fglrx .. ?
> 

I am running the Powerpack edition (not the live CD) and there is no
problem. The system on the Live CD is the same, I do not see why it
shouldn't work.

Jan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFIMik6n11XseNj94gRAgnYAKDW1uaU2ntCmwBbpRSPO3KdRi5c3QCdEiR9
J4nd97DwxEQuG2OKqfHu7WM=
=HFH/
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG 2.4 problem reading tiffs.

2008-05-19 Thread eheft
To all,

It turns out that I was able to compile and link 2.4 and 2.5 , but
when I went to run none of the plug ins that depended on the 3rd party
libraries were able to load. Looking at the libs using depends made it
look like they would load, and finally I tried using LoadLibraryEx()
and found a posting that suggested that the problem was mixing
libraries built with MSVC 8.0 and those patched with MSVC service pack
1.

After installing the service pack and rebuilding the project things
work normally.

Moral of the story, if your on WinXP using MSVC install the 450 meg
service pack when you move to 2.4/2.5
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Uniform value getting overwritten in shader.

2008-05-19 Thread Monteleone, Nathan
Hi Mike,

I have a simple repro of this problem.  See the attached .osg file.

It's a super simple shader that colors an object blue or red depending
on a bool uniform.  The default state on the parent group sets this
uniform to 0, then one of the children overrides it with 1.  You'd
expect to see a blue sphere and a red sphere.  But in OSG 1.2 you see
two blue spheres.  OSG 2.4 works as I'd expect.

The problem seems to come in when the render bins are set up in just the
right way -- in this case, with the overriding child rendering first.

Obviously we can fix the problem by going to OSG 2.4, and we're trying
:)  But unfortunately we have to put out a working version of our
software pretty soon with 1.2 as the base (I'm working on the same
project as Chris).  Do you know of a reliable workaround?

Thanks,
Nathan



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Dorosky, Christopher G
Sent: Monday, May 19, 2008 1:41 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Uniform value getting overwritten in shader.

Mike,

Run with osgviewer, the glsl example works.

The problem with that example is that it creates new geometry and
doesn't reuse it.

My model has two parents (MatrixTransforms), A & B. These parents share
the same shader, but have different statesets.

"A" has a stateset setting a new uniform MYCOLOR to (1.0, 0.0, 0.0,
1.0);
"B" has a stateset setting a new uniform MYCOLOR to (0.0, 0.0, 1.0,
1.0);

The scene graph adds A first, then B. They are translated from each
other.
The shader simply sets the gl_FragColor to MYCOLOR.

If "A" and "B" are in the scene, both are RED.
If only "B" is in the scene, it is BLUE.

It appears that the uniform gets trampled. I was careful to make
explicitly new uniforms each time.
Running a different set of geometry under the shader, and setting a new
MYCOLOR to GREEN works.

The problem seems to be with reusing geometry, but applying different
statesets to the parents. The uniform value of the object during its
draw under the second parent retains its first parent value.

For what it's worth, this worked fine under whatever pre-1.2 version we
were using.

Chris





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike
Weiblen
Sent: Thursday, May 15, 2008 2:13 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Uniform value getting overwritten in shader.

Does the glsl_simple.osg example datafile work for you?  It demonstrates
one shader w/ different values for the "Color1" uniform.
-- mew



On Thu, May 15, 2008 at 2:01 PM, Dorosky, Christopher G
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am having problems with a uniform value getting trumped in a shader.
>
> Here is most of the shader fragment:
>
> ___
>
>  os << "\nuniform bool PreMultipliedAlpha;\n";  os << "uniform vec4 
> FogUniform;\n";
>  os << "   vec3 FogColor;\n";
>os << "   vec3 FogUniformColor;\n";
>
>os << "void main()\n";
>os << "{\n";
>
>os << "   if (PreMultipliedAlpha) {\n";
>os << "  FogColor = gl_Fog.color.rgb * gl_FragColor.a;\n";
>if (aFogType == EXP2_FOG)
>os << "  FogUniformColor = FogUniform.rgb *
> gl_FragColor.a;\n";
>os << "   } else {\n";
>os << "  FogColor = gl_Fog.color.rgb;\n";
>if (aFogType == EXP2_FOG)
>os << "  FogUniformColor = FogUniform.rgb;\n";
>os << "   }\n";
> __
>
> Now, to use it, I have this code...
>
> osg::Group *Topgroup = new osg::Group; // real code this has more 
> stuff attached.
> osg::Group *group = new osg::Group;
>
> Topgroup->addChild(group);
>
> // modelA and modelB groups already exist.
>
> modelA->getOrCreateStateSet()->getOrCreateUniform("PreMultipliedAlpha"
> modelA->,
> osg::Uniform::BOOL)->set(true);
> modelB->getOrCreateStateSet()->getOrCreateUniform("PreMultipliedAlpha"
> modelB->,
> osg::Uniform::BOOL)->set(false);
>
>
> group->addChild(modelA);
> group->addChild(modelB);
>
> // Then the Fragment shader is added to the Topgroup node.
> // Didn't include code here because it is long, and it works as shown 
> below.
>
> Here is what happens.
> When modelA and modelB are added to the group as shown above, the 
> uniform is always false.
>
> If I comment out the line:
> //group->addChild(modelB);
>
> Then I have the uniform set correctly to true.
>
> Reinserting that line, and commenting out
> group->addChild(modelA);
> Has the uniform set correctly to false.
>
> It seems that I can't have both models added with different uniform 
> values without one trumping the other.
>
> Am I doing something wrong or is this a bug?
>
> I've tried more obvious things conditional on the uniform value, like 
> making the model red or blue with same results.
>
> OSG 1.2, Windows XP
>
> Thanks,
>
> Chris
> ___

Re: [osg-users] PSSM segfaulting in cull()?

2008-05-19 Thread Alejandro Segovia
On Mon, May 19, 2008 at 6:03 PM, Alejandro Segovia <[EMAIL PROTECTED]>
wrote:

> Hello List,
>
> I'm having a hard time using PSSM (or anything besides ShadowTexture for
> that matter) to add shadows to my scene.
>
> I've got some initialization code inspired in the osgshadow example, which
> seems to work fine when I pass the --NVidea parameter, but when I try the
> very same technique in my code, it just crashes inside the PSSM's cull()
> method.
>
> This is the backtrace I get from the core dump:
>
> #0  0xb6f961c9 in osgShadow::ParallelSplitShadowMap::cull ()
>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgShadow.so.25
> #1  0xb6f87656 in osgShadow::ShadowTechnique::traverse ()
>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgShadow.so.25
> #2  0xb6f8e7c0 in osgShadow::ShadowedScene::traverse ()
>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgShadow.so.25
> #3  0xb6d38196 in osgUtil::CullVisitor::apply ()
>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgUtil.so.25
> #4  0xb6f8eb11 in osgShadow::ShadowedScene::accept ()
>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgShadow.so.25
> #5  0xb726fa84 in osg::Group::traverse ()
>from /usr/local/OpenSceneGraph/2.2.0/lib/libosg.so.25
> #6  0xb6d38196 in osgUtil::CullVisitor::apply ()
>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgUtil.so.25
> #7  0xb727095f in osg::Group::accept ()
>from /usr/local/OpenSceneGraph/2.2.0/lib/libosg.so.25
> #8  0xb6dc89f7 in osgUtil::SceneView::cullStage ()
>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgUtil.so.25
> #9  0xb6dc7cd6 in osgUtil::SceneView::cull ()
>from /usr/local/OpenSceneGraph/2.2.0/lib/libosgUtil.so.25
> #10 0xb6a596ef in Canvas::customEvent (this=0x80c4780,
> event=0x80deb60) at Canvas.cpp:200
>
> Canvas is just a custom class derived from QGLWidget.
>
> This is the initialization code I'm using, please note the ShadowedScene
> node is not the root of the scene graph.
>
> osg::ref_ptr shadowTech =
>   new osgShadow::ParallelSplitShadowMap(NULL, 3);
>   shadowTech->setTextureResolution(1024);
>   shadowTech->setMinNearDistanceForSplits(0);
>   shadowTech->setMaxFarDistance(0);
>   shadowTech->setMoveVCamBehindRCamFactor(0);
>   double polyoffsetfactor = 10.0f; //-0.02;
>   double polyoffsetunit = 20.0f; //1.0;
>   shadowTech->setPolygonOffset(osg::Vec2(polyoffsetfactor,polyoffsetunit));
>
>   _shadowNode = new osgShadow::ShadowedScene();
>   _shadowNode->setShadowTechnique(shadowTech.get());
>
>   _shadowNode->setCastsShadowTraversalMask(0x2|0x8);
>   _shadowNode->setReceivesShadowTraversalMask(0x1|0x8);
>
> I'm also using SceneView objects to hold the camera information such as the
> projection and modelview matrices. There are two lights in the scene and
> only one object (a floor).
>
> Thanks in advance,
> Alejandro Segovia.-
>
> --
> [EMAIL PROTECTED]
> http://varrojo.linuxuruguay.org



Setting the OSG_NOTIFY_LEVEL variable to DEBUG in order to determine what
could possibly be wrong, I noticed the shader program is never compiled for
PSSM! Is there some way to force program compilation in OSG?

I attach the dump for osgshadow and then for my application. Notice mine
never gets its shader compiled.

Dump for osgshadow:

...
View::init()
ParallelSplitShadowMap : Texture ID=0 Resolution=1024
CullSettings::readEnvironmentalVariables()
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
ParallelSplitShadowMap : Texture ID=1 Resolution=1024
CullSettings::readEnvironmentalVariables()
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
ParallelSplitShadowMap : Texture ID=2 Resolution=1024
CullSettings::readEnvironmentalVariables()

ParallelSplitShadowMap: GLSL shader code:
---
uniform sampler2D baseTexture;
uniform sampler2D randomTexture;
uniform float enableBaseTexture;
uniform sampler2DShadow shadowTexture0;
uniform float zShadow0;
uniform sampler2DShadow shadowTexture1;
uniform float zShadow1;
uniform sampler2DShadow shadowTexture2;
uniform float zShadow2;
void main(void)
{
vec4 coord   = gl_FragCoord;
float shadow0 = shadow2DProj( shadowTexture0,gl_TexCoord[1]).r;
vec4 random0 =
0.0012207*coord.z*texture2D(randomTexture,gl_TexCoord[1].st);
float shadow10 = shadow2DProj(
shadowTexture0,gl_TexCoord[1]+random0.r*vec4(-1,-1,0,0)).r;
float shadow20 = shadow2DProj(
shadowTexture0,gl_TexCoord[1]+random0.g*vec4(1,-1,0,0)).r;
float shadow30 = shadow2DProj(
shadowTexture0,gl_TexCoord[1]+random0.b*vec4(1,1,0,0)).r;
float shadow40 = shadow2DProj(
shadowTexture0,gl_TexCoord[1]+random0.a*vec4(-1,1,0,0)).r;
shadow0 = shadow0 + shadow10 + shadow20 + shadow30 + shadow40;
shadow0 = shadow0*0.2;
float shadow1 = shadow2DProj( shadowTexture1,gl_TexCoord[2]).r;
vec4 random1 =
0.0012207*coord.z*texture2D(randomTexture,gl_TexCoord[2].st

[osg-users] Compiling for 64 bit Vista with Windows SDK for Windows Server 2008

2008-05-19 Thread Roger Martin
Hi,

Trying to use CMake with Windows SDK for Windows Server 2008 on a
Vista 64 bit box.

Running into the 'NMAKE fatal error: U1065: invalid option j' issue.

Have property CMAKE_MAKE_PROGRAM=C:\Program Files (x86)\Microsoft
Visual Studio 9.0\VC\bin\nmake.exe where it is located.

Have the LIB environment variable pointing to the 64 bit libraries at
C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib\x64

can't find this j option(would like to choke it) anywhere.

Any tricks?  Something I'm missing?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Operating Systems + Applications -> Application Systems

2008-05-19 Thread Markus Hein

Zoltán schrieb:
  
yes. I just did that (Mandriva 2008.spring) I don't know if 
they download it or if they "cache" the drivers locally on 
the CD, but you boot the LiveCD and you have 3D (OK, it's 
quite long to boot). And when you install you still have 
3D.


I'll try OSG ASAP

bye

Zoltán





  

Hi Zoltan,

this is good news for me. Probably we all using nvidia adapters under 
linux. Has someone tried if  Mandriva 2008.spring with fglrx .. ?


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


Re: [osg-users] Operating Systems + Applications -> Application Systems

2008-05-19 Thread Markus Hein

Hi Jan,



Then I think we are not speaking about the same thing. Of course, if I
was to rebuild isos daily, I would look for something else. However,
that is not the issue for me - the whole point of making a live CD is to
give it away at conferences or to students and such. That doesn't mean
it has to be 100% current. Thus the rebuilding issue is moot and I can
live with 6months old Knoppix. The Kanotix you pointed out is even older
than that, despite being released in January.
the -same-  ISO which the terminalserver app uses to feed the PC's in 
the classroom would be use as ISO which one would put on CD or USB to 
run the same session at home.



I pointed to a prewiew release with Debian Etch packages from 26. April 
2008.


regards, Markus

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


Re: [osg-users] Operating Systems + Applications -> Application Systems

2008-05-19 Thread Zoltán
Markus Hein wrote on Monday 19 May 2008:

> > Mandriva has a good Live distro, even running from a
> > USB stick. Another tiny one I am using from a USB key
> > is RIPLinux. I didn't try to remaster that one, though.

> Mandriva-Live detects your 3D Hardware,  is downloading&
> installing the right driver on the fly ??
> It would be nice to see  :-)

yes. I just did that (Mandriva 2008.spring) I don't know if 
they download it or if they "cache" the drivers locally on 
the CD, but you boot the LiveCD and you have 3D (OK, it's 
quite long to boot). And when you install you still have 
3D.

I'll try OSG ASAP

bye

Zoltán





-- 
 


Zoltan

http://sourceforge.net/projects/zsim


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


Re: [osg-users] Operating Systems + Applications -> Application Systems

2008-05-19 Thread Jan Ciger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Markus Hein wrote:
> Remastereing an existing Live-CD works good if it contains the current
> packages and if you only want to create ONE conrete ISO for your needs,
> but if you want to create daily ISO's than I'm afraid you will not save
> much time.
> 

Then I think we are not speaking about the same thing. Of course, if I
was to rebuild isos daily, I would look for something else. However,
that is not the issue for me - the whole point of making a live CD is to
give it away at conferences or to students and such. That doesn't mean
it has to be 100% current. Thus the rebuilding issue is moot and I can
live with 6months old Knoppix. The Kanotix you pointed out is even older
than that, despite being released in January.

> really? typically you want boot the classroom with stuff  "per session",
> I mean: different courses - different ISO's . . .

This is not what I have seen - most university labs have stuff for
different courses pre-installed in a pre-made image made for the given
term based on the course requirements, e.g. with Ghost or something
similar. Dealing with isos for different courses looks like a big
hassle, especially when most of the software the different courses need
is common - compilers, editors, OS, etc.

Not to mention that this doesn't work for Windows - most of the labs are
either Windows-only or dual booting in more enlightened places. So you
would still need Ghost for the Windows part, doubling the workload for
the admins. Not fun if you have to deal with labs with 50+ PCs each.

> Why not have  more than one Session/ ISO on the Terminalserver machine ?
> Only reboot the clients and start them as a
> 
> Presentation  ,Simulator ,Scientific-Lab, Office Pool etc. etc.   The
> Server-PC has a set of  ISO's, all of them created in some minutes. If
> you like you can build all sessions nigthly from your configfiles.

See above - that it is possible to do doesn't mean it is also practical.

> Mandriva-Live detects your 3D Hardware,  is downloading& installing the
> right driver on the fly ??
> It would be nice to see  :-)

I didn't try the live one recently, if I remember right, they ship the
DKMS source modules and build either Nvidia or ATI depending on what was
detected on boot.

> 
> Yes, I also like the Live-Session in  "developer config", building my
> own osg, but in most cases you like to install&run it without osg knowledge.

Well, but the point was to make a CD *with* OSG, no? Usually you do it
either for developers or to demo a specific app, so OSG knowledge is
somehow assumed.

Regards,

Jan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFIMe19n11XseNj94gRAsZZAKCpqapbXFo3AKo6ve8ThZVTZyt+FACgy4xh
2/l1iDeRAf/kCfxqpibPZvw=
=w+8h
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] PSSM segfaulting in cull()?

2008-05-19 Thread Alejandro Segovia
Hello List,

I'm having a hard time using PSSM (or anything besides ShadowTexture for
that matter) to add shadows to my scene.

I've got some initialization code inspired in the osgshadow example, which
seems to work fine when I pass the --NVidea parameter, but when I try the
very same technique in my code, it just crashes inside the PSSM's cull()
method.

This is the backtrace I get from the core dump:

#0  0xb6f961c9 in osgShadow::ParallelSplitShadowMap::cull ()
   from /usr/local/OpenSceneGraph/2.2.0/lib/libosgShadow.so.25
#1  0xb6f87656 in osgShadow::ShadowTechnique::traverse ()
   from /usr/local/OpenSceneGraph/2.2.0/lib/libosgShadow.so.25
#2  0xb6f8e7c0 in osgShadow::ShadowedScene::traverse ()
   from /usr/local/OpenSceneGraph/2.2.0/lib/libosgShadow.so.25
#3  0xb6d38196 in osgUtil::CullVisitor::apply ()
   from /usr/local/OpenSceneGraph/2.2.0/lib/libosgUtil.so.25
#4  0xb6f8eb11 in osgShadow::ShadowedScene::accept ()
   from /usr/local/OpenSceneGraph/2.2.0/lib/libosgShadow.so.25
#5  0xb726fa84 in osg::Group::traverse ()
   from /usr/local/OpenSceneGraph/2.2.0/lib/libosg.so.25
#6  0xb6d38196 in osgUtil::CullVisitor::apply ()
   from /usr/local/OpenSceneGraph/2.2.0/lib/libosgUtil.so.25
#7  0xb727095f in osg::Group::accept ()
   from /usr/local/OpenSceneGraph/2.2.0/lib/libosg.so.25
#8  0xb6dc89f7 in osgUtil::SceneView::cullStage ()
   from /usr/local/OpenSceneGraph/2.2.0/lib/libosgUtil.so.25
#9  0xb6dc7cd6 in osgUtil::SceneView::cull ()
   from /usr/local/OpenSceneGraph/2.2.0/lib/libosgUtil.so.25
#10 0xb6a596ef in Canvas::customEvent (this=0x80c4780,
event=0x80deb60) at Canvas.cpp:200

Canvas is just a custom class derived from QGLWidget.

This is the initialization code I'm using, please note the ShadowedScene
node is not the root of the scene graph.

osg::ref_ptr shadowTech =
  new osgShadow::ParallelSplitShadowMap(NULL, 3);
  shadowTech->setTextureResolution(1024);
  shadowTech->setMinNearDistanceForSplits(0);
  shadowTech->setMaxFarDistance(0);
  shadowTech->setMoveVCamBehindRCamFactor(0);
  double polyoffsetfactor = 10.0f; //-0.02;
  double polyoffsetunit = 20.0f; //1.0;
  shadowTech->setPolygonOffset(osg::Vec2(polyoffsetfactor,polyoffsetunit));

  _shadowNode = new osgShadow::ShadowedScene();
  _shadowNode->setShadowTechnique(shadowTech.get());

  _shadowNode->setCastsShadowTraversalMask(0x2|0x8);
  _shadowNode->setReceivesShadowTraversalMask(0x1|0x8);

I'm also using SceneView objects to hold the camera information such as the
projection and modelview matrices. There are two lights in the scene and
only one object (a floor).

Thanks in advance,
Alejandro Segovia.-

-- 
[EMAIL PROTECTED]
http://varrojo.linuxuruguay.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Operating Systems + Applications -> Application Systems

2008-05-19 Thread Markus Hein

Hi Jan,

Jan Ciger schrieb:

classic Live-CD remastering  sounds for me like a time consuming and 
unflexible approach, but it could work.





I do not see why inflexible - there are actually automated tools for
this today. Boot the image, change what you need and have the scripts
build you a new image with your customizations in already.
the debian live-helper tools build your ISO from a debian repository 
(you can run you own repository if you like). It works like with the 
package updating mechanism. Once the files are chached locally, 
building  the ISO takes only  some minutes. You have all the security 
fixes and a current, consistent system.


The config-file for lh_config is the place where you can configure what 
configuration you want to build.


Remastereing an existing Live-CD works good if it contains the current 
packages and if you only want to create ONE conrete ISO for your needs, 
but if you want to create daily ISO's than I'm afraid you will not save 
much time.






Well, the whole idea of a usb stick or Live CD is to be able to use it
even when the infrastructure is not in place. If you have a PXE server
running and all this, you can as well have the machines pre-installed
for what you need ...

Typically, I want to give the CD for the students to use at home, in the
classroom I rarely need these kludges.



really? typically you want boot the classroom with stuff  "per session", 
I mean: different courses - different ISO's . . .


Why not have  more than one Session/ ISO on the Terminalserver machine ? 
Only reboot the clients and start them as a


Presentation  ,Simulator ,Scientific-Lab, Office Pool etc. etc.   The 
Server-PC has a set of  ISO's, all of them created in some minutes. If 
you like you can build all sessions nigthly from your configfiles.





Mandriva has a good Live distro, even running from a USB stick. Another
tiny one I am using from a USB key is RIPLinux. I didn't try to remaster
that one, though.

Of course, almost nobody ships current OSG, but that you will probably
want to compile anyway, together with your app for the target system.


Mandriva-Live detects your 3D Hardware,  is downloading& installing the 
right driver on the fly ??

It would be nice to see  :-)

Yes, I also like the Live-Session in  "developer config", building my 
own osg, but in most cases you like to install&run it without osg knowledge.


best regards, Markus


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


Re: [osg-users] NodeTrackedManipulator constantly segfaulting

2008-05-19 Thread Robert Osfield
On Mon, May 19, 2008 at 8:23 PM, Alejandro Segovia
<[EMAIL PROTECTED]> wrote:
> Any ideas?

No ideas.

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


Re: [osg-users] Operating Systems + Applications -> Application Systems

2008-05-19 Thread Jan Ciger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Markus Hein wrote:

> 
> classic Live-CD remastering  sounds for me like a time consuming and 
> unflexible approach, but it could work.
> 

I do not see why inflexible - there are actually automated tools for
this today. Boot the image, change what you need and have the scripts
build you a new image with your customizations in already.

> Today, a lot of improvements exists to build such systems automated in
> minutes. The Debian "live-helper" Package contains  the  tools you will
> need to let your machine build a "Application System" for the target
> machine , containing the latest Packages, Security Fixes etc. from a
> repository.
> 
> A good starting point:   http://debian-live.alioth.debian.org/
> 
> After installing the "live-helper" package you can start to build a
> live-image from a config file.

Sounds interesting, will have a look.

> If you need to boot multiple machines for your "classroom application" :
> 
> Instead of booting machines via CDROM, USB-Stick etc. it is faster to
> boot the  clients in your classroom via PXE NetBoot from a
> terminalserver application on a server machine. The terminalserver is
> automatically configuring the clients in the network and  feeds them
> with the application. Different machines can boot  the same ISO with
> machine specific boot options so there are a lot of possibillities.
> Under my testings, such a system was up and running after 2-3 minutes. 
> Booting directly into the application can be done, so that osgViewer
> worked fullscreen after pressing the power button.
> btw.  there  was 4 different machines in my  "classroom", and it also
> worked fine even if the clients PC Hardware  in use  was different

Well, the whole idea of a usb stick or Live CD is to be able to use it
even when the infrastructure is not in place. If you have a PXE server
running and all this, you can as well have the machines pre-installed
for what you need ...

Typically, I want to give the CD for the students to use at home, in the
classroom I rarely need these kludges.

> About the Major Distri's:
> I have tested a lot of them but I really don't  know about existing 
> Major Linux Distrubution which supports all needed steps for the
> creation of  such a  OSG-Application System out of the box, but the
> interested user can find a lot of some really useful implementation  in
> smaller  Linux  distris.

Mandriva has a good Live distro, even running from a USB stick. Another
tiny one I am using from a USB key is RIPLinux. I didn't try to remaster
that one, though.

Of course, almost nobody ships current OSG, but that you will probably
want to compile anyway, together with your app for the target system.

> You can just   test how such concrete ISO works if you like . It
> contains the OS, KDE, OSG, Zero Ballistics Game Beta-Test and working
> graphics hardware detection, 3D driver download. It installs the 3D
> driver on the fly .
> 
> http://debian.tu-bs.de/project/kanotix/preview/kanotix-ng-zb.iso
> http://debian.tu-bs.de/project/kanotix/preview/kanotix-ng-zb.iso.md5

Interesting, will have a look.

Regards,

Jan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFIMdUEn11XseNj94gRAlq2AJ4gYSbUVqXRsXZaDaUpwnQ1aJtUlgCg64km
B66NXPyV/HqeIx0N0Fn2qJI=
=V7db
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] NodeTrackedManipulator constantly segfaulting

2008-05-19 Thread Alejandro Segovia
Actually, I've discovered that the tilting effect in NodeTrackerManipulator
is actually a "pulsing" effect. For some reason NodeTrackerManipulator never
seems to "settle" at a position, providing a view matrix for even frames and
another one for uneven frames.

Here is a printout of two consecutive view matrices (obtained calling
getInverseMatrix):

[1.00,0.00,0.00,0.00]
[0.00,1.00,0.00,0.00]
[0.00,0.00,1.00,0.00]
[0.00,0.00,-106.750074,1.00]

[1.00,0.00,0.00,0.00]
[0.00,1.00,0.00,0.00]
[0.00,0.00,1.00,0.00]
[0.00,0.00,-117.486391,1.00]

This pattern just goes on forever and makes the view pulse. I'm sure this is
a problem in the way I'm setting up this manipulator, since this problem is
not present in the osgsimulation example, but I'm not making too many
changes to the default, just setting the node to track, the trackermode to
NODE_CENTER and the rotationmode to TRACKBALL.

I'm also using a custom coordinate frame callback, which (always) returns an
identity with the second and third row exchanged.

Any ideas?

Thanks in advance,
Alejandro.-

On Mon, May 19, 2008 at 3:53 PM, Alejandro Segovia <[EMAIL PROTECTED]>
wrote:

> Hi Robert, thanks for you quick reply :)
>
> I ran the osgsimulation example not only did it run fine, but also gave me
> an idea of what I was doing wrong. I was calling setNode instead of
> setTrackNode, so the manipulator was trying to track an invalid node and
> that caused the segfault.
>
> Perhaps a sanity check is missing in the NodeTrackerManipulator to make
> sure the user called setTrackNode at least once before trying to track the
> node.
>
> Now I'm getting some black tilting when rendering, but the osgsimulator
> runs fine, so it must be something in the way I do my rendering.
>
> Thanks for your help,
> Alejandro.-
>
> On Mon, May 19, 2008 at 1:47 PM, Robert Osfield <[EMAIL PROTECTED]>
> wrote:
>
>> Hi Alejandro,
>>
>> I haven't heard of NodeTrackManipulator sef faulting before, so this
>> is a new one, I'd guess it would most likely be a usage issue, but
>> perhaps you have uncovered a bug in the manipulator.
>>
>> First thing to test would be to run the osgsimulation example to see
>> if that runs stable.
>>
>> Next up provide a stack trace, without there is nothing anybody else
>> can help you with.
>>
>> Robert.
>>
>> On Mon, May 19, 2008 at 5:27 PM, Alejandro Segovia
>> <[EMAIL PROTECTED]> wrote:
>> > Hello all,
>> >
>> > I'm trying to use osgGA::NodeTrackerManipulator to try to get a camera
>> to
>> > follow a node as it moves around the scene, with very little success.
>> After
>> > setting up the manipulator and setting the node it has to track, I get a
>> > segmentation fault when I call the getInverseMatrix method on it in
>> order to
>> > adjust the camera. The crash is inside the computeNodeCenterAndRotation
>> > method in getInverseMatrix.
>> >
>> > Aside from setting the node to be tracked, I'm using all default values
>> for
>> > the NodeTrackerManipulator.
>> >
>> > Has anybody experienced the same problem or know what I could possibly
>> be
>> > doing wrong?
>> >
>> > I'm running OSG 2.2 on Debian Linux.
>> >
>> > Thanks in advance,
>> > Alejandro.-
>> >
>> > --
>> > [EMAIL PROTECTED]
>> > http://varrojo.linuxuruguay.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
>>
>
>
>
> --
> [EMAIL PROTECTED]
> http://varrojo.linuxuruguay.org
>



-- 
[EMAIL PROTECTED]
http://varrojo.linuxuruguay.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Operating Systems + Applications -> Application Systems

2008-05-19 Thread Markus Hein

Hi All,


 Perhaps OSG users are already doing this,
or are considering.

The purpose of this email is to throw this possibility out there, and
to get feedback from OSG users who might find such an means of
distribution useful.  There are members of the community far better
placed to actual go ahead and implement such a system too so I'd be
nice to hear from guys with more knowledge on the OS side.  There are
already tools for creating Live CD's, I haven't played with them yet,
but perhaps in a few years I'll have time to...


After watching this interesting thread  I just want to add some ideas:

Jan wrote:

I had a decent experience with remastering Knoppix:
http://www.knoppix.net/wiki/Knoppix_Remastering_Howto

However, there you have to hack the boot scripts to install the
proprietary driver correctly - Knoppix doesn't ship them.
  


classic Live-CD remastering  sounds for me like a time consuming and  
unflexible approach, but it could work.




Today, a lot of improvements exists to build such systems automated in 
minutes. The Debian "live-helper" Package contains  the  tools you will 
need to let your machine build a "Application System" for the target 
machine , containing the latest Packages, Security Fixes etc. from a 
repository.


A good starting point:   http://debian-live.alioth.debian.org/

After installing the "live-helper" package you can start to build a 
live-image from a config file.




This is something I've been think about too - just giving training classes a
USB disk with the OS, dev tools, data, the OSG and the rest of the training
materials required for the course. My theory is that it'd avoid the need to
help users jump through all the platform specific hurdles required to get the
OSG built and running...  It would of course introduce other issues...


If you need to boot multiple machines for your "classroom application" :

Instead of booting machines via CDROM, USB-Stick etc. it is faster to 
boot the  clients in your classroom via PXE NetBoot from a 
terminalserver application on a server machine. The terminalserver is 
automatically configuring the clients in the network and  feeds them 
with the application. Different machines can boot  the same ISO with 
machine specific boot options so there are a lot of possibillities.
Under my testings, such a system was up and running after 2-3 minutes.  
Booting directly into the application can be done, so that osgViewer 
worked fullscreen after pressing the power button.
btw.  there  was 4 different machines in my  "classroom", and it also 
worked fine even if the clients PC Hardware  in use  was different


About the Major Distri's:
I have tested a lot of them but I really don't  know about existing  
Major Linux Distrubution which supports all needed steps for the 
creation of  such a  OSG-Application System out of the box, but the 
interested user can find a lot of some really useful implementation  in 
smaller  Linux  distris.



The preview versions, of  the KANOTIX  distri  have already done what we 
talk about .
It is a general linux distribution with support for 64 bit systems, not 
specialised on graphics only, but it contains all that interesting 
helpers for our needs.


You can just   test how such concrete ISO works if you like . It 
contains the OS, KDE, OSG, Zero Ballistics Game Beta-Test and working 
graphics hardware detection, 3D driver download. It installs the 3D 
driver on the fly .


http://debian.tu-bs.de/project/kanotix/preview/kanotix-ng-zb.iso
http://debian.tu-bs.de/project/kanotix/preview/kanotix-ng-zb.iso.md5

After booting the cd you can start the game from the menu.

It shows how it works ,  if you  need help just visit  irc channel #kanotix

Today, this distribution contains the latest OSG Release Packages and 
some osg-apps on their own repository and  will be a good base to build 
this special type of applications.





regards, Markus


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


Re: [osg-users] NodeTrackedManipulator constantly segfaulting

2008-05-19 Thread Alejandro Segovia
Hi Robert, thanks for you quick reply :)

I ran the osgsimulation example not only did it run fine, but also gave me
an idea of what I was doing wrong. I was calling setNode instead of
setTrackNode, so the manipulator was trying to track an invalid node and
that caused the segfault.

Perhaps a sanity check is missing in the NodeTrackerManipulator to make sure
the user called setTrackNode at least once before trying to track the node.

Now I'm getting some black tilting when rendering, but the osgsimulator runs
fine, so it must be something in the way I do my rendering.

Thanks for your help,
Alejandro.-

On Mon, May 19, 2008 at 1:47 PM, Robert Osfield <[EMAIL PROTECTED]>
wrote:

> Hi Alejandro,
>
> I haven't heard of NodeTrackManipulator sef faulting before, so this
> is a new one, I'd guess it would most likely be a usage issue, but
> perhaps you have uncovered a bug in the manipulator.
>
> First thing to test would be to run the osgsimulation example to see
> if that runs stable.
>
> Next up provide a stack trace, without there is nothing anybody else
> can help you with.
>
> Robert.
>
> On Mon, May 19, 2008 at 5:27 PM, Alejandro Segovia
> <[EMAIL PROTECTED]> wrote:
> > Hello all,
> >
> > I'm trying to use osgGA::NodeTrackerManipulator to try to get a camera to
> > follow a node as it moves around the scene, with very little success.
> After
> > setting up the manipulator and setting the node it has to track, I get a
> > segmentation fault when I call the getInverseMatrix method on it in order
> to
> > adjust the camera. The crash is inside the computeNodeCenterAndRotation
> > method in getInverseMatrix.
> >
> > Aside from setting the node to be tracked, I'm using all default values
> for
> > the NodeTrackerManipulator.
> >
> > Has anybody experienced the same problem or know what I could possibly be
> > doing wrong?
> >
> > I'm running OSG 2.2 on Debian Linux.
> >
> > Thanks in advance,
> > Alejandro.-
> >
> > --
> > [EMAIL PROTECTED]
> > http://varrojo.linuxuruguay.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
>



-- 
[EMAIL PROTECTED]
http://varrojo.linuxuruguay.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Uniform value getting overwritten in shader.

2008-05-19 Thread Dorosky, Christopher G
Mike,

Run with osgviewer, the glsl example works.

The problem with that example is that it creates new geometry and
doesn't reuse it.

My model has two parents (MatrixTransforms), A & B. These parents share
the same shader, but have different statesets.

"A" has a stateset setting a new uniform MYCOLOR to (1.0, 0.0, 0.0,
1.0);
"B" has a stateset setting a new uniform MYCOLOR to (0.0, 0.0, 1.0,
1.0);

The scene graph adds A first, then B. They are translated from each
other.
The shader simply sets the gl_FragColor to MYCOLOR.

If "A" and "B" are in the scene, both are RED.
If only "B" is in the scene, it is BLUE.

It appears that the uniform gets trampled. I was careful to make
explicitly new uniforms each time.
Running a different set of geometry under the shader, and setting a new
MYCOLOR to GREEN works.

The problem seems to be with reusing geometry, but applying different
statesets to the parents. The uniform value of the object during its
draw under the second parent retains its first parent value.

For what it's worth, this worked fine under whatever pre-1.2 version we
were using.

Chris





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike
Weiblen
Sent: Thursday, May 15, 2008 2:13 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Uniform value getting overwritten in shader.

Does the glsl_simple.osg example datafile work for you?  It demonstrates
one shader w/ different values for the "Color1" uniform.
-- mew



On Thu, May 15, 2008 at 2:01 PM, Dorosky, Christopher G
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am having problems with a uniform value getting trumped in a shader.
>
> Here is most of the shader fragment:
>
> ___
>
>  os << "\nuniform bool PreMultipliedAlpha;\n";  os << "uniform vec4 
> FogUniform;\n";
>  os << "   vec3 FogColor;\n";
>os << "   vec3 FogUniformColor;\n";
>
>os << "void main()\n";
>os << "{\n";
>
>os << "   if (PreMultipliedAlpha) {\n";
>os << "  FogColor = gl_Fog.color.rgb * gl_FragColor.a;\n";
>if (aFogType == EXP2_FOG)
>os << "  FogUniformColor = FogUniform.rgb *
> gl_FragColor.a;\n";
>os << "   } else {\n";
>os << "  FogColor = gl_Fog.color.rgb;\n";
>if (aFogType == EXP2_FOG)
>os << "  FogUniformColor = FogUniform.rgb;\n";
>os << "   }\n";
> __
>
> Now, to use it, I have this code...
>
> osg::Group *Topgroup = new osg::Group; // real code this has more 
> stuff attached.
> osg::Group *group = new osg::Group;
>
> Topgroup->addChild(group);
>
> // modelA and modelB groups already exist.
>
> modelA->getOrCreateStateSet()->getOrCreateUniform("PreMultipliedAlpha"
> modelA->,
> osg::Uniform::BOOL)->set(true);
> modelB->getOrCreateStateSet()->getOrCreateUniform("PreMultipliedAlpha"
> modelB->,
> osg::Uniform::BOOL)->set(false);
>
>
> group->addChild(modelA);
> group->addChild(modelB);
>
> // Then the Fragment shader is added to the Topgroup node.
> // Didn't include code here because it is long, and it works as shown 
> below.
>
> Here is what happens.
> When modelA and modelB are added to the group as shown above, the 
> uniform is always false.
>
> If I comment out the line:
> //group->addChild(modelB);
>
> Then I have the uniform set correctly to true.
>
> Reinserting that line, and commenting out
> group->addChild(modelA);
> Has the uniform set correctly to false.
>
> It seems that I can't have both models added with different uniform 
> values without one trumping the other.
>
> Am I doing something wrong or is this a bug?
>
> I've tried more obvious things conditional on the uniform value, like 
> making the model red or blue with same results.
>
> OSG 1.2, Windows XP
>
> Thanks,
>
> Chris
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
> org
>



--
Mike Weiblen -- Austin Texas USA -- http://mew.cx/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] virtual shadow

2008-05-19 Thread Zoltán
Hello,

for my flight simulator in R-C mode, I have a panorama 
scenery (a 6-faced cube with images) and the aircraft 
flying inside. The faces are far away and the pilot is 
always in the centre.

The ground is a horizontal plane at z=0, but I have no 
visual altitude reference, and a shadow would be very 
helpful.

BUT: I have no geometry there !!! (since it's a panorama 
scenery)

So my idea was to make a projection of the aircraft on the 
z=0 plane, paint it black (or gray) translucent, and 
integrate it into the scene as if it were any "normal" 
geometry. But the only projection I found in OSG is per a 
camera 
(camera->setProjectionMatrix(osg::Matrix::ortho2D(...));

Is it possible to make a node out of one camera image and 
render this node on another camera ?
How would I paint the whole projection gray translucent ?
Is there a more simple way ?
Any suggestions ?


Thanks

Zoltán


-- 
 


Zoltan

http://sourceforge.net/projects/zsim


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


Re: [osg-users] NodeTrackedManipulator constantly segfaulting

2008-05-19 Thread Robert Osfield
Hi Alejandro,

I haven't heard of NodeTrackManipulator sef faulting before, so this
is a new one, I'd guess it would most likely be a usage issue, but
perhaps you have uncovered a bug in the manipulator.

First thing to test would be to run the osgsimulation example to see
if that runs stable.

Next up provide a stack trace, without there is nothing anybody else
can help you with.

Robert.

On Mon, May 19, 2008 at 5:27 PM, Alejandro Segovia
<[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I'm trying to use osgGA::NodeTrackerManipulator to try to get a camera to
> follow a node as it moves around the scene, with very little success. After
> setting up the manipulator and setting the node it has to track, I get a
> segmentation fault when I call the getInverseMatrix method on it in order to
> adjust the camera. The crash is inside the computeNodeCenterAndRotation
> method in getInverseMatrix.
>
> Aside from setting the node to be tracked, I'm using all default values for
> the NodeTrackerManipulator.
>
> Has anybody experienced the same problem or know what I could possibly be
> doing wrong?
>
> I'm running OSG 2.2 on Debian Linux.
>
> Thanks in advance,
> Alejandro.-
>
> --
> [EMAIL PROTECTED]
> http://varrojo.linuxuruguay.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] Purpose of DataSetLayer in GDAL plugin

2008-05-19 Thread Jason Beverage
Hi Robert,

I was looking through the GDAL plugin and saw the DatasetLayer class and was
wondering what it is intended for. I'm looking through the code and can't
get my head around it.

I was trying to think of a way to have VPB generate a paged database that
simply references the orginal imagey as a source file and generates the
scene graph on the fly (like ossimPlanet or ArcGlobe) and thought that
DatasetLayer might be of use in performing that type of task.

Thanks!

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


[osg-users] NodeTrackedManipulator constantly segfaulting

2008-05-19 Thread Alejandro Segovia
Hello all,

I'm trying to use osgGA::NodeTrackerManipulator to try to get a camera to
follow a node as it moves around the scene, with very little success. After
setting up the manipulator and setting the node it has to track, I get a
segmentation fault when I call the getInverseMatrix method on it in order to
adjust the camera. The crash is inside the computeNodeCenterAndRotation
method in getInverseMatrix.

Aside from setting the node to be tracked, I'm using all default values for
the NodeTrackerManipulator.

Has anybody experienced the same problem or know what I could possibly be
doing wrong?

I'm running OSG 2.2 on Debian Linux.

Thanks in advance,
Alejandro.-

-- 
[EMAIL PROTECTED]
http://varrojo.linuxuruguay.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to make the camera rotation not "spin" when it is dragged quickly with the mouse

2008-05-19 Thread Robert Osfield
Hi Matthew,

If you release the mouse button while moving the mouse then the
Trackball and TerrainManipulators will interpret this as a throw.   So
users find this really natural, others find it awkward to get used to.

Right now there isn't any options built into the these manipulators
for switching off the the throw support, but you are welcome to add a
bool member and a set/get method to switch on/off this feature.  You
do this by subclassing, or just modifying the core classes and then
sending me the changes for inclusion into the core OSG.

Robert.

On Mon, May 19, 2008 at 4:21 PM,  <[EMAIL PROTECTED]> wrote:
> Hi, using the default camera mouse controls.  Left click and drag rotates
> the camera, but you can kinda "throw" the camera if you drag and release
> quickly.  Can I get some advice on how to prevent that?  I guess can anyone
> tell me which "GUIEventHandler" does the viewer default to…is it Trackball?
> Finally to enhance camera mouse control I would expect to subclass from one
> of the MatrixManipulator classes and override the controls…sound right?
>
> ___
> 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] FBO and AntiAliasing

2008-05-19 Thread Robert Osfield
On Mon, May 19, 2008 at 3:01 PM, hesicong2006 <[EMAIL PROTECTED]> wrote:
> Hi, Robert,
> As you know, I'm current doing volume rendering work. Currently I've done a
> GPU voxelization using FBO but the sawtooth of the images greatly affects
> the result. So I'm very expecting FBO with anti-aliasing and please let know
> where the code with OSG1.2? I can have a reference. Thanks.

Have a look at the osg-submissions archives.   However, for volume
rendering I wouldn't have thought using anti-aliasing would be the
right approach - rather change the sampling of the 3D texture you use
in rendering.

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


Re: [osg-users] Strategy for implementing dynamic vertical exaggeration of VPB models.

2008-05-19 Thread Robert Osfield
Hi John,

VPB builds purely static databases that are stored on disk to be later
loaded by the runtime that visualizes it.  Since you want to vary the
vertical exaggeration at runtime then the solution will have to be
entirely on the OSG side, VPB actually has little to do with the
actual implementation.

In terms of implementation the route to take is write a
Registry::ReadFileCallback that is called on the load of each new
subgraph, see include/osgDB/Registry.  Your callback will need to runs
a custom NodeVisitor that modifies the underlying geometries height.
Things that will complicate things are that the osg::Geometry leaves
will be local coordinate frame undernearth an osg::MatrixTransform
that places them in their final geocentric position, so you'll need to
transform the local vertices into world coords, then compute the
height about the ellipsoid, then compute the new position at the same
lat/long but at the new height, then finally transform the point back
into local coords.

If you are building with the VPB --terrain option rather than the
default then you get osgTerrain based tiles, then you'll probably want
a feature that hasn't been written yet...

Robert.


On Mon, May 19, 2008 at 2:14 PM, John Vidar Larring
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> When creating globes with VPB one can use the option -v (vertical
> multiplier) to set permanent vertical exaggeration for the generated model.
> However, in our software solution the user must be able to set vertical
> exaggeration from the GUI (i.e. dynamically alter vertical exaggeration).
>
> What I'd like to know is: What would be a good strategy for implementing
> dynamic vertical exaggeration of VPB models?
>
> I am pretty new to OSG, so I would greatly appreciate any suggestions that
> could help to start me of in the right direction.
>
> My preliminary gut feeling is that the following strategy could possibly
> work:
>
> - Implement a node visitor to find all geode's in model.
> - For each geode, traverse each child drawable with an ArrayVisitor.
> - In the ArrayVisitor recalculate each vertex based on earth radius from
> CoordinateSystemNode/EllipsoidModel, distance from vertex to earth center,
> and vertical multiplier.
>
> Is this feasible? Are there any better strategies to follow? Performance
> issues/considerations when operation on ~50GB PagedLOD databases.
>
> Any hint and suggestions are very much appreciated. If anyone has example
> code that solves similar problems, I would kiss his/her feet in gratitude:)
> (not literally though;)
>
> Best regards,
> John
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to make the camera rotation not "spin" when it is dragged quickly with the mouse

2008-05-19 Thread Matthew . Little
Hi, using the default camera mouse controls.  Left click and drag
rotates the camera, but you can kinda "throw" the camera if you drag and
release quickly.  Can I get some advice on how to prevent that?  I guess
can anyone tell me which "GUIEventHandler" does the viewer default
to...is it Trackball?  Finally to enhance camera mouse control I would
expect to subclass from one of the MatrixManipulator classes and
override the controls...sound right?

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


Re: [osg-users] Parallel Split Shadow Map (Update)

2008-05-19 Thread Adrian Egli OpenSceneGraph (3D)
this version isn't working, well. so the last version is working. you have
an issue with suse linux. they don't really support glsl shaders. !

2008/5/19 Adrian Egli OpenSceneGraph (3D) <[EMAIL PROTECTED]>:

> please retest
>
>
>
> test with:
> export OSG_Window=""
> osgshadow --pssm --SingleThreaded
>
> i had black texture with set osg window
>
>
>
> 2008/5/19 Zoltán <[EMAIL PROTECTED]>:
>
> Adrian Egli OpenSceneGraph (3D) wrote on Sunday 18 May 2008:
>> > ready to check in. please test
>>
>> Hi Adrian,
>>
>> I downloaded OSG 2.4.0 and replaced the 3 files:
>>
>> osgshadow.cpp
>> ParallelSplitShadowMap
>> ParallelSplitShadowMap.cpp
>>
>> by what you provided. In short, it doesn't work for me :-(
>>
>> The ShadowTexture (--st) is the only shadow technique that
>> works on my system (Linux openSuSE 10.3, ATI-X300 with
>> proprietary fglrx driver), but this worked the same with
>> 2.3.4 (svn)
>>
>> There seems to be a lot of arguments for --pssm, I tried
>> some but they all produce the same : nothing to be seen,
>> and "Warning: detected OpenGL error 'invalid operation'
>> after RenderBin::draw(,)"
>>
>> .../OpenSceneGraph/Data > osgshadow --pssm -2
>> PSSM PolygonOffset: units=0.5 factor=0.5
>> PSSM PolygonOffset: units=0.5 factor=0.5
>> PSSM PolygonOffset: units=0.5 factor=0.5
>> Warning: detected OpenGL error 'invalid operation' after
>> RenderBin::draw(,)
>> Warning: detected OpenGL error 'invalid operation' after
>> RenderBin::draw(,)
>> Warning: detected OpenGL error 'invalid operation' after
>> RenderBin::draw(,)
>> [...]
>> Warning: detected OpenGL error 'invalid operation' after
>> RenderBin::draw(,)
>> Warning: detected OpenGL error 'invalid operation' after
>> RenderBin::draw(,)
>> Warning: detected OpenGL error 'invalid operation' after
>> RenderBin::draw(,)
>> .../OpenSceneGraph/Data >
>>
>> Are there some arguments I should try ?
>>
>>
>> Bye
>>
>> Zoltán
>>
>>
>> --
>>
>> 
>>
>> Zoltan
>>
>> http://sourceforge.net/projects/zsim
>> 
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
>
> --
> 
> Adrian Egli




-- 

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


Re: [osg-users] HUD picking problem

2008-05-19 Thread Alejandro Segovia
Hello David,

I'm by no means an expert in OSG, since I've been using it just for a couple
of months and haven't read the whole code yet, but I do have an application
with picking and can give you some insights from my experience.

hud_camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
> hud_camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
> hud_camera->setViewMatrix(osg::Matrix::identity());
> hud_camera->setClearMask(GL_DEPTH_BUFFER_BIT);
> hud_camera->setRenderOrder(osg::Camera::POST_RENDER);
>
> what does the parameters of the osg::Matrix::ortho2D represent???
>

The parameters set the projection matrix used in the HUD. I guess your world
is displayed using a perspective projection, which basically simulates a 3D
effect on your screen by drawing things that are far away smaller. This
effect is undesired in a HUD, so an Orthogonal is generally used, which does
not deform objects depending on their depth (z) values. The supplied
parameters just set this projection, they are the position and size of your
projection, which in this case starts at (0,0) and ends in (1280-1, 1024-1).


> i can pick always in one of the three objects, never in the second and
> sometimes in the last one
>
> i´ve tried to modify their Z values with no success
>

Z does not play a big role in Orthogonal projections. It may be best to
think about the HUD in 2D.


> the picking is done using a osgUtil::PickVisitor whichg intersects against
> the HUD camera subgraph
>
> osgUtil::PickVisitor pick_visitor(hud_camera->getViewport(),
> hud_camera->getProjectionMatrix(),
>   hud_camera->getViewMatrix(), (float)
> mousex, (float) mousey);
>
> pick_visitor.apply(*(hud_camera.get()));
>
> where mousex and mousey represents the mouse coordinates
>

PickVisitor did not work for me. You should use
osgUtil::LineSegmentIntersector, there is an example on how to use it in the
OSG Examples.

Hope this helps,
Alejandro.-

-- 
[EMAIL PROTECTED]
http://varrojo.linuxuruguay.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] HUD picking problem

2008-05-19 Thread David _

I know this problem has been posted some times, but i can´t find a solution

right now i have a HUD which it´s made by rendering the subgraph of a camera 
node. 

these are the main lines to set the hud camera

hud_camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
hud_camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
hud_camera->setViewMatrix(osg::Matrix::identity());
hud_camera->setClearMask(GL_DEPTH_BUFFER_BIT);
hud_camera->setRenderOrder(osg::Camera::POST_RENDER);

what does the parameters of the osg::Matrix::ortho2D represent???

i can pick always in one of the three objects, never in the second and 
sometimes in the last one

i´ve tried to modify their Z values with no success

the picking is done using a osgUtil::PickVisitor whichg intersects against the 
HUD camera subgraph

osgUtil::PickVisitor pick_visitor(hud_camera->getViewport(), 
hud_camera->getProjectionMatrix(),
  hud_camera->getViewMatrix(), (float) 
mousex, (float) mousey);

pick_visitor.apply(*(hud_camera.get()));

where mousex and mousey represents the mouse coordinates

i´m using OSG 2.2 right now and we´re moving to 2.4 next month

any ideas???

_
Tecnología, moda, motor, viajes,…suscríbete a nuestros boletines para estar 
siempre a la última
Guapos y guapas, clips musicales y estrenos de cine. ___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] vpb/osgdem textures in different layers blending.

2008-05-19 Thread Sewell, Kenneth R Civ USAF AFMC AFRL/RYZW
Oops.  My shader wasn't being loaded properly, fixed that and now the
layers are behaving as expected.

Ken.

-Original Message-

When using vpb or osgdem and using the --layer options, I expected the
layers to be assigned to different texture units.  However when I
generate the terrain the layers seem to be blended 50/50 and stored as
one texture.  Is this a bug or am I not understanding what osgdem is
referring to as a layer?  I'm using OSG 2.4 and VPB svn rev 911.

A simple test case using the OSG-Data:

osgdem --geocentric -o testLayer.ive -l 5 --layer 0 --whole-globe
land_shallow_topo_2048.jpg --layer 1 --whole-globe
whitemetal_diffuse.jpg


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


[osg-users] vpb/osgdem textures in different layers blending.

2008-05-19 Thread Sewell, Kenneth R Civ USAF AFMC AFRL/RYZW

When using vpb or osgdem and using the --layer options, I expected the
layers to be assigned to different texture units.  However when I
generate the terrain the layers seem to be blended 50/50 and stored as
one texture.  Is this a bug or am I not understanding what osgdem is
referring to as a layer?  I'm using OSG 2.4 and VPB svn rev 911.

A simple test case using the OSG-Data:

osgdem --geocentric -o testLayer.ive -l 5 --layer 0 --whole-globe
land_shallow_topo_2048.jpg --layer 1 --whole-globe
whitemetal_diffuse.jpg


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


Re: [osg-users] FBO and AntiAliasing

2008-05-19 Thread hesicong2006




Hi, Robert,
As you know, I'm current doing volume rendering work. Currently I've
done a GPU voxelization using FBO but the sawtooth of the images
greatly affects the result. So I'm very expecting FBO with
anti-aliasing and please let know where the code with OSG1.2? I can
have a reference. Thanks.

Robert Osfield wrote:

  Hi Paul,

On Mon, May 19, 2008 at 12:51 PM,  <[EMAIL PROTECTED]> wrote:
  
  

  The OSG's FBO implementation doesn't yet support anti-aliasing, but it
shouldn't be difficult extension to add support for.  I do have this
on my TODO list, just unfortunately quite within grasp as I've been so
swamped with other work.
Robert.
  

Has this been implemented yet in the latest version of OSG?

  
  
Note yet.  There is a submission for adding anti-aliasing to FBO, but
it's written against
OSG-1.2.  I have done a review, but didn't port the work to 2.3.x at
the time as it was non trivial
and I was just swamped with other work.   It's still on my TODO list.
 Feel free to tackle this
yourself if I don't get on to tackling it soon enough.

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

__ Information from ESET NOD32 Antivirus, version of virus signature database 3108 (20080519) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



  




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


[osg-users] Strategy for implementing dynamic vertical exaggeration of VPB models.

2008-05-19 Thread John Vidar Larring

Hi,

When creating globes with VPB one can use the option -v (vertical 
multiplier) to set permanent vertical exaggeration for the generated 
model. However, in our software solution the user must be able to set 
vertical exaggeration from the GUI (i.e. dynamically alter vertical 
exaggeration).


What I'd like to know is: What would be a good strategy for implementing 
dynamic vertical exaggeration of VPB models?


I am pretty new to OSG, so I would greatly appreciate any suggestions 
that could help to start me of in the right direction.


My preliminary gut feeling is that the following strategy could possibly 
work:


- Implement a node visitor to find all geode's in model.
- For each geode, traverse each child drawable with an ArrayVisitor.
- In the ArrayVisitor recalculate each vertex based on earth radius from 
CoordinateSystemNode/EllipsoidModel, distance from vertex to earth 
center, and vertical multiplier.


Is this feasible? Are there any better strategies to follow? Performance 
issues/considerations when operation on ~50GB PagedLOD databases.


Any hint and suggestions are very much appreciated. If anyone has 
example code that solves similar problems, I would kiss his/her feet in 
gratitude:) (not literally though;)


Best regards,
John

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

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


Re: [osg-users] FBO and AntiAliasing

2008-05-19 Thread Robert Osfield
Hi Paul,

On Mon, May 19, 2008 at 12:51 PM,  <[EMAIL PROTECTED]> wrote:
>>The OSG's FBO implementation doesn't yet support anti-aliasing, but it
>>shouldn't be difficult extension to add support for.  I do have this
>>on my TODO list, just unfortunately quite within grasp as I've been so
>>swamped with other work.
>>Robert.
> Has this been implemented yet in the latest version of OSG?

Note yet.  There is a submission for adding anti-aliasing to FBO, but
it's written against
OSG-1.2.  I have done a review, but didn't port the work to 2.3.x at
the time as it was non trivial
and I was just swamped with other work.   It's still on my TODO list.
 Feel free to tackle this
yourself if I don't get on to tackling it soon enough.

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


[osg-users] FBO and AntiAliasing

2008-05-19 Thread paul1492
>From: Robert Osfield robert.osfield at gmail.com 
>Date: Fri Jan 25 01:47:48 PST 2008 
>
>Hi Stephane,
>The OSG's FBO implementation doesn't yet support anti-aliasing, but it
>shouldn't be difficult extension to add support for.  I do have this
>on my TODO list, just unfortunately quite within grasp as I've been so
>swamped with other work.
>Robert.
Has this been implemented yet in the latest version of OSG?
Paul P.


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


Re: [osg-users] Hints on Python wrappers (was osgPython (SWIG) 2.2.0)

2008-05-19 Thread Gerwin de Haan
Luigi, here's my delayed reply to OSG/Python wrapping:

Your questions:
1) opinions on which route to go for wrapping, (know there are wrappers
based on introspection, I' ve tried to use them but found few examples)
g>As a python user (and a bit maintainer) of osgswig I am biased towards the
swigged approach :-)  SWIG is mature and has many great documented features
that help transfer C++ (templated) functionality to several target
languages. The main drawback when swigging OSG is the use of nested classes,
which are not directly supported by swig and requires laborious
intervention. Yes, this is high maintenance but it seems to allow the
transfer of most OSG features and good tweaking for more target languages.
As far as python is concerned, a combined effort of ctypes, swig and OSG
introspection could make the OSG wrappings much better/faster, but the
taming of these beasts way out of my league.

2) In osgswig there is a working  example of a python pick handler that
subclass from osgGA.GUIEventHandler.
I would like  to subclass from osg.NodeVisitor without success.
Is this something doable in osgswig or in other wrappers?
g> Using osgswig you can subclass in python from a C++ class, but you will
need to enable the directors swig feature for that class. For now, we only
enabled this for some classes only because it has quite a code overhead.

3) are there plans for supporting wrappers into core osg?
g> see Robert's reply

4) is osg-users the right place to write for issues regarding script
language wrappers?
g> I really wasn't paying that much attention to the OSG mailing list, but
now I've seen this I will in future. If you have really osgswig/python
specific questions you might want to contact osgswig developers (me,
megamillerzoid or hartmut directly) at this stage of development. Thanks for
the patches you have been sending.

In my daily work on prototyping VR interaction I use osgswig quite often
(from python), and I do work on the osgswig project a bit. I'm still
thinking of building a checklist, comparisons and examples to get osg
wrapping solutions coordinated for various languages. First, I plan to
extend especially on basic osg examples from python, so input and requests
are welcome.

regards,
Gerwin de Haan


On Thu, Apr 3, 2008 at 2:09 PM, Luigi Calori <[EMAIL PROTECTED]> wrote:

> Sorry, got no answer, so try to repost
>
>
> I' m interested in using OSG from Python or other scripted languages.
> After some  searching and testing I found osgswig and tried that path
> (still unsure which is the best script wrapper for OSG to use)
>
> Using osgswig I found some bugs and added some nodes that were missing.
> (posted to tehe main site at
> http://code.google.com/p/osgswig/issues/detail?id=5 )
>
> My questions:
>
> 1) opinions on which route to go for wrapping, (know there are wrappers
> based on introspection, I' ve tried to use them but found few examples)
> 2) In osgswig there is a working  example of a python pick handler that
> subclass from osgGA.GUIEventHandler.
> I would like  to subclass from osg.NodeVisitor without success.
> Is this something doable in osgswig or in other wrappers?
> 3) are there plans for supporting wrappers into core osg?
> 4) is osg-users the right place to write for issues regarding script
> language wrappers?
>
>
> Thanks in advance
>
> Luigi Calori
>
>
>
> ___
> 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] Parallel Split Shadow Map (Update)

2008-05-19 Thread Zoltán
Adrian Egli OpenSceneGraph (3D) wrote on Monday 19 May 2008:
> please retest
>
> test with:
> export OSG_Window=""
> osgshadow --pssm --SingleThreaded

same... I'll try with another Linux. Will take some time

bye

Zoltán



> 2008/5/19 Zoltán <[EMAIL PROTECTED]>:
> > Adrian Egli wrote on Sunday 18 May 2008:
> > > ready to check in. please test
> >
> > Hi Adrian,
> >
> > I downloaded OSG 2.4.0 and replaced the 3 files:
> >
> > osgshadow.cpp
> > ParallelSplitShadowMap
> > ParallelSplitShadowMap.cpp
> >
> > by what you provided. In short, it doesn't work for me
> > :-(
> >
> > The ShadowTexture (--st) is the only shadow technique
> > that works on my system (Linux openSuSE 10.3, ATI-X300
> > with proprietary fglrx driver), but this worked the
> > same with 2.3.4 (svn)
> >
> > There seems to be a lot of arguments for --pssm, I
> > tried some but they all produce the same : nothing to
> > be seen, and "Warning: detected OpenGL error 'invalid
> > operation' after RenderBin::draw(,)"
> >
> > .../OpenSceneGraph/Data > osgshadow --pssm -2
> > PSSM PolygonOffset: units=0.5 factor=0.5
> > PSSM PolygonOffset: units=0.5 factor=0.5
> > PSSM PolygonOffset: units=0.5 factor=0.5
> > Warning: detected OpenGL error 'invalid operation'
> > after RenderBin::draw(,)
> > Warning: detected OpenGL error 'invalid operation'
> > after RenderBin::draw(,)
> > Warning: detected OpenGL error 'invalid operation'
> > after RenderBin::draw(,)
> > [...]
> > Warning: detected OpenGL error 'invalid operation'
> > after RenderBin::draw(,)
> > Warning: detected OpenGL error 'invalid operation'
> > after RenderBin::draw(,)
> > Warning: detected OpenGL error 'invalid operation'
> > after RenderBin::draw(,)
> > .../OpenSceneGraph/Data >
> >
> > Are there some arguments I should try ?
> >
> >
> > Bye
> >
> > Zoltán
> >
> >
> > --
> >
> > 
> >
> > Zoltan
> >
> > http://sourceforge.net/projects/zsim
> > 
> >
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> >openscenegraph.org



-- 
 


Zoltan

http://sourceforge.net/projects/zsim


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


Re: [osg-users] Parallel Split Shadow Map (Update)

2008-05-19 Thread Zoltán
Zoltán wrote on Monday 19 May 2008:
> Adrian Egli wrote on Sunday 18 May 2008:
> > ready to check in. please test

> The ShadowTexture (--st) is the only shadow technique
> that works on my system (Linux openSuSE 10.3, ATI-X300
> with proprietary fglrx driver), but this worked the same
> with 2.3.4 (svn)

Well, not exactly true: --ssm sort of does something, but 
not what it should. I can see the glider and the base, some 
shadows moving, but not where they should.

.../OpenSceneGraph/Data > osgshadow --ssm --base glider.osg
glLinkProgram "" FAILED
Program "" infolog:
Fragment shader(s) failed to link, no vertex shader(s) 
defined.
Fragment Shader not supported by HW
.../OpenSceneGraph/Data >

Hum, no shader in hardware ... let's see:

.../OpenSceneGraph/Data > glxinfo | grep -i shader
GL_ARB_fragment_program, GL_ARB_fragment_shader, 
GL_ARB_multisample,
GL_ARB_point_parameters, GL_ARB_point_sprite, 
GL_ARB_shader_objects,
GL_ARB_vertex_program, GL_ARB_vertex_shader, 
GL_ARB_window_pos,
GL_ATI_draw_buffers, GL_ATI_envmap_bumpmap, 
GL_ATI_fragment_shader,
.../OpenSceneGraph/Data >  

So there is some shader in the HW, but not recognised. Apart 
from the obvious (ATI drivers suck) I don't know what to 
think of this.

> .../OpenSceneGraph/Data > osgshadow --pssm -2
> PSSM PolygonOffset: units=0.5 factor=0.5
> PSSM PolygonOffset: units=0.5 factor=0.5
> PSSM PolygonOffset: units=0.5 factor=0.5

BTW, this proves that I tested the 2.4.0 OSG, because these 
values are different in 2.3.4

bye

Zoltán





-- 
 


Zoltan

http://sourceforge.net/projects/zsim


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


Re: [osg-users] traverse

2008-05-19 Thread Robert Osfield
Hi Valery,

Geode's are meant to be leaf nodes, so are no intended to have
children other than drawables - which is why traverse() isn't
appropriate in this case.

If you do want to customize behaviour then could implement override
the Geode::accept() method, this is called before the
NodeVisitor::apply() as it's the actual accept than does the call to
the NodeVisitor.  You'll still need to set the number of children
containing children to make sure the traversal gets down to your leaf
node.

Robert.

On Mon, May 19, 2008 at 11:27 AM, Валерий Быков <[EMAIL PROTECTED]> wrote:
> Thanks a lot for explanation to you and Артём, but my class is derived from
> Geode, therefore osgUtil::UpdateVisitor::apply(Geode&) calls
> handle_geode_callbacks(osg::Geode& geode), which doesn't call traverse
> anyway:
> // should we traverse just in case a subclass of Geode adds children?? Won't
> for now as
> // Geode's aren't designed to have children.
> // traverse(geode);
>
> As I see Geode hasn't chance to update itself without callback?
>
> P.S. Of cource, simple class can resolve this problem:
> class CallTraverseCallback : public osg::NodeCallback
> {
> public:
> void operator() (Node* node, NodeVisitor* nv)
> {
> node->traverse(*nv);
> }
> };
> But is there way without callbacks?
> ___
> 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] traverse

2008-05-19 Thread Валерий Быков
Thanks a lot for explanation to you and Артём, but my class is derived
from Geode, therefore osgUtil::UpdateVisitor::apply(Geode&) calls
handle_geode_callbacks(osg::Geode& geode), which doesn't call traverse
anyway:
// should we traverse just in case a subclass of Geode adds children??
Won't for now as
// Geode's aren't designed to have children.
// traverse(geode);

As I see Geode hasn't chance to update itself without callback?

P.S. Of cource, simple class can resolve this problem:
class CallTraverseCallback : public osg::NodeCallback
{
public:
void operator() (Node* node, NodeVisitor* nv)
{
node->traverse(*nv);
}
};
But is there way without callbacks?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Parallel Split Shadow Map (Update)

2008-05-19 Thread Zoltán
Adrian Egli OpenSceneGraph (3D) wrote on Sunday 18 May 2008:
> ready to check in. please test

Hi Adrian,

I downloaded OSG 2.4.0 and replaced the 3 files:

osgshadow.cpp
ParallelSplitShadowMap
ParallelSplitShadowMap.cpp

by what you provided. In short, it doesn't work for me :-(

The ShadowTexture (--st) is the only shadow technique that 
works on my system (Linux openSuSE 10.3, ATI-X300 with 
proprietary fglrx driver), but this worked the same with 
2.3.4 (svn)

There seems to be a lot of arguments for --pssm, I tried 
some but they all produce the same : nothing to be seen, 
and "Warning: detected OpenGL error 'invalid operation' 
after RenderBin::draw(,)"

.../OpenSceneGraph/Data > osgshadow --pssm -2
PSSM PolygonOffset: units=0.5 factor=0.5
PSSM PolygonOffset: units=0.5 factor=0.5
PSSM PolygonOffset: units=0.5 factor=0.5
Warning: detected OpenGL error 'invalid operation' after 
RenderBin::draw(,)
Warning: detected OpenGL error 'invalid operation' after 
RenderBin::draw(,)
Warning: detected OpenGL error 'invalid operation' after 
RenderBin::draw(,)
[...]
Warning: detected OpenGL error 'invalid operation' after 
RenderBin::draw(,)
Warning: detected OpenGL error 'invalid operation' after 
RenderBin::draw(,)
Warning: detected OpenGL error 'invalid operation' after 
RenderBin::draw(,)
.../OpenSceneGraph/Data >

Are there some arguments I should try ?


Bye

Zoltán


-- 
 


Zoltan

http://sourceforge.net/projects/zsim


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


Re: [osg-users] traverse

2008-05-19 Thread Robert Osfield
Opps...

2008/5/19 Robert Osfield <[EMAIL PROTECTED]>:
> For an example of this have a look at the implementation of the Switch
> node - src/osg/Switch.cpp.

I'm meant to write osg::Sequence, rather than Switch, so you'll want to look
at src/osg/Sequence.cpp.

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


Re: [osg-users] traverse

2008-05-19 Thread Robert Osfield
HI Valary,

The update and event traversals both have use a mechanism that stops
traversal when no children of a node contain
any nodes that requiring traversing.   This feature is key to maintain
good performance on very large databases, without
it the update/event traversals would take dozens of milliseconds for
big databases and totally kill performance.

To enable traversal of only subgraphs that actually need it the scene
graph keeps an index of number of children requiring traversal - as
you've already spotted.  In the case of setting a update callback this
index will be automatically updated, along with all the parents in the
parent path - making sure that the node with the callback will be
called.  If you have a node that implements its own custom traverse
method then you'll need to set the index directly in the constructor.
For an example of this have a look at the implementation of the Switch
node - src/osg/Switch.cpp.

Robert.

On Mon, May 19, 2008 at 10:00 AM, Валерий Быков <[EMAIL PROTECTED]> wrote:
> Hi all.
>
> I have a question why Node::traverse(NodeVisitor&) doesn't called with
> NodeVisitor of type UPDATE_VISITOR?
> I have a class derived from Geode and I remoulded function
> traverse(NodeVisitor&) for some update operations:
>
> void MyClass::traverse(osg::NodeVisitor& nv)
> {
> if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
> {
> // Do smth
> }
> Geode::traverse(nv);
> }
>
> And I use osgViewer::Viewer for showing scene. But this function traverse is
> never called with updateVisitor, because in
> osgUtil::UpdateVisitor::apply(Geode&) only callbacks is proceeded, but not
> traverse.
>
> And what about deriving from other classes and using traverse for update
> operations then we can see that in osgUtil::UpdateVisitor::apply(Node&)
> calls function void handle_callbacks_and_traverse(osg::Node& node) which
> calls callback if presented and check
> node.getNumChildrenRequiringUpdateTraversal()>0 and calls traverse(node) in
> this case. But as I can see in osg/src/Node.cpp,
> _numChildrenRequiringUpdateTraversal changes in two cases: when update
> callback is attached and when void
> Node::setNumChildrenRequiringUpdateTraversal(unsigned int num) is called.
> But I want to not use update callback, so, I must call
> setNumChildrenRequiringUpdateTraversal for it. I would like to remould
> function addParent for it, but this function is not virtual, so, I really
> confused how to use traverse for update operations.
>
> Best regards,
> Valery
> ___
> 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] traverse

2008-05-19 Thread Art Tevs
Hi Валерa,

As in my case, I always do just call setNumChildrenRequiringUpdateTraversal(1) 
somewhere during the initialization phase and this do force using update 
traversals.
Just call it in the constructor of your MyClass class and this is fine.

Best regards,
Art (Артём)


--- Валерий Быков <[EMAIL PROTECTED]> schrieb am Mo, 19.5.2008:

> Von: Валерий Быков <[EMAIL PROTECTED]>
> Betreff: [osg-users] traverse
> An: osg-users@lists.openscenegraph.org
> Datum: Montag, 19. Mai 2008, 11:00
> Hi all.
> 
> I have a question why Node::traverse(NodeVisitor&)
> doesn't called with
> NodeVisitor of type UPDATE_VISITOR?
> I have a class derived from Geode and I remoulded function
> traverse(NodeVisitor&) for some update operations:
> 
> void MyClass::traverse(osg::NodeVisitor& nv)
> {
>   if (nv.getVisitorType() ==
> osg::NodeVisitor::UPDATE_VISITOR)
>   {
>   // Do smth
>   }
>   Geode::traverse(nv);
> }
> 
> And I use osgViewer::Viewer for showing scene. But this
> function
> traverse is never called with updateVisitor, because in
> osgUtil::UpdateVisitor::apply(Geode&) only callbacks is
> proceeded, but
> not traverse.
> 
> And what about deriving from other classes and using
> traverse for update
> operations then we can see that in
> osgUtil::UpdateVisitor::apply(Node&)
> calls function void
> handle_callbacks_and_traverse(osg::Node& node) which
> calls callback if presented and check
> node.getNumChildrenRequiringUpdateTraversal()>0 and
> calls traverse(node)
> in this case. But as I can see in osg/src/Node.cpp,
> _numChildrenRequiringUpdateTraversal changes in two cases:
> when update
> callback is attached and when void
> Node::setNumChildrenRequiringUpdateTraversal(unsigned int
> num) is
> called. But I want to not use update callback, so, I must
> call
> setNumChildrenRequiringUpdateTraversal for it. I would like
> to remould
> function addParent for it, but this function is not
> virtual, so, I
> really confused how to use traverse for update operations.
> 
> Best regards,
> Valery___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


  __
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] traverse

2008-05-19 Thread Валерий Быков
Hi all.

I have a question why Node::traverse(NodeVisitor&) doesn't called with
NodeVisitor of type UPDATE_VISITOR?
I have a class derived from Geode and I remoulded function
traverse(NodeVisitor&) for some update operations:

void MyClass::traverse(osg::NodeVisitor& nv)
{
if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
{
// Do smth
}
Geode::traverse(nv);
}

And I use osgViewer::Viewer for showing scene. But this function
traverse is never called with updateVisitor, because in
osgUtil::UpdateVisitor::apply(Geode&) only callbacks is proceeded, but
not traverse.

And what about deriving from other classes and using traverse for update
operations then we can see that in osgUtil::UpdateVisitor::apply(Node&)
calls function void handle_callbacks_and_traverse(osg::Node& node) which
calls callback if presented and check
node.getNumChildrenRequiringUpdateTraversal()>0 and calls traverse(node)
in this case. But as I can see in osg/src/Node.cpp,
_numChildrenRequiringUpdateTraversal changes in two cases: when update
callback is attached and when void
Node::setNumChildrenRequiringUpdateTraversal(unsigned int num) is
called. But I want to not use update callback, so, I must call
setNumChildrenRequiringUpdateTraversal for it. I would like to remould
function addParent for it, but this function is not virtual, so, I
really confused how to use traverse for update operations.

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