Re: [osg-users] Stereoscopic Screenshot

2010-01-29 Thread Nathan Schofield
The idea was that I would screen capture the stereo image on screen to produce 
a single image with the stereo effect in it, you would then be able to view 
this image on its own (with the appropriate monitor and glasses) without the 
need for the two separate images and a piece of software. 
How would one go about taking the contents of both the BACK_LEFT and BACK_RIGHT 
buffers to produce a single image.
Once again thanks for the help

Nathan

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





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


Re: [osg-users] PagedLod do not release memory with own viewer

2010-01-29 Thread Vincent Bourdier

Hi Robert,

It works when I call

registerPagedLODs(node);

just after my runtime model loading.

Can't we add this call in osgDB::readNodeFile(s) ? maybe this is the 
best place to call it...


Thansk.

Regards,
  Vincent.


Robert Osfield a écrit :

Hi Vincent,

Could it be that you are bypassing the operation where
osgViewer::setSceneData(..) that gets the DatabasePager to find all
the PagedLOD nodes in the scene graph and so it can start tracking
them.  Have a look Scene::setSceneData(..) implementation :

void Scene::setSceneData(osg::Node* node)
{
_sceneData = node;

if (_databasePager.valid())
{
// register any PagedLOD that need to be tracked in the scene graph
if (node) _databasePager-registerPagedLODs(node);
}
}

You could call this yourself.  I guess we might also be able to tweak
the DatabasePager so that it automatically registers new PagedLOD's
that it hasn't come across previously, such an approach might make it
bit more flexible for users that add their own data in but forget to
register the PagedLOD's.

Robert.

On Thu, Jan 28, 2010 at 3:39 PM, Vincent Bourdier
vincent.bourd...@gmail.com wrote:
  

Hi Robert,

Sorry for the mistake, but nothing to do with Viewer/compositeViewer...

I get it I think :

Using osgviewer, I set the scene data before running the main loop.
In my application, I load ive files at runtime during a callback. So the
setSceneData is not called, and the pagedLod are not counted again...
I tried to load the ive files before the render loop starts, and the
PagedLOD run correctly, loading and unloading files in memory  :-)

But I don't know how to solve it ...

Thanks.

Regards,
  Vincent.

Robert Osfield a écrit :


HI Vincent,

The results you are getting are strange, the usage of the
DatabasePager should be the same across osgViewer::Viewer and
CompositeViewer.  I simply can't explain the results you are getting,
but I really don't have any ideal what your app or data is like so
there really is too many unknowns for me or others to really guess.

Would it be possible for you to modify or use one of the existing osg
examples to reproduce this issue.  If you can find a way that others
will be able to reproduce the problem then we'll have a much better
chance of pinning down what is going wrong.

Robert.

On Thu, Jan 28, 2010 at 1:41 PM, Vincent Bourdier
vincent.bourd...@gmail.com wrote:

  

Hi Chris,

I just remove a lot of code in osgViewer to make it very simple : just
create a viewer, add sceneData and run.
This is working well.

So I dig into OSG databasePager code to find where are the difference...
And
I found something strange I cannot explain:

In DatabasePager.cpp in/ void
DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp
frameStamp)/
(line 1527), there is at the begining a loop counting the active and
incative pagedLods.
Using osgViewer, active + inactive still equals 780.
Using my viewer, 0 + 0 = 0 ...

This explains why my Paged LOD never unload children...

Do you have any explanation to help me ?
DatabasePager is not my cup of tea so it takes me a lot of time to trace
my
problem...

Thanks.

Regards,
 Vincent.

Chris 'Xenon' Hanson a écrit :



On 1/27/2010 7:38 AM, Vincent Bourdier wrote:


  

Hi everybody,
I just ran some tests and I saw that a pagedLod - based ive file have
different memory usage behaviors according to the viewer :
OsgViewer loads the file, use more memory when the camera goes near the
model, and release memory when the camera goes far.
My own viewer (Composite viewer using one view) do not release the
memory going far from the model ...
Are there any parameters or settings to manage that ?




 Usually this is a result of your viewer code lacking some important
code.

 Is your viewer source copied from current OSG examples?



  

Thanks.
Regards,
 Vincent



  

__ Information from ESET NOD32 Antivirus, version of virus
signature
database 4812 (20100128) __

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 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 4812 (20100128) __

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 mailing list
osg-users@lists.openscenegraph.org

Re: [osg-users] Small GeoTIF or DEM Terrain Options

2010-01-29 Thread Robert Osfield
Hi Chris,

With very close up views to the terrain where the terrain extends for
a large distance away from the camera you can find that the near
clipping plane clips out geometry.  This issue is just down to the
size of overall model and not directly related to osgEarth - it's only
that osgEarth can create models of large geographic area, you'll see
the same issue with any large model.

To manage this issue the easiest option would probably to disable the
default compute of the near/far planes that the OSG provides and set
the near/far planes manually via the projection matrix.
  
viewer.getCamera()-setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);

And then set the the viewer's projection matrix manually using:

viewer.getCamera()-setProjectionMatrixAsFrustum(...);

You also can switch on the far culling plane so that the OSG culls out
geometry beyond the far plane distance.  Have a look at
include/osg/CullSetting for more details.


Robert.

On Thu, Jan 28, 2010 at 8:55 PM, Chris Innanen f...@nonsanity.com wrote:
 (And because I couldn't yet post a link in the last message, here's a 
 snapshot of the clipping problem I'm seeing:)

 When I bring the camera down within 100 meters or so of the sea floor, this 
 is what I'm seeing. The nearest chunks of the terrain are being clipped.

 [Image: http://nonsanity.com/x/osgEarth_clipping.jpg ]

  ~ Chris Innanen
  ~ Nonsanity

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





 ___
 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] Maybe Bug in Culling near in combination with HUD and negative values

2010-01-29 Thread Robert Osfield
Hi Torben,

On Fri, Jan 29, 2010 at 6:46 AM, Torben Dannhauer
z...@saguaro-fight-club.de wrote:
 I do not know if something should be changed, maybe the function which 
 executes clampProjectionMatrixImplementation should clamp the values to valid 
 values.

It's the job of the clamp method to clamp the values... the clue is in the name.

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


Re: [osg-users] Stereoscopic Screenshot

2010-01-29 Thread Robert Osfield
Hi Nathan,

On Fri, Jan 29, 2010 at 8:28 AM, Nathan Schofield
john.smith.jsmit...@googlemail.com wrote:
 The idea was that I would screen capture the stereo image on screen to 
 produce a single image with the stereo effect in it, you would then be able 
 to view this image on its own (with the appropriate monitor and glasses) 
 without the need for the two separate images and a piece of software.

?? I don't know where to start...  quad buffer stereo requires
software to drive it, end of story, you simply can't output a quad
buffer stereo image and magically get it to work.

 How would one go about taking the contents of both the BACK_LEFT and 
 BACK_RIGHT buffers to produce a single image.
 Once again thanks for the help

You need to go read an OpenGL book, and think about strereo and how
you want to rendering it.

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


Re: [osg-users] PagedLod do not release memory with own viewer

2010-01-29 Thread Robert Osfield
Hi Vincent,

On Fri, Jan 29, 2010 at 8:29 AM, Vincent Bourdier
vincent.bourd...@gmail.com wrote:
 It works when I call

 registerPagedLODs(node);

 just after my runtime model loading.

Good to hear.

 Can't we add this call in osgDB::readNodeFile(s) ? maybe this is the best
 place to call it...

No, readNodeFIles wouldn't work as the application can have multiple
DatabasePagers in play at once (such as when you have multiple View's
with multiple Scene's, or multiple Viewers.

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


Re: [osg-users] Stereoscopic Screenshot

2010-01-29 Thread Nathan Schofield
I thought that if the image looked the same as that on screen i.e. with the 
offset and two images merged together, displaying this on a 3D monitor with 
shutter glasses would produce the same effect as displaying it via software, 
maybe I was wrong.

As for capturing the image I tried setting glReadBuffer to GL_BACK_LEFT then 
capturing one image, changing glReadBuffer to GL_BACK_RIGHT capturing the 
second image, and using copySubImage to combine the two. However the second 
image from GL_BACK_RIGHT is always black.

Cheers,
Nathan

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





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


Re: [osg-users] Maybe Bug in Culling near in combination with HUD and negative values

2010-01-29 Thread Torben Dannhauer
Hi,

hmmm, good point :)

Thank you!

Cheers,
Torben

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





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


[osg-users] Explosion effect under an osg::MatrixTransform

2010-01-29 Thread Tugkan Calapoglu
Hi,

in one of our old applications we use osgParticle::ExplosionEffect which
is made child to an osg::MatrixTransform. This code is relatively old
and was tested with OSG 0.99.

The problem is, with new OSG (2.9.6) explosion effect is always at the
center of the scene (at 0,0,0) even though matrix transform has a
translation matrix in it. It looks like explosion effect is not affected
by the parent transforms anymore.

Is there a way to change this?

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


Re: [osg-users] Explosion effect under an osg::MatrixTransform

2010-01-29 Thread Robert Osfield
Hi Tugkan,

To get particle effects to work below a transform you set up a
ParticleSystem below the root node in the world coordinate frame, and
set the ParticleEffect to use this.  Have a look at the
osgparticleeffects example source code for instruction on this.

Robert.

On Fri, Jan 29, 2010 at 11:34 AM, Tugkan Calapoglu tug...@vires.com wrote:
 Hi,

 in one of our old applications we use osgParticle::ExplosionEffect which
 is made child to an osg::MatrixTransform. This code is relatively old
 and was tested with OSG 0.99.

 The problem is, with new OSG (2.9.6) explosion effect is always at the
 center of the scene (at 0,0,0) even though matrix transform has a
 translation matrix in it. It looks like explosion effect is not affected
 by the parent transforms anymore.

 Is there a way to change this?

 Regards,
 tugkan
 ___
 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] uniform update question

2010-01-29 Thread Emmanuel Roche
Hi everyone,

I'm facing a problem I cannot solve by myself here, I thought I could just
ask:

- I have a scene (so a scene graph)
- I use multiple View on this single scene

-- Currently I have an homemade mixture of customized osgViewer::Viewer
objects to deal with everything so basically, for each View, I go through a
complete (EventTraversal(), UpdateTraversal(), RenderingTraversals() ) loop
sequentially.

- Now I would like to switch to a CompositeViewer and thus go through the
event/update traversals only once per Scene (If I understand the
CompositeViewer design properly).

But I have a very specific problem to solve here:

In my scene graph I use shaders and uniforms. those uniforms have update
callbacks, and in those update callbacks, I retrieve my currently rendering
View and then the View matrix to generate eye coordinates.

-- I assume using the osg_ViewMatrix uniform is not an option for me
because I need to convert very big position vector and very big view matrix
translation, and I would clearly get a problem here if I don't have double
precision.
-- With the CompositeViewer I can't access the individual View anymore in
the update traversal() since this process is View agnostic I would say.


-- Since my views will need different settings for the uniforms, I was
thinking I would just need to do something in the cull traversal, but here I
realized something which seems strange to me: there is no such method as
uniform::setCullCallback(...)

So, the question is, how would you update your uniforms properly in that
case ?

I mean, I could still put a cullcallback on the node owning the stateset
containing the uniform for instance and update from here (assuming I can
retrieve the Viewmatrix I need somehow in that Cullcallback...) but is this
really the best option ??

- And generally speaking, would a uniform::setCullCallback() not make sense
for some reason I'm apparently missing for now ?

Bonus question by the way: How would I access the master camera ViewMatrix
in a cullcallback ? i've seen we have
osgUtil::CullVisitor::getCurrentCamera() but would this return the Master
camera of the View or just the current camera in the scene graph (as I use
DepthPartitionNode I have many sub cameras in my scene...)

Thanks in advance is someone has any tip/advise/complete solution on those
questions!

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


[osg-users] Image-setData(unsigned char* data,AllocationMode allocationMode);

2010-01-29 Thread Roman Grigoriev
Good day!

I'd like to setup some float textures by reading them from data files. But I
found that I can only setup unsigned char images by using this method.

Of cause I can setup by setting float values in the loop, but maybe it will
more comfortable to have setData method with float values.

Will this feature added to osg or maybe there are some difficulties with it?

Thanx in advance

Bye 

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


Re: [osg-users] Image-setData(unsigned char* data,AllocationMode allocationMode);

2010-01-29 Thread J.P. Delport

Hi,

AFAIK the char* is only used to point to the start of the data. You can 
point to floats no problem, just set the texture format correctly. Maybe 
have a look at what osgprerender --hdr does.


jp

Roman Grigoriev wrote:

Good day!

I’d like to setup some float textures by reading them from data files. 
But I found that I can only setup unsigned char images by using this method.


Of cause I can setup by setting float values in the loop, but maybe it 
will more comfortable to have setData method with float values.


Will this feature added to osg or maybe there are some difficulties with it?

Thanx in advance

Bye




___
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] [osgPlugins] Rendering 3DS objects with bump maps

2010-01-29 Thread Eduardo Pinheiro
Hi,

Working on it...



... 

Thank you!

Cheers,
Eduardo

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





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


Re: [osg-users] uniform update question

2010-01-29 Thread Wojciech Lewandowski
Hi Manu,

IMHO I can offfer tips for 2 or your questions: 

Why no cull calback for uniform ?
I guess there is no cull calback for state attribs/uniforms because they could 
be used many times and located in many statesets/nodes. So cull visitor can 
traverse them couple times per one frame.

How to obtain master camera view matrix ?
In ViewDependentShadowTechniques I used following method to obtain master view 
or slave view camera:
cullVisitor-getRenderStage()-getCamera() 

Depending on your setup of extra cameras it may wortk or not, but I guess you 
could try it.

Cheers,
Wojtek Lewandowski
 

  - Original Message - 
  From: Emmanuel Roche 
  To: OSG Users 
  Sent: Friday, January 29, 2010 1:08 PM
  Subject: [osg-users] uniform update question


  Hi everyone,

  I'm facing a problem I cannot solve by myself here, I thought I could just 
ask:

  - I have a scene (so a scene graph)
  - I use multiple View on this single scene

  -- Currently I have an homemade mixture of customized osgViewer::Viewer 
objects to deal with everything so basically, for each View, I go through a 
complete (EventTraversal(), UpdateTraversal(), RenderingTraversals() ) loop 
sequentially.

  - Now I would like to switch to a CompositeViewer and thus go through the 
event/update traversals only once per Scene (If I understand the 
CompositeViewer design properly).

  But I have a very specific problem to solve here:

  In my scene graph I use shaders and uniforms. those uniforms have update 
callbacks, and in those update callbacks, I retrieve my currently rendering 
View and then the View matrix to generate eye coordinates.

  -- I assume using the osg_ViewMatrix uniform is not an option for me because 
I need to convert very big position vector and very big view matrix 
translation, and I would clearly get a problem here if I don't have double 
precision. 
  -- With the CompositeViewer I can't access the individual View anymore in 
the update traversal() since this process is View agnostic I would say.


  -- Since my views will need different settings for the uniforms, I was 
thinking I would just need to do something in the cull traversal, but here I 
realized something which seems strange to me: there is no such method as 
uniform::setCullCallback(...) 

  So, the question is, how would you update your uniforms properly in that case 
?

  I mean, I could still put a cullcallback on the node owning the stateset 
containing the uniform for instance and update from here (assuming I can 
retrieve the Viewmatrix I need somehow in that Cullcallback...) but is this 
really the best option ??

  - And generally speaking, would a uniform::setCullCallback() not make sense 
for some reason I'm apparently missing for now ?

  Bonus question by the way: How would I access the master camera ViewMatrix 
in a cullcallback ? i've seen we have osgUtil::CullVisitor::getCurrentCamera() 
but would this return the Master camera of the View or just the current camera 
in the scene graph (as I use DepthPartitionNode I have many sub cameras in my 
scene...)

  Thanks in advance is someone has any tip/advise/complete solution on those 
questions!

  Regards,
  Manu.




--


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


[osg-users] website down?

2010-01-29 Thread Raymond de Vries

Hi everyone,

Fyi: I just noticed that www.openscenegraph.org is down...

regards
Raymond

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


[osg-users] [3rdparty] osgearth crashes when I load a shape file

2010-01-29 Thread Martin Scheffler
Hi,

first up, osgEarth is absolutely amazing! It is a lot of fun to play around 
with.

But now to my problem: Everything crashes when I try to load a shape file!

I added a shape file as seen here:
http://osgearth.org/wiki/TileSourcePluginModelFeatureOverlay

Luckily I built in debug mode from SVN head, so I found out that in 
osgEarthFeatures/FeatureModelSource.cpp
on line 192 the call getFeatureSource()-getFeatureProfile()-getExtent(); 
returns a NULL pointer, causing the crash.

So what went wrong here? Maybe there is a plugin DLL I did not copy to the 
correct position or something?
Thanks for your help!
Martin

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





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


Re: [osg-users] [3rdparty] osgearth crashes when I load a shape file

2010-01-29 Thread Jason Beverage
Hi Martin,

Can you provide your data and a sample .earth file that is causing the issue?

Thanks!

Jason

On Fri, Jan 29, 2010 at 8:23 AM, Martin Scheffler osgfo...@tevs.eu wrote:
 Hi,

 first up, osgEarth is absolutely amazing! It is a lot of fun to play around 
 with.

 But now to my problem: Everything crashes when I try to load a shape file!

 I added a shape file as seen here:
 http://osgearth.org/wiki/TileSourcePluginModelFeatureOverlay

 Luckily I built in debug mode from SVN head, so I found out that in
 osgEarthFeatures/FeatureModelSource.cpp
 on line 192 the call getFeatureSource()-getFeatureProfile()-getExtent(); 
 returns a NULL pointer, causing the crash.

 So what went wrong here? Maybe there is a plugin DLL I did not copy to the 
 correct position or something?
 Thanks for your help!
 Martin

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





 ___
 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] Image-setData(unsigned char* data,AllocationMode allocationMode);

2010-01-29 Thread Roman Grigoriev
Hi, J.P. 
Now I use this method and it works.

data = new float[256*64*3];
f = fopen(data/transmittance.raw, rb);
fread(data, 1, 256*64*3*sizeof(float), f);
fclose(f);
osg::Image* image_Transmittance = new osg::Image;
image_Transmittance-allocateImage(64,16,1,GL_RGB16F_ARB, GL_FLOAT,1);
 float* dataPtr = (float*)image_Transmittance-data();
 for(int i=0;i256*64*3;i++)
{
*dataPtr++ = data[i];
}

And I simply want to use 
 image-setImage(64,16,1, GL_RGB16F_ARB, GL_RGB16F_ARB, GL_FLOAT, data, 
osg::Image::USE_NEW_DELETE);
but it doesn't works. In osgprerender I found solution using first method when 
you have loops to copy data.


Thank you!

Cheers,
Roman

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





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


Re: [osg-users] uniform update question

2010-01-29 Thread Emmanuel Roche
Hello Wojtek,

thanks for the tips !!
I will try with getRenderStage()-getCamera() and let you know if it works
for me too.

But concerning the cull callback for uniforms, isn't it already the case for
the update callback you can put on them ? (if you use the same uniform in
multiple statesets/nodes, then the update callback is called multiple times
per frame... [or is there some kind of security system to prevent this I'm
not aware of ? ]

Cheers,
Manu.


2010/1/29 Wojciech Lewandowski lewandow...@ai.com.pl

  Hi Manu,

 IMHO I can offfer tips for 2 or your questions:

 Why no cull calback for uniform ?
 I guess there is no cull calback for state attribs/uniforms because they
 could be used many times and located in many statesets/nodes. So cull
 visitor can traverse them couple times per one frame.

 How to obtain master camera view matrix ?
 In ViewDependentShadowTechniques I used following method to obtain master
 view or slave view camera:
 cullVisitor-getRenderStage()-getCamera()

 Depending on your setup of extra cameras it may wortk or not, but I guess
 you could try it.

 Cheers,
 Wojtek Lewandowski



 - Original Message -
 *From:* Emmanuel Roche roche.emman...@gmail.com
 *To:* OSG Users osg-users@lists.openscenegraph.org
 *Sent:* Friday, January 29, 2010 1:08 PM
 *Subject:* [osg-users] uniform update question

 Hi everyone,

 I'm facing a problem I cannot solve by myself here, I thought I could just
 ask:

 - I have a scene (so a scene graph)
 - I use multiple View on this single scene

 -- Currently I have an homemade mixture of customized osgViewer::Viewer
 objects to deal with everything so basically, for each View, I go through a
 complete (EventTraversal(), UpdateTraversal(), RenderingTraversals() ) loop
 sequentially.

 - Now I would like to switch to a CompositeViewer and thus go through the
 event/update traversals only once per Scene (If I understand the
 CompositeViewer design properly).

 But I have a very specific problem to solve here:

 In my scene graph I use shaders and uniforms. those uniforms have update
 callbacks, and in those update callbacks, I retrieve my currently rendering
 View and then the View matrix to generate eye coordinates.

 -- I assume using the osg_ViewMatrix uniform is not an option for me
 because I need to convert very big position vector and very big view matrix
 translation, and I would clearly get a problem here if I don't have double
 precision.
 -- With the CompositeViewer I can't access the individual View anymore
 in the update traversal() since this process is View agnostic I would say.


 -- Since my views will need different settings for the uniforms, I was
 thinking I would just need to do something in the cull traversal, but here I
 realized something which seems strange to me: there is no such method as
 uniform::setCullCallback(...)

 So, the question is, how would you update your uniforms properly in that
 case ?

 I mean, I could still put a cullcallback on the node owning the stateset
 containing the uniform for instance and update from here (assuming I can
 retrieve the Viewmatrix I need somehow in that Cullcallback...) but is this
 really the best option ??

 - And generally speaking, would a uniform::setCullCallback() not make sense
 for some reason I'm apparently missing for now ?

 Bonus question by the way: How would I access the master camera
 ViewMatrix in a cullcallback ? i've seen we have
 osgUtil::CullVisitor::getCurrentCamera() but would this return the Master
 camera of the View or just the current camera in the scene graph (as I use
 DepthPartitionNode I have many sub cameras in my scene...)

 Thanks in advance is someone has any tip/advise/complete solution on those
 questions!

 Regards,
 Manu.

  --

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


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


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


Re: [osg-users] Image-setData(unsigned char* data,AllocationMode allocationMode);

2010-01-29 Thread Mourad Boufarguine
Hi Roman,

Have you tried just casting data to unsigned char* ?

data = new float[256*64*3];
f = fopen(data/transmittance.raw, rb);
fread(data, 1, 256*64*3*sizeof(float), f);
fclose(f);
osg::Image* image_Transmittance = new osg::Image;
image_Transmittance-setImage(64,16,1, GL_RGB16F_ARB, GL_RGB16F_ARB,
GL_FLOAT,(unsigned char*) data, osg::Image::USE_NEW_DELETE);


Mourad

On Fri, Jan 29, 2010 at 2:46 PM, Roman Grigoriev grigor...@gosniias.ruwrote:

 Hi, J.P.
 Now I use this method and it works.

 data = new float[256*64*3];
f = fopen(data/transmittance.raw, rb);
fread(data, 1, 256*64*3*sizeof(float), f);
fclose(f);
osg::Image* image_Transmittance = new osg::Image;
image_Transmittance-allocateImage(64,16,1,GL_RGB16F_ARB,
 GL_FLOAT,1);
 float* dataPtr = (float*)image_Transmittance-data();
 for(int i=0;i256*64*3;i++)
{
*dataPtr++ = data[i];
}

 And I simply want to use
  image-setImage(64,16,1, GL_RGB16F_ARB, GL_RGB16F_ARB, GL_FLOAT, data,
 osg::Image::USE_NEW_DELETE);
 but it doesn't works. In osgprerender I found solution using first method
 when you have loops to copy data.


 Thank you!

 Cheers,
 Roman

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





 ___
 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] Image-setData(unsigned char* data,AllocationMode allocationMode);

2010-01-29 Thread J.P. Delport

Hi,

Roman Grigoriev wrote:
Hi, J.P. 
Now I use this method and it works.


data = new float[256*64*3];
f = fopen(data/transmittance.raw, rb);
fread(data, 1, 256*64*3*sizeof(float), f);
fclose(f);
osg::Image* image_Transmittance = new osg::Image;
image_Transmittance-allocateImage(64,16,1,GL_RGB16F_ARB, GL_FLOAT,1);
 float* dataPtr = (float*)image_Transmittance-data();
 for(int i=0;i256*64*3;i++)
{
*dataPtr++ = data[i];
}


you don't need the loop or allocateImage.

I'm assuming your image is 64x16 RGB.

try this...

data = new float[64*16*3]; // you're already working in floats, no need 
to *4

fread(data, 1, 64*16*3*sizeof(float), f); // 3 is for RGB
close(f);
osg::Image* image_Transmittance = new osg::Image;
image_Transmittance-setImage(64,16,1, GL_RGB, GL_RGB32F_ARB, GL_FLOAT, 
(unsigned char*)data, osg::Image::NO_DELETE);


now you are responsible for deallocating data. Try this before switching 
to 16F_ARB.


jp



And I simply want to use 
 image-setImage(64,16,1, GL_RGB16F_ARB, GL_RGB16F_ARB, GL_FLOAT, data, osg::Image::USE_NEW_DELETE);

but it doesn't works. In osgprerender I found solution using first method when 
you have loops to copy data.


Thank you!

Cheers,
Roman

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





___
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] osgprerendercubemap

2010-01-29 Thread Robert Osfield
Hi Nick,

I've just reviewed the changes and come away more confused about this
example.  This example is meant to be about set up of pre rendering a
cubemap, not about shaders.  Lot's of #if #else #endif blocks also
don't make an example clearer, they make it far harder to follow.

As it it stands I don't feel these changes are a step forward for this
example, so I won't be merging them as is.

Robert.

On Wed, Jan 27, 2010 at 3:23 PM, Trajce Nikolov
nikolov.tra...@gmail.com wrote:
 Hi Robert,
 attached is slighly modified and corrected example with multitexturing with
 prerendered cubemaps. There was an issue with the uniforms that are cube
 samplers. also, it has the correct OpenGL coordinate system now. I think it
 should replace the existing example. I spent one day to figure things for
 real application out of this example and believe some one else could benefit
 from it
 Nick

 http://www.linkedin.com/in/tnick

 ___
 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] osgprerendercubemap

2010-01-29 Thread Trajce Nikolov
ok .. I was in situation to start from this example and implement this
methods in real world example. Did not work straightforward so I spent a day
to figure it out why. I was thinking it might be useful for someone else in
similar position ...

Nick

http://www.linkedin.com/in/tnick


On Fri, Jan 29, 2010 at 5:37 PM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Nick,

 I've just reviewed the changes and come away more confused about this
 example.  This example is meant to be about set up of pre rendering a
 cubemap, not about shaders.  Lot's of #if #else #endif blocks also
 don't make an example clearer, they make it far harder to follow.

 As it it stands I don't feel these changes are a step forward for this
 example, so I won't be merging them as is.

 Robert.

 On Wed, Jan 27, 2010 at 3:23 PM, Trajce Nikolov
 nikolov.tra...@gmail.com wrote:
  Hi Robert,
  attached is slighly modified and corrected example with multitexturing
 with
  prerendered cubemaps. There was an issue with the uniforms that are cube
  samplers. also, it has the correct OpenGL coordinate system now. I think
 it
  should replace the existing example. I spent one day to figure things for
  real application out of this example and believe some one else could
 benefit
  from it
  Nick
 
  http://www.linkedin.com/in/tnick
 
  ___
  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] uniform update question

2010-01-29 Thread Wojciech Lewandowski
Hi Manu,

I always thought update callback gets called only once. Update visitor differs 
from cull visitor in this regard. 

Wojtek

  - Original Message - 
  From: Emmanuel Roche 
  To: OpenSceneGraph Users 
  Sent: Friday, January 29, 2010 3:01 PM
  Subject: Re: [osg-users] uniform update question


  Hello Wojtek,

  thanks for the tips !!
  I will try with getRenderStage()-getCamera() and let you know if it works 
for me too.

  But concerning the cull callback for uniforms, isn't it already the case for 
the update callback you can put on them ? (if you use the same uniform in 
multiple statesets/nodes, then the update callback is called multiple times per 
frame... [or is there some kind of security system to prevent this I'm not 
aware of ? ]

  Cheers,
  Manu.



  2010/1/29 Wojciech Lewandowski lewandow...@ai.com.pl

Hi Manu,

IMHO I can offfer tips for 2 or your questions: 

Why no cull calback for uniform ?
I guess there is no cull calback for state attribs/uniforms because they 
could be used many times and located in many statesets/nodes. So cull visitor 
can traverse them couple times per one frame.

How to obtain master camera view matrix ?
In ViewDependentShadowTechniques I used following method to obtain master 
view or slave view camera:
cullVisitor-getRenderStage()-getCamera() 

Depending on your setup of extra cameras it may wortk or not, but I guess 
you could try it.

Cheers,
Wojtek Lewandowski


  - Original Message - 
  From: Emmanuel Roche 
  To: OSG Users 
  Sent: Friday, January 29, 2010 1:08 PM
  Subject: [osg-users] uniform update question


  Hi everyone,

  I'm facing a problem I cannot solve by myself here, I thought I could 
just ask:

  - I have a scene (so a scene graph)
  - I use multiple View on this single scene

  -- Currently I have an homemade mixture of customized 
osgViewer::Viewer objects to deal with everything so basically, for each View, 
I go through a complete (EventTraversal(), UpdateTraversal(), 
RenderingTraversals() ) loop sequentially.

  - Now I would like to switch to a CompositeViewer and thus go through the 
event/update traversals only once per Scene (If I understand the 
CompositeViewer design properly).

  But I have a very specific problem to solve here:

  In my scene graph I use shaders and uniforms. those uniforms have update 
callbacks, and in those update callbacks, I retrieve my currently rendering 
View and then the View matrix to generate eye coordinates.

  -- I assume using the osg_ViewMatrix uniform is not an option for me 
because I need to convert very big position vector and very big view matrix 
translation, and I would clearly get a problem here if I don't have double 
precision. 
  -- With the CompositeViewer I can't access the individual View anymore 
in the update traversal() since this process is View agnostic I would say.


  -- Since my views will need different settings for the uniforms, I was 
thinking I would just need to do something in the cull traversal, but here I 
realized something which seems strange to me: there is no such method as 
uniform::setCullCallback(...) 

  So, the question is, how would you update your uniforms properly in that 
case ?

  I mean, I could still put a cullcallback on the node owning the stateset 
containing the uniform for instance and update from here (assuming I can 
retrieve the Viewmatrix I need somehow in that Cullcallback...) but is this 
really the best option ??

  - And generally speaking, would a uniform::setCullCallback() not make 
sense for some reason I'm apparently missing for now ?

  Bonus question by the way: How would I access the master camera 
ViewMatrix in a cullcallback ? i've seen we have 
osgUtil::CullVisitor::getCurrentCamera() but would this return the Master 
camera of the View or just the current camera in the scene graph (as I use 
DepthPartitionNode I have many sub cameras in my scene...)

  Thanks in advance is someone has any tip/advise/complete solution on 
those questions!

  Regards,
  Manu.




--


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


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






--


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

Re: [osg-users] website down?

2010-01-29 Thread Chris 'Xenon' Hanson
On 1/29/2010 6:09 AM, Raymond de Vries wrote:
 Hi everyone,
 Fyi: I just noticed that www.openscenegraph.org is down...

  Confirmed from the US.

 regards
 Raymond

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] website down?

2010-01-29 Thread Chris 'Xenon' Hanson
On 1/29/2010 6:09 AM, Raymond de Vries wrote:
 Hi everyone,
 Fyi: I just noticed that www.openscenegraph.org is down...

  Actualy, I take it back. It did load eventually, just VERY slow.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] need testers

2010-01-29 Thread Trajce Nikolov
Hi community,

can some of you find a minute or two to just run the attached source (it is
based on the #define NUM_LIGHTS) on the hardware you have and see if it
runs, and if so just let me know what is the OS and the hardware?

Thanks a lot for the help!

Nick

http://www.linkedin.com/in/tnick
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
 *
 * This application is open source and may be redistributed and/or modified   
 * freely and without restriction, both in commericial and non commericial 
applications,
 * as long as this copyright notice is maintained.
 * 
 * This application is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

#include osgDB/ReadFile
#include osgDB/WriteFile
#include osgUtil/Optimizer
#include osg/CoordinateSystemNode

#include osg/Switch
#include osg/LightSource
#include osgText/Text

#include osgViewer/Viewer
#include osgViewer/CompositeViewer
#include osgViewer/ViewerEventHandlers

#include osgGA/TrackballManipulator
#include osgGA/FlightManipulator
#include osgGA/DriveManipulator
#include osgGA/KeySwitchMatrixManipulator
#include osgGA/StateSetManipulator
#include osgGA/AnimationPathManipulator
#include osgGA/TerrainManipulator

#include osgSim/OverlayNode
#include osg/Geode
#include osgText/Text3D
#include osg/MatrixTransform
#include osg/ShapeDrawable
#include osg/TexGen
#include osg/TexGenNode

#include osg/CullFace
#include osg/PolygonOffset

#include iostream
#include sstream

#include osg/Geometry
#include osg/Geode
#include osg/LightSource
#include osg/LightModel
#include osg/Program
#include osg/ImageStream
#include osg/TextureRectangle
#include osg/TexMat
#include osg/BlendFunc
#include osg/AlphaFunc
#include osg/Material

#include osgUtil/SmoothingVisitor
#include osg/ShapeDrawable

#include osg/PositionAttitudeTransform
#include osg/TextureRectangle

#define NUM_LIGHTS 7

#if 1

osg::Matrixd createTransformMatrix(double x, double y, double z, double h, 
double p, double r)
{
osg::Matrixd mxR;
mxR.makeRotate(osg::DegreesToRadians(r),osg::Vec3(0,1,0));
osg::Matrixd mxP;
mxP.makeRotate(osg::DegreesToRadians(p),osg::Vec3(1,0,0));
osg::Matrixd mxH;
mxH.makeRotate(osg::DegreesToRadians(h),osg::Vec3(0,0,1));
osg::Matrixd mxT;
mxT.makeTranslate(osg::Vec3(x,y,z));

return (mxR*mxP*mxH*mxT);
}

class DrawableDrawWithDepthShadowComparisonOffCallback: 
public osg::Drawable::DrawCallback
{
public:
// 
DrawableDrawWithDepthShadowComparisonOffCallback
( osg::Texture2D * texture, unsigned stage = 0 )
: _texture( texture ), _stage( stage )
{
}

virtual void drawImplementation
( osg::RenderInfo  ri,const osg::Drawable* drawable ) const
{
if( _texture.valid() ) {
// make sure proper texture is currently applied
ri.getState()-applyTextureAttribute( _stage, _texture.get() );

// Turn off depth comparison mode
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, 
 GL_NONE );
}

drawable-drawImplementation(ri);

if( _texture.valid() ) {
// Turn it back on
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, 
 GL_COMPARE_R_TO_TEXTURE_ARB );
}
}

osg::ref_ptr osg::Texture2D  _texture;
unsigned   _stage;
};

class UpdateLMVPM : public osg::Uniform::Callback
{
public:
UpdateLMVPM(const std::vectorosg::Camera* cameras)
: mCameras(cameras)
{
}
virtual void operator () (osg::Uniform* u, osg::NodeVisitor*)
{
for (unsigned int i=0; imCameras.size(); ++i)
{
osg::Camera* camera = mCameras.at(i);
osg::Matrixf lmvpm =
camera-getViewMatrix() * camera-getProjectionMatrix() *
osg::Matrix::translate( 1,1,1 ) * osg::Matrix::scale( 0.5, 0.5, 
0.5 );

u-setElement(i,lmvpm);
}
}

protected:
std::vectorosg::Camera*   mCameras;
};

class UpdateLMVPMS : public osg::Uniform::Callback
{
public:
UpdateLMVPMS(osg::Camera* camera)
: mCamera(camera)
{
}
virtual void operator () (osg::Uniform* u, osg::NodeVisitor*)
{
osg::Camera* camera = mCamera;
osg::Matrixf lmvpm =
camera-getViewMatrix() * camera-getProjectionMatrix() *
osg::Matrix::translate( 1,1,1 ) * osg::Matrix::scale( 0.5, 0.5, 
0.5 );

u-set(lmvpm);
}

protected:
osg::Camera* mCamera;
};

std::vector osg::ref_ptrosg::MatrixTransform  LightLobes;
osg::Node* createScene(osg::ArgumentParser arguments, osgViewer::Viewer* 
viewer = 0)
{
osg::Group* group = new osg::Group;

Re: [osg-users] website down?

2010-01-29 Thread Maxim Gammer
Hi

VERY slow !

Russia, Tyumen.

2010/1/29 Chris 'Xenon' Hanson xe...@alphapixel.com

 On 1/29/2010 6:09 AM, Raymond de Vries wrote:
  Hi everyone,
  Fyi: I just noticed that www.openscenegraph.org is down...

   Actualy, I take it back. It did load eventually, just VERY slow.

 --
 Chris 'Xenon' Hanson, omo sanza lettere  Xenon
 AlphaPixel.com
 PixelSense Landsat processing now available!
 http://www.alphapixel.com/demos/
 There is no Truth. There is only Perception. To Perceive is to Exist. -
 Xen
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




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


Re: [osg-users] need testers

2010-01-29 Thread Terry Welsh
Works for me.  Suse 11.1, Intel Q9400, GeForce 280 GTX.
--
Terry


 Message: 13
 Date: Fri, 29 Jan 2010 19:49:22 +0200
 From: Trajce Nikolov nikolov.tra...@gmail.com
 To: OpenSceneGraph Users osg-users@lists.openscenegraph.org
 Subject: [osg-users] need testers
 Message-ID:
        6861bc941001290949m37d09c2fu41019e7f14beb...@mail.gmail.com
 Content-Type: text/plain; charset=iso-8859-1

 Hi community,

 can some of you find a minute or two to just run the attached source (it is
 based on the #define NUM_LIGHTS) on the hardware you have and see if it
 runs, and if so just let me know what is the OS and the hardware?

 Thanks a lot for the help!

 Nick

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


Re: [osg-users] need testers

2010-01-29 Thread Trajce Nikolov
Thanks Terry ..
Nick

http://www.linkedin.com/in/tnick


On Fri, Jan 29, 2010 at 8:11 PM, Terry Welsh mogu...@gmail.com wrote:

 Works for me.  Suse 11.1, Intel Q9400, GeForce 280 GTX.
 --
 Terry


  Message: 13
  Date: Fri, 29 Jan 2010 19:49:22 +0200
  From: Trajce Nikolov nikolov.tra...@gmail.com
  To: OpenSceneGraph Users osg-users@lists.openscenegraph.org
  Subject: [osg-users] need testers
  Message-ID:
 6861bc941001290949m37d09c2fu41019e7f14beb...@mail.gmail.com
  Content-Type: text/plain; charset=iso-8859-1
 
  Hi community,
 
  can some of you find a minute or two to just run the attached source (it
 is
  based on the #define NUM_LIGHTS) on the hardware you have and see if it
  runs, and if so just let me know what is the OS and the hardware?
 
  Thanks a lot for the help!
 
  Nick
 
 ___
 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] uniform update question

2010-01-29 Thread Paul Martz
I recommend you search the archives for the recent thread Uniform per 
slave Camera. Several solutions, including the solution I eventually 
used, are discussed in that thread.


Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ http://www.skew-matrix.com/
+1 303 859 9466



Emmanuel Roche wrote:

Hi everyone,

I'm facing a problem I cannot solve by myself here, I thought I could 
just ask:


- I have a scene (so a scene graph)
- I use multiple View on this single scene

-- Currently I have an homemade mixture of customized 
osgViewer::Viewer objects to deal with everything so basically, for each 
View, I go through a complete (EventTraversal(), UpdateTraversal(), 
RenderingTraversals() ) loop sequentially.


- Now I would like to switch to a CompositeViewer and thus go through 
the event/update traversals only once per Scene (If I understand the 
CompositeViewer design properly).


But I have a very specific problem to solve here:

In my scene graph I use shaders and uniforms. those uniforms have update 
callbacks, and in those update callbacks, I retrieve my currently 
rendering View and then the View matrix to generate eye coordinates.


-- I assume using the osg_ViewMatrix uniform is not an option for me 
because I need to convert very big position vector and very big view 
matrix translation, and I would clearly get a problem here if I don't 
have double precision.
-- With the CompositeViewer I can't access the individual View 
anymore in the update traversal() since this process is View agnostic 
I would say.



-- Since my views will need different settings for the uniforms, I was 
thinking I would just need to do something in the cull traversal, but 
here I realized something which seems strange to me: there is no such 
method as uniform::setCullCallback(...)


So, the question is, how would you update your uniforms properly in that 
case ?


I mean, I could still put a cullcallback on the node owning the stateset 
containing the uniform for instance and update from here (assuming I 
can retrieve the Viewmatrix I need somehow in that Cullcallback...) but 
is this really the best option ??


- And generally speaking, would a uniform::setCullCallback() not make 
sense for some reason I'm apparently missing for now ?


Bonus question by the way: How would I access the master camera 
ViewMatrix in a cullcallback ? i've seen we have 
osgUtil::CullVisitor::getCurrentCamera() but would this return the 
Master camera of the View or just the current camera in the scene graph 
(as I use DepthPartitionNode I have many sub cameras in my scene...)


Thanks in advance is someone has any tip/advise/complete solution on 
those questions!


Regards,
Manu.




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

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


Re: [osg-users] [3rdparty] osgearth crashes when I load a shape file

2010-01-29 Thread Martin Scheffler
It's the data included in the SVN, and the example that I linked in the first 
post.


Thank you!

Cheers,
Martin

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





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


Re: [osg-users] [3rdparty] osgearth crashes when I load a shape file

2010-01-29 Thread Glenn Waldron
Martin,
This is working correctly on my end. Are you using osgEarth 1.3? Can you
confirm that you have a usa.prj file alongside your usa.shp?

Glenn Waldron : Pelican Mapping : +1.703.652.4791


On Fri, Jan 29, 2010 at 3:45 PM, Martin Scheffler osgfo...@tevs.eu wrote:

 It's the data included in the SVN, and the example that I linked in the
 first post.


 Thank you!

 Cheers,
 Martin

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





 ___
 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 testers

2010-01-29 Thread Ulrich Hertlein
Hi Nick,

On 30/01/10 4:49 , Trajce Nikolov wrote:
 can some of you find a minute or two to just run the attached source (it
 is based on the #define NUM_LIGHTS) on the hardware you have and see if
 it runs, and if so just let me know what is the OS and the hardware?

I'm getting these runtime errors on OS X 10.5, GeForce 8600M GT:

$ ./nicktest
glLinkProgram microshader FAILED
Program microshader infolog:
ERROR: Implementation limit of 40 varying components exceeded, linked shaders 
use 24 too
many varying component(s).

Warning: detected OpenGL error 'invalid operation' at After Renderer::compile
MAX TEXTURE UNITS16
GraphicsWindowCarbon: VSync=on

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


[osg-users] quicktime plugin fails to compile on OS X 10.5

2010-01-29 Thread Ulrich Hertlein
Hi guys,

the quicktime plugin (trunk, r11031) doesn't compile (cmake) for me under OS X 
10.5.8:

/Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/quicktime/MovieData.cpp: 
In member
function ‘void MovieData::load(osg::Image*, std::string, float)’:
/Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/quicktime/MovieData.cpp:96:
 error:
base operand of ‘-’ has non-pointer type ‘OpaqueRgnHandle’

(This line was last changed in r11019.)

The only mention of 'OpaqueRgnHandle' that I've found is in QuickdrawTypes.h 
but doesn't
look like it would solve the issue:

typedef struct OpaqueRgnHandle* RgnHandle;

I'm not too familiar with QT/QD anyhow so I thought I'd flag it here instead.

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


Re: [osg-users] uniform update question

2010-01-29 Thread Emmanuel Roche
Thanks Paul,

Those questions were indeed closely related. Yet since I'm not planing to
use slave cameras for the moment I guess I'm better of with my node
cullcallback to update uniforms, at least I will try that.

Cheers,
Manu.


2010/1/29 Paul Martz pma...@skew-matrix.com

 I recommend you search the archives for the recent thread Uniform per
 slave Camera. Several solutions, including the solution I eventually used,
 are discussed in that thread.

 Paul Martz
 Skew Matrix Software LLC
 _http://www.skew-matrix.com_ http://www.skew-matrix.com/
 +1 303 859 9466



 Emmanuel Roche wrote:

 Hi everyone,

 I'm facing a problem I cannot solve by myself here, I thought I could just
 ask:

 - I have a scene (so a scene graph)
 - I use multiple View on this single scene

 -- Currently I have an homemade mixture of customized osgViewer::Viewer
 objects to deal with everything so basically, for each View, I go through a
 complete (EventTraversal(), UpdateTraversal(), RenderingTraversals() ) loop
 sequentially.

 - Now I would like to switch to a CompositeViewer and thus go through the
 event/update traversals only once per Scene (If I understand the
 CompositeViewer design properly).

 But I have a very specific problem to solve here:

 In my scene graph I use shaders and uniforms. those uniforms have update
 callbacks, and in those update callbacks, I retrieve my currently rendering
 View and then the View matrix to generate eye coordinates.

 -- I assume using the osg_ViewMatrix uniform is not an option for me
 because I need to convert very big position vector and very big view matrix
 translation, and I would clearly get a problem here if I don't have double
 precision.
 -- With the CompositeViewer I can't access the individual View anymore
 in the update traversal() since this process is View agnostic I would say.


 -- Since my views will need different settings for the uniforms, I was
 thinking I would just need to do something in the cull traversal, but here I
 realized something which seems strange to me: there is no such method as
 uniform::setCullCallback(...)

 So, the question is, how would you update your uniforms properly in that
 case ?

 I mean, I could still put a cullcallback on the node owning the stateset
 containing the uniform for instance and update from here (assuming I can
 retrieve the Viewmatrix I need somehow in that Cullcallback...) but is this
 really the best option ??

 - And generally speaking, would a uniform::setCullCallback() not make
 sense for some reason I'm apparently missing for now ?

 Bonus question by the way: How would I access the master camera
 ViewMatrix in a cullcallback ? i've seen we have
 osgUtil::CullVisitor::getCurrentCamera() but would this return the Master
 camera of the View or just the current camera in the scene graph (as I use
 DepthPartitionNode I have many sub cameras in my scene...)

 Thanks in advance is someone has any tip/advise/complete solution on those
 questions!

 Regards,
 Manu.


 


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

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

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