[osg-users] Freeze in ThreadPerCamera

2008-11-06 Thread Johannes Nilsson
Hi,

I have had some problems with OSG freezing when running in
ThreadPerCamera mode. My problems
were resolved with two changes:

The first one changes the order of the startRenderingBarrier and the
reset of the endDynamicDrawBlock.
This makes sure that the reset of the _endDynamicDrawBlock is done
before the rendering begins.

The second change creates a scope around the mutex and prevents the
threads from holding the
mutex when waiting on the block.  Also it might be a good idea to
change the name of the class
TheadSafeQueue.

Does these changes make sense?

/Johannes



osgViewer/ViewerBase.cpp:
void ViewerBase::renderingTraversals()
{
...
  if (_endDynamicDrawBlock.valid()) _endDynamicDrawBlock-reset();

  // dispatch the the rendering threads
  if (_startRenderingBarrier.valid()) _startRenderingBarrier-block();
...
}

osgViewer/Renderer.cpp:
osgUtil::SceneView* Renderer::TheadSafeQueue::takeFront()
{
  if (_queue.empty()) _block.block();

  {
OpenThreads::ScopedLockOpenThreads::Mutex lock(_mutex);
if (_queue.empty()) return 0;
osgUtil::SceneView* front = _queue.front();
_queue.pop_front();
if (_queue.empty()) _block.set(false);
return front;
  }
}
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgOcean(?)

2008-11-06 Thread Robert Osfield
Hi Kim,

Great screenshots, really makes one want to go an play with the full sim :-)

On Wed, Nov 5, 2008 at 3:42 PM, Kim C Bale [EMAIL PROTECTED] wrote:
 Does anybody have any good examples or pointers on where to start?

The OSG itself has a number of NodeKit's that you could use as a
template, osgParticle/osgTerrain/osgText wouldn't be bad places to
start.

A good NodeKit is self contained, and can easily be integrated to
existing apps by just adding the approach Nodes/State/Drawables, with
the capability of storing all the objects in a .osg file.  In the OSG
you'll find the plugins that extend the .osg format in the
src/osgPlugins/osgParticle, src/osgPlugins/osgTerrain etc directories.

As it looks like others a willing to help out on an osgOcean, perhaps
you could publish everything you have right now warts and all and look
for feedback.

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


Re: [osg-users] Help with Positiong a Camera

2008-11-06 Thread Robert Osfield
Hi Allan,

Do you want use the standard camera manipualators but with a set home
position, or are you looking for completely custom management of the
camera's view position?  If you want the later than you'll want to not
bother with any camera manipualtor and just set the viewer's master
camera's on each frame i.e


  while(!viewer.done())
  {
  viewer.getCamera()-setViewMatrixAsLookAt(eye, center, up);
  viewer.frame();
  }

Wheras to set the home position of camera manipulator you do:

   viewer.getCameraManipulator()-setHomePosition(eye,center,up);

And then to move to the home position call:

   viewer.home();

Robert.

Robert.

On Wed, Nov 5, 2008 at 10:03 PM, Allen [EMAIL PROTECTED] wrote:
 Hi, I'm new to OSG and am in need of assistance with how to position a
 camera in a scene.  I am using OSG 2.6.1 on linux (centos4). Here's my
 setting: 1) I've setup my scene (only one node - terrain). 2) I've setup my
 1 and only 1 camera in my only viewer by calling:
 setProjectionMatrixAsPerspective ( 30.0f, static_castdouble ( width )
 /static_castdouble ( height ), 1.0f, 1.0f );
 3) I CAN add a slave camera  translate it in ONLY the x  y planes.  I can
 scale too but this still is not what I'm looking for.

 My Question:  How to I get my Camera to be positioned at a certain spot over
 my terrain and looking at a particular spot on my terrain?  For the life of
 me, I can't figure this out  Ive been pouring through dozens of examples,
 the API, and trying all sorts of experiments with EVERY camera method I can
 find, view  viewer method I can find that might help me.

 Thx everyone for your help.  I really appreciate this.

 --
 Sincerely, Allen

 ___
 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] Mail Headers

2008-11-06 Thread Robert Osfield
Hi Joakim,

I have just looked at the admin pages for
[EMAIL PROTECTED] and can't any controls specifically
for List-Id.  The closest mention I can find is:

Should messages from this mailing list include the RFC 2369  (i.e.
List-*) headers? Yes is highly recommended.

To which the setting is Yes, so in theory mailman should be adding
standard compliant List-* headers.   Is this a bug in Mailman?  I
really couldn't say, while I I am the admin on mailing list I don't
have have the expertise to comment deeply about mailman or even access
to the low levels of the server to go change mailman version - it's
Dreamhost that maintain the actual server that runs mailman.

Robert.

On Wed, Nov 5, 2008 at 11:54 PM, Joakim Simonsson [EMAIL PROTECTED] wrote:

 Sorry for another mail that does not contain anything about OSG.

 But I can't resist since the word headers was mentioned in the Migrating
 to Forum thread.


 After the OSG mailinglist changed from [EMAIL PROTECTED] to
 osg-users@lists.openscenegraph.org my mail client has complained a bit
 (Opera mail-client). I think I've tracked it down in the mail header.

 The reason is that the List-Id:-element in the header does not comply with
 RFC standards.

 The current header looks like this:

 List-Id: OpenSceneGraph Users osg-users-openscenegraph.org

 But I think it should be changed to this:

 List-Id: OpenSceneGraph Users osg-users.lists.openscenegraph.org

 I.e. the format: list-label . list-id-namespace

 Where, list-label: a list label   (osg-users)
   list-id-namespace:  domain-name(lists.openscenegraph.org)


 The disadvantage to change the List-Id is:

 1. Some sofisticated mail-clients could recognize the list as a different
 list.


 The advantages is:

 1. It will comply to RFC 2919
   http://www.ietf.org/rfc/rfc2919.txt

 2. My (and potentially others) mail-clients (that strictly utilize RFC
 standards) will be more happy.



 Comments?




 --
 Joakim Simonsson
 ___
 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] Need explanation about a strange behaviour with RenderBin

2008-11-06 Thread Robert Osfield
Hi Sukender,

My guess is that the problem is not related to the bin management,
rather missing vertex colour or vertex normals on some of the
geometry.  If it's not this then perhaps you have transparency issues.

Robert.

On Thu, Nov 6, 2008 at 12:34 AM, Sukender [EMAIL PROTECTED] wrote:
 Hi,

 I found a strange behavior, and I would like someone to explain, if possible.
 In an .osg model (exported from Blender) the rendering_hint OPAQUE_BIN 
 line in some StateSets causes my model to be lit in a funky way. It is 
 sometimes correctly lit, sometimes not (looks like diffuse got away). In my 
 app, I have:
 - a pStateset-setRenderBinDetails(11,RenderBin) used to render HUD 
 components,
 - and a pStateset-setRenderBinDetails(-1, RenderBin) elsewhere for my sky 
 sphere.

 But if I change OPAQUE_BIN to DEFAULT_BIN, then my model is correctly 
 lit...
 Can someone explains what happened?
 Thanks.

 Sincerely,

 --
 Sukender
 ___
 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] A Windows binary version of OSG 2.6.x available?

2008-11-06 Thread Holger Krumm
Dear all,

I am sincerely looking into this promising API. I want to evaluate the
loading of VRML files and just wanted to make a quick check.
On the project's download page I saw a line Windows pending for
the binary package. Because I am not very experienced in that, can
anybody point me to a download location for the binary package?
Or can someone provide me with a binary build?

Best regards and thanks for the support here!

Holger
___

Holger Krumm
Product Engineer Test  Experiment Software
Product Management

dSPACE GmbH  Tel.:  +49 5251 1638-1851
Technologiepark 25   Fax:   +49 5251 66529
33100 Paderborn  http://www.dspace.de
Germany  mailto:[EMAIL PROTECTED]
___



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


Re: [osg-users] osgOcean(?)

2008-11-06 Thread Roman Grigoriev
Hi Paul!
I'd like to help. 
I you share us your peace of code It will be good starting point.
Thanx in advance
Roman


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Pocock
Sent: Thursday, November 06, 2008 4:04 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgOcean(?)

Hi Kim, I was working on something similiar in osg - at this stage only 
comprising an ocean simulator using vertex displacement in the shader.
Would be happy to collaborate in some way on an open source library





On Wed, 2008-11-05 at 15:42 +, Kim C Bale wrote:
 I’m working on an EU funded research project aimed at surveying and 
 visualizing underwater archaeological sites. As part of the grant 
 we’ve been tasked with developing a sort of rudimentary submarine 
 simulator designed to allow the general public to explore underwater 
 archaeological sites firsthand (reference screenshots attached).
 
  
 
 One of the final deliverables of this work package is to release all 
 the graphical effects that went into making the simulator into an open 
 source library so that others may use our work for future underwater 
 rendering projects. Our aim was to do this in the form of a library 
 for the OSG, since we used it to develop the simulator.
 
  
 
 I’ve now reached a stage where I am ready to start thinking about how 
 to untangle the big heap of spaghetti that is my code and turn it into 
 something that might be of use to someone.
 
  
 
 So, I was wondering what would be the best way to go about this. The 
 code comprises of a range of effects such as god-rays, particle 
 systems for floating particulate matter, seabed silt and bubbles, many 
 shader effects (single and multipass) and an FFT ocean simulation.
 
  
 
 I think what would be most useful to me is to see a nodekit that does 
 something similar and see how it is structured so that I can get a 
 good idea of how to bring all of this code together in a useable form.
 
  
 
 Does anybody have any good examples or pointers on where to start?
 
  
 
 Regards,
 
  
 
 Kim.
 
  
 
  
 
  
 
  
 
 
 **
 *** To view the terms under which this email is 
 distributed, please go to 
 http://www.hull.ac.uk/legal/email_disclaimer.html
 **
 *** ___ 
 osg-users mailing list osg-users@lists.openscenegraph.org 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
 org

IMPORTANT: This email remains the property of the Australian Defence 
Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 
1914.  If you have received this email in error, you are requested to contact 
the sender and delete the email.




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


Re: [osg-users] Character animation in OSG

2008-11-06 Thread Jan Ciger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Cedric,

Cedric Pinson wrote:
 You are right, but it's not the job of osgAnimation to make this
 assumption, osgAnimation
 interpolate bewteen keyframes. The optimization of key is the
 responsiblity of the exporter
 instead. In the osg exporter i bake everything without optimization yet,
 that's why it produces
 a big amount of data. To work quickly i just exported all baked animation.
 If you want you can just put one key for a channel or two with 40
 seconds between them.
 So it's not a blocker. But in the futur you could want to separate each
 channel like PosX PosY PosZ
 because sometimes it vary only on one value and you can save space like
 espacialy if you have to bake
 animation.

OK. My concern is not so much optimization (osgAnimation compressing the
keyframes), but the fact that the library can deal with sparse keyframes
for some bone and will correctly interpolate between them. If it can do
that, despite of the current naive exporter, then fine, but I didn't see
the timestamp/offset anywhere in the exported animation. How does it work?

 So those 3 elements can be splitted in different file, and in animtk it
 was like that before, the .osg is just a container of those three elements.

OK, that is what I suspected too.

 There is no framerate, you specify your keyframes in seconds so more
 your put keyframes
 in a short range of time and better the resolution is.

Sorry, but that is *NOT* acceptable. That is related to the issue with
the keyframes above. You need to allow to either specify a duration of
the animation or a frame rate. You cannot rely on the density of the
keyframes to do this - that would require that every animation has keys
even for frames where nothing is moving, just to maintain the framerate.
That is extremely inefficient. Also, conversions from one framerate to
another would be extremely difficult, requiring resampling and
re-interpolation of possibly thousands of keys.

The way to go is to say:

duration 30
time 0 bone 1 x y z qx qy qz qw
time 15 bone 1 x y z qx qy qz qw
time 17 bone 1 x y z qx qy qz qw


With just three keys I have fully specified the animation, without any
implicit assumption about the duration or framerate. Moreover, there is
no need to maintain a long stream of interpolated keyframes anywhere -
the animation engine still needs to interpolate between them in real
time, so why not exploit this for storing the animations too. With your
approach I would need 30 keys (assuming one key/second) - 10x more data.

Your naive approach will simply not scale once you have to deal with
many animations coming from different sources with different framerates
(mocap, hand-animated, procedurally generated, different project, online
repositories, etc.). You cannot assume that everything will pass through
a converter that will normalize the framerate and pre-calculate the
interpolated keys for you - that is just impractical and costly.

Also, I have noticed that you have included scale keys. If you want only
rigid bones (the most common case, one rarely models something like the
Gummi bears), then you can drop both scale and translation. The
quaternions/rotation matrices/rotation vectors are enough, together with
the binding pose of the skeleton. You just apply the transformations
recursively from the root of the hierarchy each time. That allows a very
compact representation.

   
 the format stored is VertexGroup.
 For a geometry you have a set of VertexGroup, a vertex group is a list
 of 'id of the vertex' and its 'weight'.
 The name of vertex group identify the target typically the bone. Using
 this format is generic. For example
 if you want to extend the mesh, like adding new vertexes, you can add a
 group for them and give it the name
 to the new bone or other elements that could influence those vertexes.
 Then rebuild
 the association on the fly. I choiced this format for genericity it's
 easier to manipulate, but i know sometime it's less readable in
 the osg file.

I am not concerned about readability of the osg files - those files are
intended to be machine readable, not necessarily human readable.
However, the amount of memory and the efficiency of manipulation of the
data is a problem - do realize that a practical scenario can have
2000-3000 characters visible and animated at any given moment. I have
done this with osgCal before and it worked, even with software skinning.

 
 This is a detail, though, but it leads to long lists of vertices that
 are duplicated several times, for each bone affecting the vertex. A more
 usual way is to have a vertex id followed by a list: bone id weight bone
 id weight ... That allows to have the long list only once. A
 pathological worst case would be a mesh where every vertex is affected
 by all bones. With the current format one would have e.g. 2000 vertices
 x 15 bones = 3 vertex entries. With the format I have mentioned, one
 would have only 2000 entries.
   
 It's 

Re: [osg-users] Freeze in ThreadPerCamera

2008-11-06 Thread Robert Osfield
Hi Johannes,

Could you please supply the whole modified file, this can be directly
used with a graphics diff tool to illustrate what changes you've made.

Thanks,
Robert.

On Thu, Nov 6, 2008 at 9:04 AM, Johannes Nilsson
[EMAIL PROTECTED] wrote:
 Hi,

 I have had some problems with OSG freezing when running in
 ThreadPerCamera mode. My problems
 were resolved with two changes:

 The first one changes the order of the startRenderingBarrier and the
 reset of the endDynamicDrawBlock.
 This makes sure that the reset of the _endDynamicDrawBlock is done
 before the rendering begins.

 The second change creates a scope around the mutex and prevents the
 threads from holding the
 mutex when waiting on the block.  Also it might be a good idea to
 change the name of the class
 TheadSafeQueue.

 Does these changes make sense?

 /Johannes



 osgViewer/ViewerBase.cpp:
 void ViewerBase::renderingTraversals()
 {
 ...
  if (_endDynamicDrawBlock.valid()) _endDynamicDrawBlock-reset();

  // dispatch the the rendering threads
  if (_startRenderingBarrier.valid()) _startRenderingBarrier-block();
 ...
 }

 osgViewer/Renderer.cpp:
 osgUtil::SceneView* Renderer::TheadSafeQueue::takeFront()
 {
  if (_queue.empty()) _block.block();

  {
OpenThreads::ScopedLockOpenThreads::Mutex lock(_mutex);
if (_queue.empty()) return 0;
osgUtil::SceneView* front = _queue.front();
_queue.pop_front();
if (_queue.empty()) _block.set(false);
return front;
  }
 }
 ___
 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] Displaying a scene in the background of a QGraphicsView

2008-11-06 Thread René Molenaar
If the cow shows and the cessna does not, it is probably an optimization
step, like small feature culling.

2008/11/5 Yvon Halbwachs [EMAIL PROTECTED]

 Hi everybody,

 I managed to use osg in a Qt QGraphicsView with the information that Eric
 Zeremba and Rene Molenaar posted some weeks ago. I still have some troubles
 though... Things work fine when I display the cow.osg scene from the
 OpenSceneGraph example files, but nothing is displayed when I use
 cessna.osg. The only way to display it is to enable display lists (it is
 set to false by default).

 Anybody has a clue about what's going on?

 Yvon



 ___
 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] A Windows binary version of OSG 2.6.x available?

2008-11-06 Thread Robert Osfield
Hi Holger,

On Thu, Nov 6, 2008 at 9:34 AM, Holger Krumm [EMAIL PROTECTED] wrote:
 Or can someone provide me with a binary build?

I'm afraid no binaries for 2.6.x have been posted to me to upload yet.

If you need binaries you'll need to grab the 2.4 binaries from the
PreviousReleases page:

 http://www.openscenegraph.org/projects/osg/wiki/Downloads/PreviousReleases

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


Re: [osg-users] Need explanation about a strange behaviour with RenderBin

2008-11-06 Thread Sukender
Robert,

Thank you for your answer. I've checked what you pointed. But my exported model:
- Has no coulour array (just a material)
- Has 196 vertex and 196 normals (so probably no missing normals)
- And has no transparency

I really don't understand. Any idea?

Note that I load the model using the cache (ReaderWriter::Options::CACHE_ALL) 
and that I duplicate it (in order to modify it without affecting the cached 
object) by using:
  myGroup = new osg::Group(*loadedCachedModel, osg::CopyOp::DEEP_COPY_OBJECTS | 
osg::CopyOp::DEEP_COPY_NODES);
I also tried DEEP_COPY_AL but that has no effect. Anyway, I'm not sure it is 
related to my problem...

I seen that on top of the geodes, there are MatrixTransforms with a stange 
StateSet { 0xba1 ON } line (Exactly the same in each MatrixTransform), but 
removing it didn't change anything.


If you want, the geode data looks like:
Geode {
  UniqueID Corps_geode
  DataVariance DYNAMIC
  name Corps_geode
  cullingActive TRUE
  num_drawables 1
  Geometry {
StateSet {
  UniqueID Corps_stateset
  DataVariance STATIC
  rendering_hint OPAQUE_BIN
  GL_BLEND OFF
  Material {
DataVariance STATIC
ColorMode OFF
diffuseColor 0.30011921 0.5 0.0 1.0
specularColor 1.0 1.0 1.0 1
emissionColor 0.111620302463 0.186033830047 0.0 1
shininess 24.5960784314
  }
}
VertexArray 196 {...}
NormalBinding PER_VERTEX
NormalArray 196 {...}
PrimitiveSets 2 {...}
  }
}


-- 
Sukender


Le Thu, 06 Nov 2008 10:26:49 +0100, Robert Osfield [EMAIL PROTECTED] a écrit:

 Hi Sukender,

 My guess is that the problem is not related to the bin management,
 rather missing vertex colour or vertex normals on some of the
 geometry.  If it's not this then perhaps you have transparency issues.

 Robert.

 On Thu, Nov 6, 2008 at 12:34 AM, Sukender [EMAIL PROTECTED] wrote:
 Hi,

 I found a strange behavior, and I would like someone to explain, if possible.
 In an .osg model (exported from Blender) the rendering_hint OPAQUE_BIN 
 line in some StateSets causes my model to be lit in a funky way. It is 
 sometimes correctly lit, sometimes not (looks like diffuse got away). In my 
 app, I have:
 - a pStateset-setRenderBinDetails(11,RenderBin) used to render HUD 
 components,
 - and a pStateset-setRenderBinDetails(-1, RenderBin) elsewhere for my sky 
 sphere.

 But if I change OPAQUE_BIN to DEFAULT_BIN, then my model is correctly 
 lit...
 Can someone explains what happened?
 Thanks.

 Sincerely,

 --
 Sukender

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


Re: [osg-users] A Windows binary version of OSG 2.6.x available?

2008-11-06 Thread Simon Hammett
If you want binaries you need to specify which compiler you are using.
I've got 2.7.1 built for vc.Net 2003 but it's a 200Mb zip, without the
examples.
Free to anybody who can provide me somewhere to upload it if anybody else is
using such an old version of vc.

Building yourself is very easy though.

2008/11/6 Holger Krumm [EMAIL PROTECTED]

  Dear all,

 I am sincerely looking into this promising API. I want to evaluate the
 loading of VRML files and just wanted to make a quick check.
 On the project's download page I saw a line „Windows pending for
 the binary package. Because I am not very experienced in that, can
 anybody point me to a download location for the binary package?
 Or can someone provide me with a binary build?

 Best regards and thanks for the support here!

 Holger
 *___*

 *Holger Krumm*
 Product Engineer Test  Experiment Software
 Product Management

 dSPACE GmbH  Tel.:  +49 5251 1638-1851
 Technologiepark 25   Fax:   +49 5251 66529
 33100 Paderborn  *http://www.dspace.de* http://www.dspace.de
 Germany  *mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 *___*




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




-- 
The truth is out there. Usually in header files.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgVTK

2008-11-06 Thread Mathieu MARACHE
Hi,

I'm looking for the osgVTK nodekit that was available some years ago.
If anyone still has it around or any information on where to find
informations on using VTK in an OpenSceneGraph Node that would be
great !

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


Re: [osg-users] my problem with VPB 0.9.9

2008-11-06 Thread Robert Osfield
Hi Logeo,

On Thu, Nov 6, 2008 at 3:01 AM, legeochen [EMAIL PROTECTED] wrote:
 Hi Robert
 Thanks for replying. Sorry for my poor explanation. It happens like this,
 after i execute the command, nothing happened, even crash. I will try figure
 it out, maybe i have some wrong configurations.

Arghghghghghghg.

What commend?? What options do you use?  What output to the command line?

Your emails are almost completely devoid of any useful information.

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


Re: [osg-users] Character animation in OSG

2008-11-06 Thread Cedric Pinson

Hi Jan,

Jan Ciger wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Cedric,

Cedric Pinson wrote:
  

You are right, but it's not the job of osgAnimation to make this
assumption, osgAnimation
interpolate bewteen keyframes. The optimization of key is the
responsiblity of the exporter
instead. In the osg exporter i bake everything without optimization yet,
that's why it produces
a big amount of data. To work quickly i just exported all baked animation.
If you want you can just put one key for a channel or two with 40
seconds between them.
So it's not a blocker. But in the futur you could want to separate each
channel like PosX PosY PosZ
because sometimes it vary only on one value and you can save space like
espacialy if you have to bake
animation.
  


OK. My concern is not so much optimization (osgAnimation compressing the
keyframes), but the fact that the library can deal with sparse keyframes
for some bone and will correctly interpolate between them. If it can do
that, despite of the current naive exporter, then fine, but I didn't see
the timestamp/offset anywhere in the exported animation. How does it work?

  

So those 3 elements can be splitted in different file, and in animtk it
was like that before, the .osg is just a container of those three elements.
  


OK, that is what I suspected too.

  

There is no framerate, you specify your keyframes in seconds so more
your put keyframes
in a short range of time and better the resolution is.
  


Sorry, but that is *NOT* acceptable. That is related to the issue with
the keyframes above. You need to allow to either specify a duration of
the animation or a frame rate. You cannot rely on the density of the
keyframes to do this - that would require that every animation has keys
even for frames where nothing is moving, just to maintain the framerate.
That is extremely inefficient. Also, conversions from one framerate to
another would be extremely difficult, requiring resampling and
re-interpolation of possibly thousands of keys.

The way to go is to say:

duration 30
time 0 bone 1 x y z qx qy qz qw
time 15 bone 1 x y z qx qy qz qw
time 17 bone 1 x y z qx qy qz qw
  

time 0 bone 1 x y z qx qy qz qw
time 15 bone 1 x y z qx qy qz qw
time 17 bone 1 x y z qx qy qz qw


is valid today but will play 17 seconds because duration is last key time - 
first key
I can add a method animation-setDuration(30); then it will be what you want. 
And if you
want it in the osg file there is no problem to add it too.




With just three keys I have fully specified the animation, without any
implicit assumption about the duration or framerate. Moreover, there is
no need to maintain a long stream of interpolated keyframes anywhere -
the animation engine still needs to interpolate between them in real
time, so why not exploit this for storing the animations too. With your
approach I would need 30 keys (assuming one key/second) - 10x more data.

Your naive approach will simply not scale once you have to deal with
many animations coming from different sources with different framerates
(mocap, hand-animated, procedurally generated, different project, online
repositories, etc.). You cannot assume that everything will pass through
a converter that will normalize the framerate and pre-calculate the
interpolated keys for you - that is just impractical and costly.

Also, I have noticed that you have included scale keys. If you want only
rigid bones (the most common case, one rarely models something like the
Gummi bears), then you can drop both scale and translation. The
quaternions/rotation matrices/rotation vectors are enough, together with
the binding pose of the skeleton. You just apply the transformations
recursively from the root of the hierarchy each time. That allows a very
compact representation.

  
I think you did not read the examples code, there is not need to fill 
the time with a lot of keys...

code from osganimationskinning:
   osgAnimation::Animation* anim = new osgAnimation::Animation;
   {
   osgAnimation::QuatKeyframeContainer* keys0 = new 
osgAnimation::QuatKeyframeContainer;

   osg::Quat rotate;
   rotate.makeRotate(osg::PI_2, osg::Vec3(0,0,1));
   keys0-push_back(osgAnimation::QuatKeyframe(0,osg::Quat(0,0,0,1)));
   keys0-push_back(osgAnimation::QuatKeyframe(3,rotate));
   keys0-push_back(osgAnimation::QuatKeyframe(6,rotate));
   osgAnimation::QuatSphericalLinearSampler* sampler = new 
osgAnimation::QuatSphericalLinearSampler;

   sampler-setKeyframeContainer(keys0);
   osgAnimation::AnimationUpdateCallback* cb = 
dynamic_castosgAnimation::AnimationUpdateCallback*(right0-getUpdateCallback());

   cb-setName(right0);
   osgAnimation::QuatSphericalLinearChannel* channel = new 
osgAnimation::QuatSphericalLinearChannel(sampler);

   channel-setName(quaternion);
   channel-setTargetName(right0);
   anim-addChannel(channel);
   }
3 keys for 6 seconds it's what you want isn't it ? and it animate 

[osg-users] Writing dds textures - they're bigger than the originals?

2008-11-06 Thread brettwiesner

Hi,

I'm writing out textures from my models as DDS. The originals are rgb's. 
This is all working however the DDS textures are 3x larger than the 
originals! It seems like the DDS writer will write out images 
differently depending on their pixel format. The osg::Image class has a 
setPixelFormat() method. I'm assuming if I can figure out a good pixel 
format to set the image to then the DDS textures will write out smaller. 
Does anyone have a recommendation?


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


Re: [osg-users] need to port an application from OSG v1.2 (OSG::Producer based) to OSG 2.0 (OsgViewer based)

2008-11-06 Thread Jean-Sébastien Guay

Hi Eric,


hiding the mouse pointer is not supported


osgViewer::GraphicsWindow::useCursor(false) should do that... Though 
you're on Mac so perhaps GraphicsWindowCarbon doesn't work properly?


J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Writing dds textures - they're bigger than the originals?

2008-11-06 Thread David Spilling
Hi Brett,

Shots in the dark:
1)  might the incoming textures be DXT_ compressed, whereas the output is
uncompressed?
2) might the outgoing textures include the mimaps? (DDS can include them)
(not sure you'd get 3x, though)

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


Re: [osg-users] Need explanation about a strange behaviour with RenderBin

2008-11-06 Thread Robert Osfield
Hi Sukender,

Strange artefacts indeed, but I still don't think they are render bin related.

There looks to be an issue with state leakage, such as with my
suggestion of missing vertex attributes, or perhaps now more likely
given the screenshot a driver bug.

What OS/hardware/drivers are you using?  Try other machines if you
have access to them.

Do you have an custom OpenGL code that might be causing problems?

Robert.

On Thu, Nov 6, 2008 at 3:16 PM, Sukender [EMAIL PROTECTED] wrote:
 Hi,

 That becomes stranger and stranger: now that I display another exported 
 model, some of my objects have back face culling problems as the moment the 
 object is added to the scene graph. Moreover, I have a HeightField which has 
 inverted culling on HALF of it! I joined before-after screenshots to this 
 message.
 If anyone has an idea of the problem, please tell me!
 (I use OSG 2.7.1)

 --
 Sukender
 PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


 Le Thu, 06 Nov 2008 12:50:28 +0100, Sukender [EMAIL PROTECTED] a écrit:

 Robert,

 Thank you for your answer. I've checked what you pointed. But my exported 
 model:
 - Has no coulour array (just a material)
 - Has 196 vertex and 196 normals (so probably no missing normals)
 - And has no transparency

 I really don't understand. Any idea?

 Note that I load the model using the cache 
 (ReaderWriter::Options::CACHE_ALL) and that I duplicate it (in order to 
 modify it without affecting the cached object) by using:
   myGroup = new osg::Group(*loadedCachedModel, 
 osg::CopyOp::DEEP_COPY_OBJECTS | osg::CopyOp::DEEP_COPY_NODES);
 I also tried DEEP_COPY_AL but that has no effect. Anyway, I'm not sure it is 
 related to my problem...

 I seen that on top of the geodes, there are MatrixTransforms with a stange 
 StateSet { 0xba1 ON } line (Exactly the same in each MatrixTransform), but 
 removing it didn't change anything.


 If you want, the geode data looks like:
 Geode {
   UniqueID Corps_geode
   DataVariance DYNAMIC
   name Corps_geode
   cullingActive TRUE
   num_drawables 1
   Geometry {
 StateSet {
   UniqueID Corps_stateset
   DataVariance STATIC
   rendering_hint OPAQUE_BIN
   GL_BLEND OFF
   Material {
 DataVariance STATIC
 ColorMode OFF
 diffuseColor 0.30011921 0.5 0.0 1.0
 specularColor 1.0 1.0 1.0 1
 emissionColor 0.111620302463 0.186033830047 0.0 1
 shininess 24.5960784314
   }
 }
 VertexArray 196 {...}
 NormalBinding PER_VERTEX
 NormalArray 196 {...}
 PrimitiveSets 2 {...}
   }
 }

 ___
 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] LWO multitexturing broken

2008-11-06 Thread Marco Jez
Hi everyone!

I've just upgraded OSG from version 2.4 to latest SVN. As a result, I've lost 
multitexturing on all objects imported via the LWO plugin.
According to the SVN log, a change in osgPlugins/lwo/Surface.cpp was committed 
on behalf of Bob Kuehne on 18th June 2008. Reverting that change restores the 
correct behaviour.

Bob, if you're listening, could you please explain the rationale behind your 
patch? The log entry reports added multi-texture support (alpha/trans 
images), but the patch actually *breaks* multitexturing (which was already 
supported before). Furthermore, I can't see how it is supposed to add support 
for TRAN channels.

Cheers,
Marco

No virus found in this outgoing message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.9.0/1771 - Release Date: 06/11/2008 758
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Writing dds textures - they're bigger than theoriginals?

2008-11-06 Thread Tomlinson, Gordon
Mipmaps would generally give you a 4/3 increase. before any compression
is applied
 

Gordon

__
Gordon Tomlinson

Product Manager 3D
Email  : gtomlinson @ overwatch.textron.com
__
(C): (+1) 571-265-2612
(W): (+1) 703-437-7651

Self defence is not a function of learning tricks 
but is a function of how quickly and intensely one 
can arouse one's instinct for survival 
- Master Tambo Tetsura

 
 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David
Spilling
Sent: Thursday, November 06, 2008 10:03 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Writing dds textures - they're bigger than
theoriginals?


Hi Brett,

Shots in the dark:
1)  might the incoming textures be DXT_ compressed, whereas the output
is uncompressed?
2) might the outgoing textures include the mimaps? (DDS can include
them) (not sure you'd get 3x, though)

David


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


Re: [osg-users] Character animation in OSG

2008-11-06 Thread Alberto Luaces
El Jueves 06 Noviembre 2008ES 11:30:49 Jan Ciger escribió:
 Also, I have noticed that you have included scale keys. If you want only
 rigid bones (the most common case, one rarely models something like the
 Gummi bears), then you can drop both scale and translation. The
 quaternions/rotation matrices/rotation vectors are enough, together with
 the binding pose of the skeleton. You just apply the transformations
 recursively from the root of the hierarchy each time. That allows a very
 compact representation.

I think scaling bones is an important feature at least meanwhile a morphing 
system is not available (face gestures, breathing movements, etc)

Regards,

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


[osg-users] Playing Movie on osgWidget::Box

2008-11-06 Thread Ümit Uzun
Hi All,

I have tried to play movie on created canvas by osgWidget::Box class by this
way;

/-CodeSample-/
osg::Image* image = osgDB::readImageFile(video.mov);
osg::ImageStream* imagestream = dynamic_castosg::ImageStream*(image);
if (imagestream) imagestream-play();

osgWidget::Window* box1 = createBox(HBOX, osgWidget::Box::HORIZONTAL,
image);

box1-getBackground()-setColor(1.0f, 0.0f, 0.0f, 0.8f);
box1-attachMoveCallback();

wm-addChild(box1);

// pass the model to the MovieEventHandler so it can pick out
ImageStream's to manipulate.
MovieEventHandler* meh = new MovieEventHandler();
viewer.addEventHandler( meh );

viewer.setSceneData( wm-createParentOrthoCamera() );
viewer.run();
/-CodeSample-/

But I can't see the video frames on the box, the video is playing, I can
hear it voice and console information which is scaling the every frame to
the expected size notify. If I play the gif file on the box instead of
video, it plays the gif file without any error.

I have searched the source code and find that, osgWidget::Widget class's
setImage function using osg::Texture2D function to operate texturing. But in
the movie example I have created Quad with osg::TextureRectangle function to
operate texturing. And it works by using TextureRectange. If when I use
Texture2D the same problem has appeared as this.

Could it be drawback of osgWidget::Widget class setImage function in some
format texturing operation?

Is there anyone who try to play video on Box created by osgWidget?

Best Regards.

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


Re: [osg-users] LWO multitexturing broken

2008-11-06 Thread Robert Osfield
Hi Macro and Bob,

Sorry to hear that this change broke your models Macro.  Would it be
possible for you to post the models?

Note for Bob, could you also post the models that your had issues with
that the changes were meant to address.

We can't go thrashing between fixing some models, breaking others, so
it's pretty important that we have models from both ends of the
spectrum to go about getting a proper fix checked in.

Thanks,
Robert.

On Thu, Nov 6, 2008 at 3:35 PM, Marco Jez [EMAIL PROTECTED] wrote:
 Hi everyone!

 I've just upgraded OSG from version 2.4 to latest SVN. As a result, I've
 lost multitexturing on all objects imported via the LWO plugin.
 According to the SVN log, a change in osgPlugins/lwo/Surface.cpp was
 committed on behalf of Bob Kuehne on 18th June 2008. Reverting that change
 restores the correct behaviour.

 Bob, if you're listening, could you please explain the rationale behind your
 patch? The log entry reports added multi-texture support (alpha/trans
 images), but the patch actually *breaks* multitexturing (which was
 already supported before). Furthermore, I can't see how it is supposed to
 add support for TRAN channels.

 Cheers,
 Marco


 No virus found in this outgoing message.
 Checked by AVG - http://www.avg.com
 Version: 8.0.175 / Virus Database: 270.9.0/1771 - Release Date: 06/11/2008
 758

 ___
 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] Render to texture problem

2008-11-06 Thread Engvall Åsa
Hi!

I want to render the scene to a texture and use the texture in a shader. The 
texture image is saved to file by a postdraw callback, so I can look at it. I'm 
doing something wrong because the texture becomes all gray.
My scene graph looks like this:

RTT camera  root
   | |
   \/
world

The main viewer looks at the root and the shader program is applied to the root 
stateset. Below is a code snippet.

I would be very grateful if somebody could point out what I'm doing wrong.
Thanks in advance,

Åsa Engvall


// Create a scene texture.
osg::Texture2D* texture = new osg::Texture2D;
texture-setResizeNonPowerOfTwoHint(false);
texture-setTextureSize(traits-width, traits-height);
texture-setInternalFormat(GL_RGBA);
texture-setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::NEAREST);
texture-setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::NEAREST);
osg::Image* textureImage = new osg::Image;
textureImage-allocateImage(traits-width, traits-height, 1, GL_RGBA, 
GL_UNSIGNED_BYTE);
texture-setImage(0, textureImage);

// Add program and uniforms to the root's stateset.
osg::StateSet* state = root-getOrCreateStateSet();
state-addUniform(numberOfTimeStepsU);
state-addUniform(timeConstantU);
state-addUniform(frameTimeU);
state-addUniform(sceneTextureU);
state-addUniform(prevModelViewMatrixU);
state-addUniform(prevModelViewProjectionMatrixU);
state-setAttributeAndModes(motionBlurProgram, osg::StateAttribute::ON);
state-setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);

// Create a camera that renders the scene to a texture.
osg::Camera* RTTcamera = new osg::Camera;
RTTcamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);  
RTTcamera-setClearColor(osg::Vec4(1,1,1,1));
RTTcamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
RTTcamera-setViewport(0, 0, traits-width, traits-height);
RTTcamera-setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
RTTcamera-setRenderOrder(osg::Camera::PRE_RENDER);
RTTcamera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
RTTcamera-attach(osg::Camera::COLOR_BUFFER, texture);
RTTcamera-addChild(world);
RTTcamera-attach(osg::Camera::COLOR_BUFFER, textureImage);
RTTcamera-setPostDrawCallback(new ScreenShotCallback(traits-width, 
traits-height, *textureImage, GL_RGB, GL_UNSIGNED_BYTE));


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


Re: [osg-users] BS radius : world coordinate or local coordinate ?

2008-11-06 Thread Vincent Bourdier
Hi,

I make a little Up of this topic for the problem :
If I get the radius of a bounding sphere on a group, all is good.
If I do it on a PAT, the BS radius is very higher. Of course the pat get
children, so it is normal that the radius if 4 times more higher.
But, the big difference is that the BS of the PAT seems to be in *world
scale coordinates. *
I need to divide it by the PAT's scale to have a good radius...

It seems very uncertain, so how can I get the BS radius, for a PAT or a node
?
(these nodes are scaled in real time, so the BS radius have to be computed
depending on it)

Thanks a lot,

Regards,
   Vincent.

2008/10/30 Vincent Bourdier [EMAIL PROTECTED]

 Thanks Grodon.

 :-)

 2008/10/30 Tomlinson, Gordon [EMAIL PROTECTED]

  Hi

 Get bounds is the local coordinates of the node.

 So yes any scale in the tree above the node will need to be factored in if
 you matrices that apply a scale above the node


 *Gordon*

 __
 *Gordon Tomlinson*

 *Product Manager 3D
 **Email * : gtomlinson @ overwatch.textron.com
 __
 *(C): (+1) 571-265-2612
 (W)**: (+1) 703-437-7651*

 Self defence is not a function of learning tricks
 but is a function of how quickly and intensely one
 can arouse one's instinct for survival
 - *Master Tambo Tetsura*



  --
 *From:* [EMAIL PROTECTED] [mailto:
 [EMAIL PROTECTED] *On Behalf Of *Vincent
 Bourdier
 *Sent:* Thursday, October 30, 2008 5:21 AM
 *To:* osg
 *Subject:* [osg-users] BS radius : world coordinate or local coordinate ?

 Hi,

 Just a simple question for you :

 When I get the Radius of a BS of a node, do I get the radius in World
 scale unit ? or is the raduis depending on the scale of the node ?

 for the moment I use : *node-getBound().radius() *
 node-getWorldMatrices()[0].getScale()[0]
 *But I am not sure of the result.*
 *

 Thanks a lot.

 Regards,

   Vincent.

 ___
 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] Need explanation about a strange behaviour with RenderBin

2008-11-06 Thread Sukender
Hi again Robert,

I don't have any custom OpenGL code.
Configuration : Core 2 Duo, integrated chipset (Intel 82945G), Windows XP 32 
bits SP3.
Driver is the factory default one, and I never saw such effets in any other 
app.
The first bug (strange lightning) has been seen on another configuration, but 
not he last one yet (I will test ASAP and inform you).
I'm going to try linking against OSG 2.7.4 (or maybe the wxWidget branch as I 
already compiled half of it), but I think that won't change anything.
The problem may not be render-bin related, but I still don't understand... What 
a strange effect!
Thank you for taking time for this.

-- 
Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


Le Thu, 06 Nov 2008 16:35:17 +0100, Robert Osfield [EMAIL PROTECTED] a écrit:

 Hi Sukender,

 Strange artefacts indeed, but I still don't think they are render bin related.

 There looks to be an issue with state leakage, such as with my
 suggestion of missing vertex attributes, or perhaps now more likely
 given the screenshot a driver bug.

 What OS/hardware/drivers are you using?  Try other machines if you
 have access to them.

 Do you have an custom OpenGL code that might be causing problems?

 Robert.

 On Thu, Nov 6, 2008 at 3:16 PM, Sukender [EMAIL PROTECTED] wrote:
 Hi,

 That becomes stranger and stranger: now that I display another exported 
 model, some of my objects have back face culling problems as the moment the 
 object is added to the scene graph. Moreover, I have a HeightField which has 
 inverted culling on HALF of it! I joined before-after screenshots to this 
 message.
 If anyone has an idea of the problem, please tell me!
 (I use OSG 2.7.1)

 --
 Sukender
 PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


 Le Thu, 06 Nov 2008 12:50:28 +0100, Sukender [EMAIL PROTECTED] a écrit:

 Robert,

 Thank you for your answer. I've checked what you pointed. But my exported 
 model:
 - Has no coulour array (just a material)
 - Has 196 vertex and 196 normals (so probably no missing normals)
 - And has no transparency

 I really don't understand. Any idea?

 Note that I load the model using the cache 
 (ReaderWriter::Options::CACHE_ALL) and that I duplicate it (in order to 
 modify it without affecting the cached object) by using:
   myGroup = new osg::Group(*loadedCachedModel, 
 osg::CopyOp::DEEP_COPY_OBJECTS | osg::CopyOp::DEEP_COPY_NODES);
 I also tried DEEP_COPY_AL but that has no effect. Anyway, I'm not sure it 
 is related to my problem...

 I seen that on top of the geodes, there are MatrixTransforms with a stange 
 StateSet { 0xba1 ON } line (Exactly the same in each MatrixTransform), 
 but removing it didn't change anything.


 If you want, the geode data looks like:
 Geode {
   UniqueID Corps_geode
   DataVariance DYNAMIC
   name Corps_geode
   cullingActive TRUE
   num_drawables 1
   Geometry {
 StateSet {
   UniqueID Corps_stateset
   DataVariance STATIC
   rendering_hint OPAQUE_BIN
   GL_BLEND OFF
   Material {
 DataVariance STATIC
 ColorMode OFF
 diffuseColor 0.30011921 0.5 0.0 1.0
 specularColor 1.0 1.0 1.0 1
 emissionColor 0.111620302463 0.186033830047 0.0 1
 shininess 24.5960784314
   }
 }
 VertexArray 196 {...}
 NormalBinding PER_VERTEX
 NormalArray 196 {...}
 PrimitiveSets 2 {...}
   }
 }

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


Re: [osg-users] Render to texture problem

2008-11-06 Thread Csaba Halász
On Thu, Nov 6, 2008 at 5:16 PM, Engvall Åsa [EMAIL PROTECTED] wrote:

 I want to render the scene to a texture and use the texture in a shader. The
 texture image is saved to file by a postdraw callback, so I can look at it.
 I'm doing something wrong because the texture becomes all gray.

I have the same problem.
To make things worse, I have modified the osgdistortion example and that works.
Unfortunately I was unable to pinpoint the difference between my
application and the working example.
I hope maybe somebody can list known caveats/requirements to using image attach.
FWIW, it works if I don't attach the image, and use readPixels in a
final draw callback. But I assume that is suboptimal (it does cause
significant increase in the draw times).

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


Re: [osg-users] BS radius : world coordinate or local coordinate ?

2008-11-06 Thread Robert Osfield
Hi Vincent,

The bounding sphere of transform is in the coordinate frame of its
parents, the children of transform will be in the transformed
coordinate frame.

Now you may have several transforms on the go at once, so one can't
say that one is local or one is world coordinates unless you know that
you are at the topmost or child below bottom most transform.

Robert.

On Thu, Nov 6, 2008 at 4:18 PM, Vincent Bourdier
[EMAIL PROTECTED] wrote:
 Hi,

 I make a little Up of this topic for the problem :
 If I get the radius of a bounding sphere on a group, all is good.
 If I do it on a PAT, the BS radius is very higher. Of course the pat get
 children, so it is normal that the radius if 4 times more higher.
 But, the big difference is that the BS of the PAT seems to be in world scale
 coordinates.
 I need to divide it by the PAT's scale to have a good radius...

 It seems very uncertain, so how can I get the BS radius, for a PAT or a node
 ?
 (these nodes are scaled in real time, so the BS radius have to be computed
 depending on it)

 Thanks a lot,

 Regards,
Vincent.

 2008/10/30 Vincent Bourdier [EMAIL PROTECTED]

 Thanks Grodon.

 :-)

 2008/10/30 Tomlinson, Gordon [EMAIL PROTECTED]

 Hi

 Get bounds is the local coordinates of the node.

 So yes any scale in the tree above the node will need to be factored in
 if you matrices that apply a scale above the node


 Gordon

 __
 Gordon Tomlinson

 Product Manager 3D
 Email  : gtomlinson @ overwatch.textron.com
 __
 (C): (+1) 571-265-2612
 (W): (+1) 703-437-7651

 Self defence is not a function of learning tricks
 but is a function of how quickly and intensely one
 can arouse one's instinct for survival
 - Master Tambo Tetsura



 
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Vincent
 Bourdier
 Sent: Thursday, October 30, 2008 5:21 AM
 To: osg
 Subject: [osg-users] BS radius : world coordinate or local coordinate ?

 Hi,

 Just a simple question for you :

 When I get the Radius of a BS of a node, do I get the radius in World
 scale unit ? or is the raduis depending on the scale of the node ?

 for the moment I use : node-getBound().radius() *
 node-getWorldMatrices()[0].getScale()[0]
 But I am not sure of the result.


 Thanks a lot.

 Regards,

   Vincent.

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




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


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


Re: [osg-users] Need explanation about a strange behaviour with RenderBin

2008-11-06 Thread Robert Osfield
Hi Sukender,

Intel drivers are known for being rather poor, so it may well just be
driver bug, I would certainly check for updated drivers.  Also get
yourself a cheap Nvidia card an pop it in the machine, you may well
get quite a different experience and will give you a sanity test.

Robert.

On Thu, Nov 6, 2008 at 4:24 PM, Sukender [EMAIL PROTECTED] wrote:
 Hi again Robert,

 I don't have any custom OpenGL code.
 Configuration : Core 2 Duo, integrated chipset (Intel 82945G), Windows XP 32 
 bits SP3.
 Driver is the factory default one, and I never saw such effets in any other 
 app.
 The first bug (strange lightning) has been seen on another configuration, but 
 not he last one yet (I will test ASAP and inform you).
 I'm going to try linking against OSG 2.7.4 (or maybe the wxWidget branch as I 
 already compiled half of it), but I think that won't change anything.
 The problem may not be render-bin related, but I still don't understand... 
 What a strange effect!
 Thank you for taking time for this.

 --
 Sukender
 PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


 Le Thu, 06 Nov 2008 16:35:17 +0100, Robert Osfield [EMAIL PROTECTED] a 
 écrit:

 Hi Sukender,

 Strange artefacts indeed, but I still don't think they are render bin 
 related.

 There looks to be an issue with state leakage, such as with my
 suggestion of missing vertex attributes, or perhaps now more likely
 given the screenshot a driver bug.

 What OS/hardware/drivers are you using?  Try other machines if you
 have access to them.

 Do you have an custom OpenGL code that might be causing problems?

 Robert.

 On Thu, Nov 6, 2008 at 3:16 PM, Sukender [EMAIL PROTECTED] wrote:
 Hi,

 That becomes stranger and stranger: now that I display another exported 
 model, some of my objects have back face culling problems as the moment the 
 object is added to the scene graph. Moreover, I have a HeightField which 
 has inverted culling on HALF of it! I joined before-after screenshots to 
 this message.
 If anyone has an idea of the problem, please tell me!
 (I use OSG 2.7.1)

 --
 Sukender
 PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


 Le Thu, 06 Nov 2008 12:50:28 +0100, Sukender [EMAIL PROTECTED] a écrit:

 Robert,

 Thank you for your answer. I've checked what you pointed. But my exported 
 model:
 - Has no coulour array (just a material)
 - Has 196 vertex and 196 normals (so probably no missing normals)
 - And has no transparency

 I really don't understand. Any idea?

 Note that I load the model using the cache 
 (ReaderWriter::Options::CACHE_ALL) and that I duplicate it (in order to 
 modify it without affecting the cached object) by using:
   myGroup = new osg::Group(*loadedCachedModel, 
 osg::CopyOp::DEEP_COPY_OBJECTS | osg::CopyOp::DEEP_COPY_NODES);
 I also tried DEEP_COPY_AL but that has no effect. Anyway, I'm not sure it 
 is related to my problem...

 I seen that on top of the geodes, there are MatrixTransforms with a stange 
 StateSet { 0xba1 ON } line (Exactly the same in each MatrixTransform), 
 but removing it didn't change anything.


 If you want, the geode data looks like:
 Geode {
   UniqueID Corps_geode
   DataVariance DYNAMIC
   name Corps_geode
   cullingActive TRUE
   num_drawables 1
   Geometry {
 StateSet {
   UniqueID Corps_stateset
   DataVariance STATIC
   rendering_hint OPAQUE_BIN
   GL_BLEND OFF
   Material {
 DataVariance STATIC
 ColorMode OFF
 diffuseColor 0.30011921 0.5 0.0 1.0
 specularColor 1.0 1.0 1.0 1
 emissionColor 0.111620302463 0.186033830047 0.0 1
 shininess 24.5960784314
   }
 }
 VertexArray 196 {...}
 NormalBinding PER_VERTEX
 NormalArray 196 {...}
 PrimitiveSets 2 {...}
   }
 }

 ___
 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] BS radius : world coordinate or local coordinate ?

2008-11-06 Thread Vincent Bourdier
Hi robert,

I agree that I cannot know if there are more Transform parents from my
current node. Thats' why I a looking on how to get the absolute BS radius,
if node is a group, a geode, a PAT, or everything else.

If I am on a node (not a PAT) I use : getbound().radius() *
getWorldMatrices[0].getscale()[0]

On a PAT, I cannot use the same thing : getbound().radius() return a value
different scale of value : I know this PAT is under the Root node, so I know
how to manage it this time, but If PAT is anywere in the sceneGraph, how to
get the World BS radius ?

Thanks for help,

Regards,
   Vincent.

2008/11/6 Robert Osfield [EMAIL PROTECTED]

 Hi Vincent,

 The bounding sphere of transform is in the coordinate frame of its
 parents, the children of transform will be in the transformed
 coordinate frame.

 Now you may have several transforms on the go at once, so one can't
 say that one is local or one is world coordinates unless you know that
 you are at the topmost or child below bottom most transform.

 Robert.

 On Thu, Nov 6, 2008 at 4:18 PM, Vincent Bourdier
 [EMAIL PROTECTED] wrote:
  Hi,
 
  I make a little Up of this topic for the problem :
  If I get the radius of a bounding sphere on a group, all is good.
  If I do it on a PAT, the BS radius is very higher. Of course the pat get
  children, so it is normal that the radius if 4 times more higher.
  But, the big difference is that the BS of the PAT seems to be in world
 scale
  coordinates.
  I need to divide it by the PAT's scale to have a good radius...
 
  It seems very uncertain, so how can I get the BS radius, for a PAT or a
 node
  ?
  (these nodes are scaled in real time, so the BS radius have to be
 computed
  depending on it)
 
  Thanks a lot,
 
  Regards,
 Vincent.
 
  2008/10/30 Vincent Bourdier [EMAIL PROTECTED]
 
  Thanks Grodon.
 
  :-)
 
  2008/10/30 Tomlinson, Gordon [EMAIL PROTECTED]
 
  Hi
 
  Get bounds is the local coordinates of the node.
 
  So yes any scale in the tree above the node will need to be factored in
  if you matrices that apply a scale above the node
 
 
  Gordon
 
  __
  Gordon Tomlinson
 
  Product Manager 3D
  Email  : gtomlinson @ overwatch.textron.com
  __
  (C): (+1) 571-265-2612
  (W): (+1) 703-437-7651
 
  Self defence is not a function of learning tricks
  but is a function of how quickly and intensely one
  can arouse one's instinct for survival
  - Master Tambo Tetsura
 
 
 
  
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of
 Vincent
  Bourdier
  Sent: Thursday, October 30, 2008 5:21 AM
  To: osg
  Subject: [osg-users] BS radius : world coordinate or local coordinate ?
 
  Hi,
 
  Just a simple question for you :
 
  When I get the Radius of a BS of a node, do I get the radius in World
  scale unit ? or is the raduis depending on the scale of the node ?
 
  for the moment I use : node-getBound().radius() *
  node-getWorldMatrices()[0].getScale()[0]
  But I am not sure of the result.
 
 
  Thanks a lot.
 
  Regards,
 
Vincent.
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

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


Re: [osg-users] BS radius : world coordinate or local coordinate ?

2008-11-06 Thread Robert Osfield
Hi Vincent,

I don't really know where to start because it's not just the API that
you need to know about it, it feels like vector maths and general
graphics education is required.

Transform are no different than any other nodes in the scene, you can
use the node-getWorldMatrices() method on them, but don't forget you
can multiple parents so multiple world matrices.   It looks like you
have all this already though save for the hard wiring that you've
done.  You have to gone on your own in understanding on this stuff.

Robert.


On Thu, Nov 6, 2008 at 5:30 PM, Vincent Bourdier
[EMAIL PROTECTED] wrote:
 Hi robert,

 I agree that I cannot know if there are more Transform parents from my
 current node. Thats' why I a looking on how to get the absolute BS radius,
 if node is a group, a geode, a PAT, or everything else.

 If I am on a node (not a PAT) I use : getbound().radius() *
 getWorldMatrices[0].getscale()[0]

 On a PAT, I cannot use the same thing : getbound().radius() return a value
 different scale of value : I know this PAT is under the Root node, so I know
 how to manage it this time, but If PAT is anywere in the sceneGraph, how to
 get the World BS radius ?

 Thanks for help,

 Regards,
Vincent.

 2008/11/6 Robert Osfield [EMAIL PROTECTED]

 Hi Vincent,

 The bounding sphere of transform is in the coordinate frame of its
 parents, the children of transform will be in the transformed
 coordinate frame.

 Now you may have several transforms on the go at once, so one can't
 say that one is local or one is world coordinates unless you know that
 you are at the topmost or child below bottom most transform.

 Robert.

 On Thu, Nov 6, 2008 at 4:18 PM, Vincent Bourdier
 [EMAIL PROTECTED] wrote:
  Hi,
 
  I make a little Up of this topic for the problem :
  If I get the radius of a bounding sphere on a group, all is good.
  If I do it on a PAT, the BS radius is very higher. Of course the pat get
  children, so it is normal that the radius if 4 times more higher.
  But, the big difference is that the BS of the PAT seems to be in world
  scale
  coordinates.
  I need to divide it by the PAT's scale to have a good radius...
 
  It seems very uncertain, so how can I get the BS radius, for a PAT or a
  node
  ?
  (these nodes are scaled in real time, so the BS radius have to be
  computed
  depending on it)
 
  Thanks a lot,
 
  Regards,
 Vincent.
 
  2008/10/30 Vincent Bourdier [EMAIL PROTECTED]
 
  Thanks Grodon.
 
  :-)
 
  2008/10/30 Tomlinson, Gordon [EMAIL PROTECTED]
 
  Hi
 
  Get bounds is the local coordinates of the node.
 
  So yes any scale in the tree above the node will need to be factored
  in
  if you matrices that apply a scale above the node
 
 
  Gordon
 
  __
  Gordon Tomlinson
 
  Product Manager 3D
  Email  : gtomlinson @ overwatch.textron.com
  __
  (C): (+1) 571-265-2612
  (W): (+1) 703-437-7651
 
  Self defence is not a function of learning tricks
  but is a function of how quickly and intensely one
  can arouse one's instinct for survival
  - Master Tambo Tetsura
 
 
 
  
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of
  Vincent
  Bourdier
  Sent: Thursday, October 30, 2008 5:21 AM
  To: osg
  Subject: [osg-users] BS radius : world coordinate or local coordinate
  ?
 
  Hi,
 
  Just a simple question for you :
 
  When I get the Radius of a BS of a node, do I get the radius in World
  scale unit ? or is the raduis depending on the scale of the node ?
 
  for the moment I use : node-getBound().radius() *
  node-getWorldMatrices()[0].getScale()[0]
  But I am not sure of the result.
 
 
  Thanks a lot.
 
  Regards,
 
Vincent.
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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


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


Re: [osg-users] osgOcean(?)

2008-11-06 Thread Jean-Sébastien Guay

Hi Kim,


Right blimey, I didn't expect so much interest.


Hehe, yeah it's a pretty interesting feature to have, and seems 
applicable to many different fields. Thanks a lot for the detailed 
explanations and the list of features. This is very useful.


I look forward to seeing your code and trying it out. I may be able to 
contribute too, as one of our current projects is related to oceans and 
needs ocean rendering.


J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgPPU vs RTT

2008-11-06 Thread Patrick Castonguay
Hi, 
I am trying to get osgPPU to work with the MPV project (a CIGI compliant IG)... 
 I am having a little bit of a hard time figuring out how to get the two to 
talk to each other.  As MPV is very modular and based on a plugin stucture, 
what I have to work with (so far) is the root node of the scene.  The examples 
all have their own viewer that are used by PPU but I would like to stay away 
from that and just insert the pipeline to affect the intire scene (the 
displaying of the scene is handled by an other plugin inside MPV).

Anybody have an idea of how could I attach a PPU pipeline to the scene? 

My other option is to not use osgPPU and start doing my own RTT, a little like 
Åsa Engvall is intending to do...


Patrick Castonguay
H: 613 435 2235
C: 613 325 1341
 
Technology Innovation Management (TIM) Student - Modeling and Simulation stream

Carleton University, Ottawa, ON___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgOcean(?)

2008-11-06 Thread Ümit Uzun
Hi Kim,

I have searched these kind of Underwater rendering about 2 mounths. And my
main target is developing base submarine simulator. I able to understand all
of your called technique and effect methods like creating waves, caustics,
fish and flora motions and etc.

And much of them, if we talking about osgOcean nodekit, The skeletal fish
motions can be simulated and flocing algorithm can be added like Reynolds
flocking algorithm. And we can develop this algorithm for special cases as
hunter-prey, male-female relation, hungry-fish motion and etc. I think these
all can be added these nodekit to simulate ocean's life effects.

I really want to contribute this project. I wonder you can arrange your
algorithm codes as possible as fast and we can help you then.

Best Regards.


2008/11/6 Jean-Sébastien Guay [EMAIL PROTECTED]

 Hi Kim,

  Right blimey, I didn't expect so much interest.


 Hehe, yeah it's a pretty interesting feature to have, and seems applicable
 to many different fields. Thanks a lot for the detailed explanations and the
 list of features. This is very useful.

 I look forward to seeing your code and trying it out. I may be able to
 contribute too, as one of our current projects is related to oceans and
 needs ocean rendering.

 J-S
 --
 __
 Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




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


Re: [osg-users] osgOcean(?)

2008-11-06 Thread Paul Pocock
Hi Kim, 
I used the same 15x15 grid tiles and 64x64 using a pagedLOD system. The
FFT height maps were pre-generated. My biggest problems were seams in
the tiles and trying to introduce reflections. I handled the seam
problems between tiles by slightly overlapping them at the edges, not an
ideal solution but it served our purposes based on the amount of effort
we could put into this. I also used a distance based system so only the
fragment shader was active until you got to about 100- 200 metres away
and then the vertex shader would kick in and give form to the waves. Got
around 25 fps on a NVidia 7800, 1.8Mhz cpu

I don't know how we are going to coordinate this effort but I can put
everything I've done together and post it.


On Thu, 2008-11-06 at 17:01 +, Kim C Bale wrote:
 Right blimey, I didn't expect so much interest.
 
 In answer to J-S and Paul the actual ocean surface rendering is something I 
 find particularly interesting. There are many different approaches for this 
 (Gerstner, perlin noise, FFT etc), each of which have their own advantages 
 and disadvantages. 
 
 An idea I had a while back at the start of this project was to create a 
 nodekit designed specifically for ocean surface simulation and rendering. 
 Something similar to osgShadow, where various techniques are implemented and 
 can be chosen based on the application. So yes it would be interesting to try 
 and tie in Paul's work. This type of nodekit I think would be fairly easy to 
 design.
 
 The ocean technique I have implemented is based the FFT technique described 
 by Tessendorf in his paper Simulating Ocean Waves. It is the same algorithm 
 that was used in the film Titanic, albeit without the 5.1 billion polygons 
 they used. 
 
 The technique produces a tileable height map that can be stitched together to 
 form a large expanse of ocean water. Whilst it provides very nice looking 
 waves, the fact that it's tileable makes it rather difficult to represent 
 local interactions with the waves themselves. Unfortunately wave interactions 
 were not a requirement, so I have not taken these into account. However, 
 Tessendorf details an approach called IWave that can be used to provide 
 these. 
 
 These tiles can either be pre-computed, or computed in real-time. One 
 disadvantage of this technique is the use of Fast Fourier Transforms to 
 generate the height maps. FFTs are pretty heavy on the CPU and can be a major 
 bottleneck. However, for grid sizes of 128x128 it is still perfectly feasible 
 to generate them in real-time. The advantage of this is that you can change 
 ocean parameters wind/wave direction, gravity, depth etc on the fly. 
 Personally, I decided to pre-compute as these real-time changes were not 
 required. 
 
 In my simulation there is no coast line, you are presented with an infinite 
 plane of sea. So, I have not considered sea/coast interaction but again this 
 can be achieved with the IWave technique. 
 
 The sea surface shader is quite lengthy, largely because it needs to take 
 into account both sides of the surface. It uses cube mapping for global 
 reflections and a projective texture map for local reflections. I use a 
 series of pre-computed normal maps based on the height maps to add additional 
 detail and the colour itself is computed based on the angle at which you look 
 at the ocean surface. Finally a refraction shader is used if looking upward 
 from under the surface. The whitecaps are a bit of a cheat really, there are 
 a couple of clever ways of computing these based on the heightmap, but I 
 found that simply overlaying a foam texture where the wave peaked above a 
 certain height provided the best results in my case.
 
 So, regarding performance, I can happily run a grid of 15x15 ocean tiles 
 comprised of 64x64 height values. As the poly count gets pretty high, I use 
 GeoMipMapping to reduce the detail of tiles in the distance. Using that with 
 the pre-computed height maps I can get 55-60 fps which drops to about 
 45-50fps when I render the scene twice on a 8800 GTS. There are a number of 
 optimisations that I haven't made though. The problem with GeoMipMapping of 
 course is that detail is relative to the position of the camera. So if you 
 have multiple cameras you have to re-compute the geomipmapping for each one. 
 I was fortunate as my secondary camera is very close to my primary one so 
 that was not an issue.
 
 Aside from the ocean I have:
 
 God-rays - Created by rendering geometrically modelled rays to an FBO and 
 then blending them into the scene as a post render.
 
 2D fogging equation - a pre-computed fogging texture is used to simulate the 
 underwater fogging based on distance from surface and viewer.
 
 Depth of field - Not exclusive to underwater scenes obviously, but does a 
 nice job of creating a watery blur in the distance
 
 Wobbly screen distortion - Post render effect, similar to the effect seen in 
 BioShock, that warps the view in a watery fashion. 

Re: [osg-users] Need explanation about a strange behaviour with RenderBin

2008-11-06 Thread Sukender
Hi again Robert,

I confirm that the strange behavior still exist while compiling against the rev 
9119 (branch osgWidget-dev).

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/
 
 
Le Thu, 06 Nov 2008 17:28:53 +0100, Robert Osfield [EMAIL PROTECTED] a écrit:
 
 Hi Sukender,

 Intel drivers are known for being rather poor, so it may well just be
 driver bug, I would certainly check for updated drivers.  Also get
 yourself a cheap Nvidia card an pop it in the machine, you may well
 get quite a different experience and will give you a sanity test.

 Robert.

 On Thu, Nov 6, 2008 at 4:24 PM, Sukender [EMAIL PROTECTED] wrote:
 Hi again Robert,

 I don't have any custom OpenGL code.
 Configuration : Core 2 Duo, integrated chipset (Intel 82945G), Windows XP 32 
 bits SP3.
 Driver is the factory default one, and I never saw such effets in any 
 other app.
 The first bug (strange lightning) has been seen on another configuration, 
 but not he last one yet (I will test ASAP and inform you).
 I'm going to try linking against OSG 2.7.4 (or maybe the wxWidget branch as 
 I already compiled half of it), but I think that won't change anything.
 The problem may not be render-bin related, but I still don't understand... 
 What a strange effect!
 Thank you for taking time for this.

 --
 Sukender
 PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


 Le Thu, 06 Nov 2008 16:35:17 +0100, Robert Osfield [EMAIL PROTECTED] a 
 écrit:

 Hi Sukender,

 Strange artefacts indeed, but I still don't think they are render bin 
 related.

 There looks to be an issue with state leakage, such as with my
 suggestion of missing vertex attributes, or perhaps now more likely
 given the screenshot a driver bug.

 What OS/hardware/drivers are you using?  Try other machines if you
 have access to them.

 Do you have an custom OpenGL code that might be causing problems?

 Robert.

 On Thu, Nov 6, 2008 at 3:16 PM, Sukender [EMAIL PROTECTED] wrote:
 Hi,

 That becomes stranger and stranger: now that I display another exported 
 model, some of my objects have back face culling problems as the moment 
 the object is added to the scene graph. Moreover, I have a HeightField 
 which has inverted culling on HALF of it! I joined before-after 
 screenshots to this message.
 If anyone has an idea of the problem, please tell me!
 (I use OSG 2.7.1)

 --
 Sukender
 PVLE - Lightweight cross-platform game engine - 
 http://pvle.sourceforge.net/


 Le Thu, 06 Nov 2008 12:50:28 +0100, Sukender [EMAIL PROTECTED] a écrit:

 Robert,

 Thank you for your answer. I've checked what you pointed. But my exported 
 model:
 - Has no coulour array (just a material)
 - Has 196 vertex and 196 normals (so probably no missing normals)
 - And has no transparency

 I really don't understand. Any idea?

 Note that I load the model using the cache 
 (ReaderWriter::Options::CACHE_ALL) and that I duplicate it (in order to 
 modify it without affecting the cached object) by using:
   myGroup = new osg::Group(*loadedCachedModel, 
 osg::CopyOp::DEEP_COPY_OBJECTS | osg::CopyOp::DEEP_COPY_NODES);
 I also tried DEEP_COPY_AL but that has no effect. Anyway, I'm not sure it 
 is related to my problem...

 I seen that on top of the geodes, there are MatrixTransforms with a 
 stange StateSet { 0xba1 ON } line (Exactly the same in each 
 MatrixTransform), but removing it didn't change anything.


 If you want, the geode data looks like:
 Geode {
   UniqueID Corps_geode
   DataVariance DYNAMIC
   name Corps_geode
   cullingActive TRUE
   num_drawables 1
   Geometry {
 StateSet {
   UniqueID Corps_stateset
   DataVariance STATIC
   rendering_hint OPAQUE_BIN
   GL_BLEND OFF
   Material {
 DataVariance STATIC
 ColorMode OFF
 diffuseColor 0.30011921 0.5 0.0 1.0
 specularColor 1.0 1.0 1.0 1
 emissionColor 0.111620302463 0.186033830047 0.0 1
 shininess 24.5960784314
   }
 }
 VertexArray 196 {...}
 NormalBinding PER_VERTEX
 NormalArray 196 {...}
 PrimitiveSets 2 {...}
   }
 }
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Explanation for OSGDEMS --levels

2008-11-06 Thread Mark Yantek
User of OSG,

 

OSGDEM has an argument called -levels begin_level end_level and
I'm not sure what it does exactly. Could some please give me a better
explanation of its function?

 

Thanks

 

-Mark

 

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


Re: [osg-users] HMD_Tracker_Synchronization

2008-11-06 Thread Ulrich Hertlein
Hello Ugras,

Quoting Ugras Erdogan [EMAIL PROTECTED]:
       For the purpose of thread synchronization,  I use Windows OS
 synchronization objects. This is also needed because in the lack of
 synchronization the original frame rate of the application and the
 yaw/pitch/roll values acquired from the tracker may go out of sync.
     My questions are:
 1)  (As I haven't noticed up to now), does OSG have synchronization  objects
 for the purpose above?

OSG includes the OpenThreads library which has cross-platform support for
threads, mutices(?), conditions etc.  Have a look in include/OpenThreads.

 2) After obtaining the yaw/pitch/roll values in sync, is updating the
 virtual camera's viewmatrix correct way of proceeding or does OSG has some
 specialized functions for this?

You'd usually update the viewmatrix manually in your main loop using one of the
osg::Camera::setViewMatrix*() functions.

Another possibility is to subclass osgGA::MatrixManipulator.  Examples for this
are DriveManipulator, FlightManipulator, etc.

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


Re: [osg-users] A Windows binary version of OSG 2.6.x available?

2008-11-06 Thread Sukender
Hi Robert,

 I'm afraid no binaries for 2.6.x have been posted to me to upload yet.

I usually compile OSG on Win32 - VC8 (maybe 9 soon?) SP1. If you are interested 
in compiled Zip's (Actually 7-Zip's) for the versions I compile, just tell me. 
If so, also tell me if you want developer releases I compile.

Sincerely,

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Character animation in OSG

2008-11-06 Thread Alberto Luaces
El Jueves 06 Noviembre 2008ES 17:48:24 Jan Ciger escribió:
 Alberto Luaces wrote:
  I think scaling bones is an important feature at least meanwhile a
  morphing system is not available (face gestures, breathing movements,
  etc)

 If you need that then you are better off implementing morphing and not
 deforming the skeleton. Doing it by scaling bones will break lot of
 things that rely on the fixed bone length - e.g. inverse kinematics,
 walking cycles, the skin will look bad etc.

Well, I was referring to dedicated bones, not the principal ones from the 
skeleton. Think of an arm whose biceps changes its shape when bending: you 
might put a special bone to reflect the growth. Therefore you get the 
effect of a deforming body without affecting IK, etc. I've seen places where 
this is done so. However I admit that this could be the poor man approach, 
useful when one has memory or cpu constraints.

Regards,

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


Re: [osg-users] Render to texture problem

2008-11-06 Thread J.P. Delport

Hi,

can you force single threaded osgviewer and see if it still is a problem?

jp

Engvall Åsa wrote:

Hi!

I want to render the scene to a texture and use the texture in a shader. 
The texture image is saved to file by a postdraw callback, so I can look 
at it. I'm doing something wrong because the texture becomes all gray.


My scene graph looks like this:

RTT camera  root
   | |
   \/
world

The main viewer looks at the root and the shader program is applied to 
the root stateset. Below is a code snippet.


I would be very grateful if somebody could point out what I'm doing wrong.
Thanks in advance,

Åsa Engvall


// Create a scene texture.
osg::Texture2D* texture = new osg::Texture2D;
texture-setResizeNonPowerOfTwoHint(false);
texture-setTextureSize(traits-width, traits-height);
texture-setInternalFormat(GL_RGBA);
texture-setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::NEAREST);
texture-setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::NEAREST);
osg::Image* textureImage = new osg::Image;
textureImage-allocateImage(traits-width, traits-height, 1, GL_RGBA, 
GL_UNSIGNED_BYTE);

texture-setImage(0, textureImage);

// Add program and uniforms to the root's stateset.
osg::StateSet* state = root-getOrCreateStateSet();
state-addUniform(numberOfTimeStepsU);
state-addUniform(timeConstantU);
state-addUniform(frameTimeU);
state-addUniform(sceneTextureU);
state-addUniform(prevModelViewMatrixU);
state-addUniform(prevModelViewProjectionMatrixU);
state-setAttributeAndModes(motionBlurProgram, osg::StateAttribute::ON);
state-setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);

// Create a camera that renders the scene to a texture.
osg::Camera* RTTcamera = new osg::Camera;
RTTcamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); 
RTTcamera-setClearColor(osg::Vec4(1,1,1,1));

RTTcamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
RTTcamera-setViewport(0, 0, traits-width, traits-height);
RTTcamera-setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
RTTcamera-setRenderOrder(osg::Camera::PRE_RENDER);
RTTcamera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
RTTcamera-attach(osg::Camera::COLOR_BUFFER, texture);
RTTcamera-addChild(world);
RTTcamera-attach(osg::Camera::COLOR_BUFFER, textureImage);
RTTcamera-setPostDrawCallback(new ScreenShotCallback(traits-width, 
traits-height, *textureImage, GL_RGB, GL_UNSIGNED_BYTE));






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


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


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] Render to texture problem

2008-11-06 Thread J.P. Delport

Hi,

any reason why you have RGBA texture, but RGB in callback?

jp

Engvall Åsa wrote:

Hi!

I want to render the scene to a texture and use the texture in a shader. 
The texture image is saved to file by a postdraw callback, so I can look 
at it. I'm doing something wrong because the texture becomes all gray.


My scene graph looks like this:

RTT camera  root
   | |
   \/
world

The main viewer looks at the root and the shader program is applied to 
the root stateset. Below is a code snippet.


I would be very grateful if somebody could point out what I'm doing wrong.
Thanks in advance,

Åsa Engvall


// Create a scene texture.
osg::Texture2D* texture = new osg::Texture2D;
texture-setResizeNonPowerOfTwoHint(false);
texture-setTextureSize(traits-width, traits-height);
texture-setInternalFormat(GL_RGBA);
texture-setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::NEAREST);
texture-setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::NEAREST);
osg::Image* textureImage = new osg::Image;
textureImage-allocateImage(traits-width, traits-height, 1, GL_RGBA, 
GL_UNSIGNED_BYTE);

texture-setImage(0, textureImage);

// Add program and uniforms to the root's stateset.
osg::StateSet* state = root-getOrCreateStateSet();
state-addUniform(numberOfTimeStepsU);
state-addUniform(timeConstantU);
state-addUniform(frameTimeU);
state-addUniform(sceneTextureU);
state-addUniform(prevModelViewMatrixU);
state-addUniform(prevModelViewProjectionMatrixU);
state-setAttributeAndModes(motionBlurProgram, osg::StateAttribute::ON);
state-setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);

// Create a camera that renders the scene to a texture.
osg::Camera* RTTcamera = new osg::Camera;
RTTcamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); 
RTTcamera-setClearColor(osg::Vec4(1,1,1,1));

RTTcamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
RTTcamera-setViewport(0, 0, traits-width, traits-height);
RTTcamera-setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
RTTcamera-setRenderOrder(osg::Camera::PRE_RENDER);
RTTcamera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
RTTcamera-attach(osg::Camera::COLOR_BUFFER, texture);
RTTcamera-addChild(world);
RTTcamera-attach(osg::Camera::COLOR_BUFFER, textureImage);
RTTcamera-setPostDrawCallback(new ScreenShotCallback(traits-width, 
traits-height, *textureImage, GL_RGB, GL_UNSIGNED_BYTE));






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


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


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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