Re: [osg-users] Video as background

2010-01-11 Thread Serge Lages
Hi,

On Windows and Mac you can have video with alpha thanks to the Quicktime
plugin, try the PNG codec, it works great !

Cheers,

On Mon, Jan 11, 2010 at 8:09 AM, Trajce Nikolov wrote:

> Make a shader Eduardo. DIscard the "chroma key" fragment and you will get
> that result
>
> Nick
>
> http://www.linkedin.com/in/tnick
> Sent from Izmit, 41, Turkey
>
> On Sun, Jan 10, 2010 at 11:52 PM, Eduardo Pinheiro  gmail.com> wrote:
>
>> Hi,
>>
>> Does anyone now how to had a video with alpha channel?
>>
>> like in the picture in attachment.
>>
>>
>> Thank you!
>>
>> Cheers,
>> Eduardo
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=22349#22349
>>
>>
>>
>>
>> Attachments:
>>
>> http://forum.openscenegraph.org//files/screen_shot_2010_01_10_at_124655_171.png
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
Serge Lages
http://www.tharsis-software.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLod & dataBasePager memory managment

2010-01-11 Thread Robert Osfield
Hi Vincent,

On Fri, Jan 8, 2010 at 2:30 PM, Vincent Bourdier
 wrote:
> Is there a way to manage memory usage with the load of models ?
> In my case I have a lot of PagedLod to load, and my question is : is there a
> way to know is memory is sufficient for the next PageLod higher level node ?
> I just would like to stop the data loading when memory usage exceed some
> point.

The DatabasePager in svn/trunk + 2.9.x has the ability to cap the
number of PagedLOD to a maximum, and automatically recycles PagedLOD
children that aren't in the current view when new PagedLOD are
required by the current view.  What this capping doesn't do is stop
the loading of new PagedLOD, so if a single view requires a PagedLOD
it will be loaded.  To set the cap level programmatically via:


viewer.getDatabasePager()->setTargetMaximumNumberOfPageLOD(targetNumOfPaged);

Or using env var:

set OSG_MAX_PAGEDLOD=200

Another feature of svn/trunk + 2.9.x is that texture and buffer
object's pools that also provide a maximum cap on the number of
texture objects and vbo/pbo/ebo's that can be allocated at any one
time.  You can set it programmatically via:

   
osg::Texture::getTextureObjectManager(contextID)->setNumberActiveTextureObjects(targetNumBytes);

Or using env var:

set OSG_TEXTURE_POOL_SIZE=64000

Like the PagedLOD target, the texture pool size is only a target, and
if a single frame requires more memory than this it will allocated
more memory to prevent any thrashing of memory  within a single frame.
 I did do tests with a strict limit on memory size but when a single
frame requires more than this the memory thrashing cut performance
down to a fraction of it's normal, for instance going from a solid
60Hz to 1 or 2Hz.

If you wanted the LOD control then you just implement this yourself
using osgDB::Registry::ReadFileCallback that loads the tiles and then
modifies PagedLOD that it loads that are higher than a certain
resolution.

Or... just adjust the viewer's Camera::LODScale pre frame to manage
the on screen screen complexity.

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


Re: [osg-users] Conversion from 'GLsizeiptrARB' to 'const GLvoid *' of greater size

2010-01-11 Thread Robert Osfield
Hi J-S,

I'm afraid I don't have any further ideas.  I think we just have to
return to the time/space machine that eradicates all Windows installs
and replaces them with a less troublesome development platform ;-)

Disabling the warning would not be idea as it could hide some genuine
problems.  Perhaps just disable it for the files that are causing
problems?

Robert.

On Fri, Jan 8, 2010 at 3:32 PM, Jean-Sébastien Guay
 wrote:
> Hi Robert,
>
>> I'm surprised that you are seeing this warning as for a 32bit build
>> the void* should be 32bits and GLsizeiptr should be 32bit.  When under
>> a 64bit build the GLsizeiptr should be 64bit.
>>
>> Even if GLsizeiptr was 32bit and void* was 64bit one should still be
>> able to cast it safely, the compiler should promote it OK.  Only if we
>> were going from 64bit to 32bit would problems likely occur, but even
>> then in this context it's pretty unlikely that you'd be using VBO's
>> bigger than 4GB.
>
> Yeah, seems weird to me too. Is anyone else seeing this?
>
>> As for fixing the warning, your could try static_cast<> rather than a C
>> cast.
>
> Using static_cast gives this:
>
> c:\dev\openscenegraph-svn\openscenegraph\include\osg\state(568) : error
> C2440: 'static_cast' : cannot convert from 'GLsizeiptrARB' to 'const GLvoid
> *'
>        Conversion from integral type to pointer type requires
> reinterpret_cast, C-style cast or function-style cast
>
> Then trying reinterpret_cast (since we know the C-style cast gives the
> "greater size" warning already) gives this:
>
> c:\dev\openscenegraph-svn\openscenegraph\include\osg\state(568) : warning
> C4312: 'reinterpret_cast' : conversion from 'GLsizeiptrARB' to 'const GLvoid
> *' of greater size
>
> ARGH! Same result as the original C-style cast.
>
> And just to be completely sure the warning is totally bogus, as a little
> test I tried to print out sizeof(const GLvoid*) and sizeof(GLsizeiptrARB)
> which gives this:
>
> const GLvoid*: 4     GLsizeiptrARB: 4
>
> Double ARGH!
>
> I'm totally out of ideas... Unless you want to disable this warning
> (4312)...
>
> J-S
> --
> __
> Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
>                               http://www.cm-labs.com/
>                        http://whitestar02.webhop.org/
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] resizing embedded windows...

2010-01-11 Thread Robert Osfield
Hi Shayne,

I haven't personally tried doing exactly what you are doing, but try
changing the GraphicsWindowEmbedded context's size, and also try
enable it's clear as the graphics context by default leaves it's own
clear disabled leaving it to the clear done during the rendering of
the Camera's scene graph that is clamped to the Camera's viewport.

Another thing you could try is doing your own clear before the call to
viewer.frame().

Robert.

On Fri, Jan 8, 2010 at 11:05 PM, Tueller, Shayne R Civ USAF AFMC 519
SMXS/MXDEC  wrote:
> All,
>
>
>
> I’m in the process of porting an OGL app using GLUT to OSG using osgViewer.
>
>
>
> Currently this app has multiple viewports embedded in a single GLUT window
> where one of the viewports is rendering a 3D view into a scene. Due to time
> constraints, I want to replace the 3D viewport with an embedded OSG viewer
> into the GLUT window as an interim solution. It should be noted, that the
> embedded window is a small subset of the larger GLUT window (GLUT is using
> game mode). Using the osgviewerGLUT example as a guide, I’ve been able to
> get things working but I’ve run into a snag. I have a need to resize the
> embedded window on occasion and I can’t get it to work properly. When I
> resize the embedded window by setting viewer->getCamera()->setViewport(x, y,
> width, height), the new embedded window appears just fine but I still have
> portions of the old embedded window left over as if the “clear” didn’t
> happen. I’ve tried several ways of getting the old embedded window to clear
> out without success. It’s as if I can’t override the original settings when
> I created the embedded window using
> viewer->setUpViewerAsEmbeddedInWindow(…).
>
>
>
> Has anyone run into this problem or know of a good/correct way of resizing
> or moving embedded OSG windows in a larger GLUT window? If it can’t be done,
> it would be nice to know so that I don’t spend an exorbitant amount of time
> trying to get it to work…
>
>
>
> For the record, I’m aware of the shortcomings and drawbacks about using GLUT
> with OSG. Again, my attempt here is to come up with a stopgap measure until
> I can get the entire port to osgViewer completed.
>
>
>
> Thanks in advance,
>
> -Shayne
>
> ___
> 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] DrawCallback only once

2010-01-11 Thread Robert Osfield
Hi Dominc,

The best way to do a single GL test at startup is to attach a custom
osg::GraphicsOperation as a RealizeOperation to the viewer, and this
gets called once the viewer's graphics contexts get realized.

Have a look at the osgcatch, osgshaderterrrain and osgvolume examples
to see examples of the above in action.

Robert.

On Fri, Jan 8, 2010 at 8:50 PM, Dominic Stalder
 wrote:
> Hi there
>
> I would like to read the OpenGL extensions with isGLExtensionSupported(),
> but for this I need a draw context. I registred a DrawCallback Class, see
> below. I need to call the operator() method only once, but because this
> method is const, I cannot write to the member variable bool first. How can I
> resolve this problem?
>
>        class GameViewOSGDrawCallback : public osg::Camera::DrawCallback
>        {
>        private:
>            GameViewOSG *parent;
>            bool first;
>
>        public:
>            GameViewOSGDrawCallback(GameViewOSG* parent=0);
>
>            virtual void operator()(const osg::Camera&) const;
>        };
>
> Thanks a lot
> Dominic
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Information on ffmpeg thread safety

2010-01-11 Thread Robert Osfield
Hi Garret,

On Sat, Jan 9, 2010 at 3:27 PM, Garrett Potts  wrote:
> After researching and talking with some others there is a way to make ffmpeg
> thread safe but you need to add a call back via the lock register api found
> in libavcodec and compile ffmpeg with thread support enabled.  Internally
> they use the lock callback to allow for global synchronization access to the
> libavcodec library.  I am going to try and test this out this week.

Thanks for the updated.  Could you tell us how you get on, and what
you found worked/didn't work so when we tackle the ffmpeg plugin we
can take the short cut straight to the solution.

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


Re: [osg-users] shader composition

2010-01-11 Thread Robert Osfield
Hi Nick,

On Sat, Jan 9, 2010 at 7:20 PM, Trajce Nikolov  wrote:
> while ago you mentioned this is something upcoming. I am talking about
> composition of shaders in the osg core - something like the osg candidate
> virtual program. Any news about this?

I haven't dived back into work on shader composition yet.  Over the
Christmas break I did some pontificating on the issue of managing
large numbers of active light sources + associated shadows, and this
all pointed for the need for collecting lists of light source
contributing to the current view frustum and then dynamically
assigning GLSL programs + uniforms that fit this.  Such as scheme
really requires dynamic shader composition...

My plan is to clear my email back log, get a dev release out, complete
further work on lights+shadows in the OpenSceneGraph-Demos and then
dive back into shader composition.

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


[osg-users] readPixels return blank image

2010-01-11 Thread forest
hi all,
 I want to capture the screen ,what I have done is to add a eventhandler in 
which I add code like this
  
 osg::ref_ptr image = new osg::Image;
image->readPixels(0,0,m_iWidth,m_iHeight, GL_RGB,GL_UNSIGNED_BYTE);
osgDB::writeImageFile(*image,"D:\\abc.bmp");
  
 what I get is blank image.
 I googled that maybe I should do this in DrawCallBack. I eagerly want to know 
why my code doesn't work. Is pixel in FBO erased before EventTraverse ?
  
 Thanks for any hint
 best regards
 forest___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] readPixels return blank image

2010-01-11 Thread Ismail Pazarbasi
2010/1/11 forest :
> hi all,
> I want to capture the screen ,what I have done is to add a eventhandler in
> which I add code like this
>
>     osg::ref_ptr image = new osg::Image;
>     image->readPixels(0,0,m_iWidth,m_iHeight, GL_RGB,GL_UNSIGNED_BYTE);
>     osgDB::writeImageFile(*image,"D:\\abc.bmp");
>
> what I get is blank image.
> I googled that maybe I should do this in DrawCallBack. I eagerly want to
> know why my code doesn't work. Is pixel in FBO erased before EventTraverse ?
>
> Thanks for any hint
> best regards
> forest

If I recall correctly, the reason is OpenGL state. readPixels will
call glReadPixels, which must be called when the context is selected
(i.e. current) and must not be called in between glBegin and glEnd. As
OpenGL is a state machine, some calls can't be made at certain states.

I remember Paul's osgWorks should contain a set of helpers,
facilitating numerous operations, including taking screenshot.
Otherwise, there are too many posts in osg-users group concerning your
question.

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


Re: [osg-users] OSG and streamed video

2010-01-11 Thread Eduardo Pinheiro
Hi,

Did you get this with vlc?

Im streaming the video and im catching well with a vlc client. But osgmovie 
give me: 

Error: No ReaderWriter for file http://192.168.192.38:1234
Unable to read file http://192.168.192.38:1234

Any help?

Thanks


... 

Thank you!

Cheers,
Eduardo

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





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


Re: [osg-users] Autotransform, compositeviewer and small feature culling problems

2010-01-11 Thread Robert Osfield
Hi J.P,

The issue you are hitting up against is a limitation of
osg::AutoTransform in that it only has a single set of state so when
you have two or more views that require different stats you'll get
issues with both views attempting to sets it's value.  The only way to
solve this would be to refactor osg::AutoTransform to have multiple
states in some way.

Robert.

On Mon, Jan 11, 2010 at 7:37 AM, J.P. Delport  wrote:
> Hi all,
>
> we've run into a strange interaction between autotransform and small feature
> culling when using a compositeviewer in one of our apps. The problem can be
> reproduced using the attached icon.osg file. The file contains a cessna with
> an autotransformed image (icon) that travels with it.
>
> Open the file using osg's compositeviewer example:
> osgcompositeviewer icon.osg
>
> Two identical cessna's with the icon overlayed should be displayed in the
> bottom left and bottom right views.
>
> Now zoom in the bottom right view slowly. At some point the icon in the
> bottom _left_ view disappears. If one zooms out the right view again, the
> left icon appears again [1]. If one zooms the right view so that the right
> icon disappears, neither icon comes back when zooming or resetting the view
> (space) [2].
>
> We've had problem [1] in our app and it seems to go away when we disable
> small feature culling. [2] I've only encountered now when I tried to
> reproduce the problem.
>
> Any ideas on where to start searching for a fix for this problem? I started
> by looking at AutoTransform's code and it does seem to keep state that might
> not cater for multiple cameras, but the thing that baffles me is that
> disabling small feature culling fixes [1]. I have not further investigated
> [2].
>
> Any help/pointers appreciated.
>
> regards
> jp
>
> PS. [1] can be reproduced by swapping procedure left/right also. [2] can
> also be reproduced in normal osgviewer.
>
> --
> 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
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Video as background

2010-01-11 Thread Robert Osfield
HI Eduaro,

The new ffmpeg supports video with alpha, I've successfully tested
this with flv videos with alpha.

Robert.

On Sun, Jan 10, 2010 at 9:52 PM, Eduardo Pinheiro
 wrote:
> Hi,
>
> Does anyone now how to had a video with alpha channel?
>
> like in the picture in attachment.
>
>
> Thank you!
>
> Cheers,
> Eduardo
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=22349#22349
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/screen_shot_2010_01_10_at_124655_171.png
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] readPixels return blank image

2010-01-11 Thread Robert Osfield
Hi Forest,

You can only do OpenGL calls from a thread with a valid graphics
context current, event handlers will not have a graphics context
current unless you are running the OSG single threaded.

Use a Camera post or final draw callback to capture the screen image.

Robert.

On Mon, Jan 11, 2010 at 10:53 AM, forest  wrote:
> hi all,
> I want to capture the screen ,what I have done is to add a eventhandler in
> which I add code like this
>
>     osg::ref_ptr image = new osg::Image;
>     image->readPixels(0,0,m_iWidth,m_iHeight, GL_RGB,GL_UNSIGNED_BYTE);
>     osgDB::writeImageFile(*image,"D:\\abc.bmp");
>
> what I get is blank image.
> I googled that maybe I should do this in DrawCallBack. I eagerly want to
> know why my code doesn't work. Is pixel in FBO erased before EventTraverse ?
>
> Thanks for any hint
> best regards
> forest
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG and streamed video

2010-01-11 Thread Robert Osfield
Hi Eduardo,

Which video plugin are you attempting to use?

Robert.

On Mon, Jan 11, 2010 at 12:04 PM, Eduardo Pinheiro
 wrote:
> Hi,
>
> Did you get this with vlc?
>
> Im streaming the video and im catching well with a vlc client. But osgmovie 
> give me:
>
> Error: No ReaderWriter for file http://192.168.192.38:1234
> Unable to read file http://192.168.192.38:1234
>
> Any help?
>
> Thanks
>
>
> ...
>
> Thank you!
>
> Cheers,
> Eduardo
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=22368#22368
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG and streamed video

2010-01-11 Thread Eduardo Pinheiro
Hi,

Im using Linux. I dont know if it gets the xine or the ffmpeg plugin. But its 
one of them.



... 

Thank you!

Cheers,
Eduardo

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





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


Re: [osg-users] Autotransform, compositeviewer and small feature culling problems

2010-01-11 Thread J.P. Delport

Hi Robert,

Robert Osfield wrote:

Hi J.P,

The issue you are hitting up against is a limitation of
osg::AutoTransform in that it only has a single set of state so when
you have two or more views that require different stats you'll get
issues with both views attempting to sets it's value.  The only way to
solve this would be to refactor osg::AutoTransform to have multiple
states in some way.


OK, are there any examples of nodes that keep multiple state that I can 
maybe look at?


As far as I could see the state was kept to avoid unnecessary updates, 
but maybe I can just make one that does not keep state and updates 
regardless of view changes.


Also, do you think the disappearing and not coming back in the osgviewer 
case (one view) is also related to the internal state?


rgds
jp



Robert.

On Mon, Jan 11, 2010 at 7:37 AM, J.P. Delport  wrote:

Hi all,

we've run into a strange interaction between autotransform and small feature
culling when using a compositeviewer in one of our apps. The problem can be
reproduced using the attached icon.osg file. The file contains a cessna with
an autotransformed image (icon) that travels with it.

Open the file using osg's compositeviewer example:
osgcompositeviewer icon.osg

Two identical cessna's with the icon overlayed should be displayed in the
bottom left and bottom right views.

Now zoom in the bottom right view slowly. At some point the icon in the
bottom _left_ view disappears. If one zooms out the right view again, the
left icon appears again [1]. If one zooms the right view so that the right
icon disappears, neither icon comes back when zooming or resetting the view
(space) [2].

We've had problem [1] in our app and it seems to go away when we disable
small feature culling. [2] I've only encountered now when I tried to
reproduce the problem.

Any ideas on where to start searching for a fix for this problem? I started
by looking at AutoTransform's code and it does seem to keep state that might
not cater for multiple cameras, but the thing that baffles me is that
disabling small feature culling fixes [1]. I have not further investigated
[2].

Any help/pointers appreciated.

regards
jp

PS. [1] can be reproduced by swapping procedure left/right also. [2] can
also be reproduced in normal osgviewer.

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



___
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] OSG and streamed video

2010-01-11 Thread Eduardo Pinheiro
Hi,

Im trying now to export it has rtsp:

#osgmovie  rtsp://192.168.192.38:1234/test.dsp 
Warning: Could not find plugin to read objects from file 
"rtsp://192.168.192.38:1234/test.dsp".
Unable to read file rtsp://192.168.192.38:1234/test.dsp

But reading from VLC client its ok.

My plugins dir has:

/usr/local/lib64/osgPlugins-2.8.2$ ls
osgdb_3dc.so   osgdb_gz.soosgdb_osgparticle.so  osgdb_scale.so
osgdb_3ds.so   osgdb_hdr.so   osgdb_osgshadow.soosgdb_shp.so
osgdb_ac.soosgdb_ive.so   osgdb_osgsim.so   osgdb_stl.so
osgdb_bmp.so   osgdb_jp2.so   osgdb_osg.so  osgdb_svg.so
osgdb_bsp.so   osgdb_jpeg.so  osgdb_osgterrain.so   osgdb_tga.so
osgdb_bvh.so   osgdb_logo.so  osgdb_osgtext.so  osgdb_tgz.so
osgdb_cfg.so   osgdb_lwo.so   osgdb_osgtgz.so   osgdb_tiff.so
osgdb_curl.so  osgdb_lws.so   osgdb_osgviewer.soosgdb_trans.so
osgdb_dds.so   osgdb_md2.so   osgdb_osgvolume.soosgdb_txf.so
osgdb_dot.so   osgdb_mdl.so   osgdb_osgwidget.soosgdb_txp.so
osgdb_dw.soosgdb_normals.so   osgdb_pdf.so  osgdb_vtf.so
osgdb_dxf.so   osgdb_obj.so   osgdb_pic.so  osgdb_xine.so
osgdb_freetype.so  osgdb_openflight.soosgdb_png.so  osgdb_x.so
osgdb_gecko.so osgdb_osganimation.so  osgdb_pnm.so  osgdb_zip.so
osgdb_geo.so   osgdb_osga.so  osgdb_rgb.so
osgdb_glsl.so  osgdb_osgfx.so osgdb_rot.so








... 

Thank you!

Cheers,
Eduardo

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





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


Re: [osg-users] OSG and streamed video

2010-01-11 Thread Robert Osfield
Hi Eduardo,

You'll be using the xine plugin right now, this is now being
deprecated by the ffmpeg plugin that you'll find in 2.9.x and
svn/trunk.  You'll need to install the various ffmpeg developer
headers and libs and then remove OpenSceneGraph/CMakeCache.txt and
then re-run cmake to pick up on these.  Once you've got the ffmpeg
plugin compiled you'll need to pre-load the ffmpeg to make sure it's
picked up by osgmovie as currently osgDB doesn't default to selecting
it for video (as the ffmpeg is still in developement.)  Once you've
got things compiled/installed try:

  osgmovie -e ffmpeg mymovie.mpg

Then try you url.

Robert.

On Mon, Jan 11, 2010 at 12:42 PM, Eduardo Pinheiro
 wrote:
> Hi,
>
> Im trying now to export it has rtsp:
>
> #osgmovie  rtsp://192.168.192.38:1234/test.dsp
> Warning: Could not find plugin to read objects from file 
> "rtsp://192.168.192.38:1234/test.dsp".
> Unable to read file rtsp://192.168.192.38:1234/test.dsp
>
> But reading from VLC client its ok.
>
> My plugins dir has:
>
> /usr/local/lib64/osgPlugins-2.8.2$ ls
> osgdb_3dc.so       osgdb_gz.so            osgdb_osgparticle.so  osgdb_scale.so
> osgdb_3ds.so       osgdb_hdr.so           osgdb_osgshadow.so    osgdb_shp.so
> osgdb_ac.so        osgdb_ive.so           osgdb_osgsim.so       osgdb_stl.so
> osgdb_bmp.so       osgdb_jp2.so           osgdb_osg.so          osgdb_svg.so
> osgdb_bsp.so       osgdb_jpeg.so          osgdb_osgterrain.so   osgdb_tga.so
> osgdb_bvh.so       osgdb_logo.so          osgdb_osgtext.so      osgdb_tgz.so
> osgdb_cfg.so       osgdb_lwo.so           osgdb_osgtgz.so       osgdb_tiff.so
> osgdb_curl.so      osgdb_lws.so           osgdb_osgviewer.so    osgdb_trans.so
> osgdb_dds.so       osgdb_md2.so           osgdb_osgvolume.so    osgdb_txf.so
> osgdb_dot.so       osgdb_mdl.so           osgdb_osgwidget.so    osgdb_txp.so
> osgdb_dw.so        osgdb_normals.so       osgdb_pdf.so          osgdb_vtf.so
> osgdb_dxf.so       osgdb_obj.so           osgdb_pic.so          osgdb_xine.so
> osgdb_freetype.so  osgdb_openflight.so    osgdb_png.so          osgdb_x.so
> osgdb_gecko.so     osgdb_osganimation.so  osgdb_pnm.so          osgdb_zip.so
> osgdb_geo.so       osgdb_osga.so          osgdb_rgb.so
> osgdb_glsl.so      osgdb_osgfx.so         osgdb_rot.so
>
>
>
>
>
>
>
>
> ...
>
> Thank you!
>
> Cheers,
> Eduardo
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=22376#22376
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG and streamed video

2010-01-11 Thread Eduardo Pinheiro
Hi,

Many thanks.

I will test and revert.


... 

Thank you!

Cheers,
Eduardo

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





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


Re: [osg-users] CHROMA KEY

2010-01-11 Thread Eduardo Pinheiro
Hi Trajce,

Its something like that :)

Thanks for your tip. I will try that but if you could give me an example how to 
make that i will appreciate.


... 

Thank you!

Cheers,
Eduardo

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





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


Re: [osg-users] CHROMA KEY

2010-01-11 Thread Trajce Nikolov
give me a video with chroma key . send it to my email .. I will write
some sample and sent it to you

Nick

http://www.linkedin.com/in/tnick
Sent from Izmit, 41, Turkey

On Mon, Jan 11, 2010 at 3:21 PM, Eduardo Pinheiro  wrote:

> Hi Trajce,
>
> Its something like that :)
>
> Thanks for your tip. I will try that but if you could give me an example
> how to make that i will appreciate.
>
>
> ...
>
> Thank you!
>
> Cheers,
> Eduardo
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=22379#22379
>
>
>
>
>
> ___
> 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] depth buffer display

2010-01-11 Thread Trajce Nikolov
Hi community,

what is the simplest way to display the depth buffer?

Nick

http://www.linkedin.com/in/tnick
Sent from Izmit, 41, Turkey
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG and streamed video

2010-01-11 Thread Eduardo Pinheiro
Hi,

I already had tried this version before and now i remember why i've passed 
again to 2.8.2 . The camera its not stable. It appears then not, then appears 
then not...

Anyway i've tested the command osgmovie -e ffmpeg simple.mpg with the 2.8.2 and 
it worked.

But the streaming its still not working. Any idea?

Thanks.

... 

Thank you!

Cheers,
Eduardo

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





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


Re: [osg-users] CHROMA KEY

2010-01-11 Thread Trajce Nikolov
just out of curiosity. Do you have attached a real camera to the
application? I have done something in the past with real cameras and
wondering how you are connecting to the scene, if you can disclose

Thanks
Nick

http://www.linkedin.com/in/tnick
Sent from Izmit, 41, Turkey

On Mon, Jan 11, 2010 at 3:59 PM, Trajce Nikolov wrote:

> give me a video with chroma key . send it to my email .. I will write
> some sample and sent it to you
>
> Nick
>
> http://www.linkedin.com/in/tnick
> Sent from Izmit, 41, Turkey
>
> On Mon, Jan 11, 2010 at 3:21 PM, Eduardo Pinheiro  gmail.com> wrote:
>
>> Hi Trajce,
>>
>> Its something like that :)
>>
>> Thanks for your tip. I will try that but if you could give me an example
>> how to make that i will appreciate.
>>
>>
>> ...
>>
>> Thank you!
>>
>> Cheers,
>> Eduardo
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=22379#22379
>>
>>
>>
>>
>>
>> ___
>> 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] KdTree problem

2010-01-11 Thread Nilsson Lars
Hi all

Once again, here is a discussion about LineSegmentIntersector and precision 
(float vs. double).

Attached is a small program showing my problem. The geometry is a 
TRIANGLE_STRIP consisting of five vertices, all with the same rather high 
Z-value. If the intersection calculation uses KdTree it fails. When I changed 
osg::Vec3 to osg::Vec3d for two parameters (s and e) in the IntersectKdTree 
constructor it finds the correct intersection point.

Another way to solve the problem was to increase the expansion of the 
bounding-box in osgUtil::LineSegmentIntersector::intersectAndClip.

The version of OSG that I use is 2.9.6.

I have not enough knowledge in KdTree to understand what other implications 
these changes may have, but if either of these fixes seems to be reasonable, I 
will be glad to post it to the submissions mailing list.

Regards,
Lars Nilsson



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


Re: [osg-users] DrawCallback only once

2010-01-11 Thread Dominic Stalder

Hi Robert

thanks a lot, at the moment it works fine the way I made it. But I will 
try this solution as soon as possible.


Am 11.01.10 11:41, schrieb Robert Osfield:

The best way to do a single GL test at startup is to attach a custom
osg::GraphicsOperation as a RealizeOperation to the viewer, and this
gets called once the viewer's graphics contexts get realized.

Have a look at the osgcatch, osgshaderterrrain and osgvolume examples
to see examples of the above in action.
   


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


Re: [osg-users] CHROMA KEY

2010-01-11 Thread Eduardo Pinheiro
Hi,

Yes i have a real camera. But im trying to test it with a movie (not with the 
real camera). 

I've sended to your email (i think) the explanation. The mail is what is in 
your website (linkedin).

Did you received it?


... 

Thank you!

Cheers,
Eduardo

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





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


Re: [osg-users] CHROMA KEY

2010-01-11 Thread Trajce Nikolov
send it to this one nikolov.tra...@gmail.com
Nick

http://www.linkedin.com/in/tnick
Sent from Izmit, 41, Turkey

On Mon, Jan 11, 2010 at 4:26 PM, Eduardo Pinheiro  wrote:

> Hi,
>
> Yes i have a real camera. But im trying to test it with a movie (not with
> the real camera).
>
> I've sended to your email (i think) the explanation. The mail is what is in
> your website (linkedin).
>
> Did you received it?
>
>
> ...
>
> Thank you!
>
> Cheers,
> Eduardo
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=22386#22386
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG and streamed video

2010-01-11 Thread Mourad Boufarguine
Hi Eduardo,

ffmpeg plugin, as it is now, do not work "natively" with extensionless
files/urls, check the source code of the plugin for the list of supported
extensions :

supportsExtension("ffmpeg", "");
supportsExtension("avi","");
supportsExtension("flv","Flash video");
supportsExtension("mov","Quicktime");
supportsExtension("ogg","Theora movie format");
supportsExtension("mpg","Mpeg movie format");
supportsExtension("mpv","Mpeg movie format");
supportsExtension("wmv","Windows Media Video format");
supportsExtension("mkv","Matroska");
supportsExtension("mjpeg",  "Motion JPEG");
supportsExtension("mjpg",  "Motion JPEG");
supportsExtension("mp4","MPEG-4");
supportsExtension("sav","MPEG-4");
supportsExtension("3gp","MPEG-4");
supportsExtension("sdp","MPEG-4");
supportsExtension("amp","MPEG-4");

One possible workaroud for extensionless urls, is to force using the ffmpeg
plugin when the extension ".ffmpeg" (or whatever) is appended to the url.
For this to be done, the function ReaderWriterFFmpeg::readImage should be
changed to allow reading osgDB::getNameLessExtension(filename) without
calling again readImage, because the function will always check if the
extension of the file is supported by the plugin.

If it seems ok for Robert and the others, maybe this could be applied to the
ffmpeg plugin.

Any thoughts?

Mourad


On Mon, Jan 11, 2010 at 3:02 PM, Eduardo Pinheiro  wrote:

> Hi,
>
> I already had tried this version before and now i remember why i've passed
> again to 2.8.2 . The camera its not stable. It appears then not, then
> appears then not...
>
> Anyway i've tested the command osgmovie -e ffmpeg simple.mpg with the 2.8.2
> and it worked.
>
> But the streaming its still not working. Any idea?
>
> Thanks.
>
> ...
>
> Thank you!
>
> Cheers,
> Eduardo
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=22380#22380
>
>
>
>
>
> ___
> 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] Conversion from 'GLsizeiptrARB' to 'const GLvoid *' of greater size

2010-01-11 Thread Jean-Sébastien Guay

Hi Robert,


Disabling the warning would not be idea as it could hide some genuine
problems.  Perhaps just disable it for the files that are causing
problems?


So would you accept a change that pushes the warning disable state at 
the start of include/osg/State, disables that warning for the file, and 
pops the warning disable state at the end of the file? (or perhaps only 
in those functions would be less prone to hiding other problems)


You've refused such changes in the past, but perhaps for this case it's 
the only way to go...


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


[osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Dominic Stalder

Hi there

I have the following RTT method:

ref_ptr image = new Image;
image->allocateImage(osgViewer->width(), osgViewer->height(), 1, 
GL_RGBA, GL_UNSIGNED_BYTE);


// resets the size of the texture
texture->setTextureSize(osgViewer->width(), osgViewer->height());

// sets the clear mask the depth buffer
camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

// sets the clear color to white
camera->setClearColor(Vec4(1.0, 1.0, 1.0, 1.0));

...matrices and viewport...

// sets the reference frame to an absolute coordinate frame
camera->setReferenceFrame(Camera::ABSOLUTE_RF_INHERIT_VIEWPOINT);

// sets the texture camera to render before rendering to the screen
camera->setRenderOrder(Camera::PRE_RENDER);

// sets the rendering target of the texture camera to the frame 
buffer object (FBO)

camera->setRenderTargetImplementation(Camera::FRAME_BUFFER_OBJECT);

// attaches the texture to the texture camera (important: samples 
mustn't be greater than zero)
// buffer component, texture, level, face, mip map generation, 
samples, color samples

camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0);

// adds the node to the texture camera (this node will be rendered 
to the texture)

camera->addChild(node);

// adds the texture camera to the root node
root->addChild(camera);

If I write this image to file, it works great, I have my "balance" in 
the middle of the image --> see attachment color_buffer.png. Now I would 
like to write the depth buffer to the image (just for debugging, 
afterward I write it to the texture), so I change the following lines:


image->allocateImage(osgViewer->width(), osgViewer->height(), 1, 
GL_RGBA, GL_UNSIGNED_BYTE); --> image->allocateImage(osgViewer->width(), 
osgViewer->height(), 1, GL_DEPTH_COMPONENT, GL_FLOAT);


camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0); --> 
camera->attach(Camera::DEPTH_BUFFER, image.get(), 0, 0);


After that I get the image depth_buffer.png, but this isn't correct, is it?

The texture looks like this, is it correct?

// creates the texture for the shadow map
texShadowMap = new Texture2D;
texShadowMap->setInternalFormat(GL_DEPTH_COMPONENT);
texShadowMap->setShadowComparison(true);
texShadowMap->setShadowTextureMode(Texture2D::LUMINANCE);
texShadowMap->setFilter(Texture2D::MIN_FILTER, Texture2D::LINEAR);
texShadowMap->setFilter(Texture2D::MAG_FILTER, Texture2D::LINEAR);
texShadowMap->setWrap(Texture2D::WRAP_S, Texture2D::CLAMP_TO_BORDER);
texShadowMap->setWrap(Texture2D::WRAP_T, Texture2D::CLAMP_TO_BORDER);
texShadowMap->setBorderColor(Vec4(1.0, 1.0, 1.0, 1.0));

What am I doing wrong in this function?

Thanks a lot
Dominic
<><>___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG and streamed video

2010-01-11 Thread Robert Osfield
Hi Mourad,

On Mon, Jan 11, 2010 at 2:37 PM, Mourad Boufarguine
 wrote:
> If it seems ok for Robert and the others, maybe this could be applied to the
> ffmpeg plugin.

My plan is to add the aliases into Registry once we've tied up all the
loose ends of the present ffmpeg.  The main loose end now is how to
provide a default audio sink as ffmpeg itself just reads video and
audio streams, it can't play video or audio.  The OSG provides the
video display virtue of all it's OpenGL goodness, but... there isn't
an audio solution right now, you have to provide you own audio
implementation (osg::AudioSink) as can been seen in the osgmovie
example's use of SDL.

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


Re: [osg-users] osg::TextureCubeMap and HDR

2010-01-11 Thread David Spilling
Dear Peter,

I think that some (older) graphics cards support floating point 2D textures,
but not cube maps.

I'm also aware that even if you do support floating point cube maps, many
older cards can't do interpolation on them. Can you turn it to GL_NEAREST
and see if that makes a difference?

Regards,

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


Re: [osg-users] Conversion from 'GLsizeiptrARB' to 'const GLvoid *' of greater size

2010-01-11 Thread Robert Osfield
Hi JS,

On Mon, Jan 11, 2010 at 2:41 PM, Jean-Sébastien Guay
 wrote:
> So would you accept a change that pushes the warning disable state at the
> start of include/osg/State, disables that warning for the file, and pops the
> warning disable state at the end of the file? (or perhaps only in those
> functions would be less prone to hiding other problems)

Jikes, no way.  Hacks like that stays well out of general OSG headers.

Disabling warnings in specific .cpp's where there are problems is
acceptable.  If that's not possible then placing a global disable in
the CMake build or the include/osg/Export.

> You've refused such changes in the past, but perhaps for this case it's the
> only way to go...

Having yet another example of how crappy compilers can be doesn't
change my opinion on putting hacks into the OSG headers.

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


[osg-users] ffmpeg and information on how to make thread safe

2010-01-11 Thread Garrett Potts

Hello All:

Just did a test on making the ffmpeg thread safe.  You should not have  
to modify the plugin but here is a cut and past:


extern "C"
{
int ffmpeg_lock_callback(void **mutex, enum AVLockOp op);
}

int ffmpeg_lock_callback(void **mutex, enum AVLockOp op)
{
   static OpenThreads::Mutex m;

   switch(op)
   {
  case AV_LOCK_CREATE:
  {
 *mutex = &m;
  break;
  }
  case AV_LOCK_OBTAIN:
  {
 ((OpenThreads::Mutex*)(*mutex))->lock();
 break;
  }
  case AV_LOCK_RELEASE:
  {
 ((OpenThreads::Mutex*)(*mutex))->unlock();
break;
  }
  case AV_LOCK_DESTROY:
  {
*mutex = 0;
break;
  }

   }

   return 0;
}


You can then register your function via the avcodec interface call:

av_lockmgr_register(&ffmpeg_lock_callback);


To me this needs to be done at the application level.  doing this will  
automatically allow for thread safe access to parts of libavcodec that  
need it.  ffmpeg calls the callback method and passes the different  
ops it would like you to do.



you probably could have gotten rid of the type casts and just access  
the Mutex lock directly.



Take care

Garrett

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


Re: [osg-users] ffmpeg and information on how to make thread safe

2010-01-11 Thread Garrett Potts

Hello ALl:

Forgot one thing.  You must add --enable-pthreads (for unix type  
builds and MACs) for your platform.  I forget the windows one but do  
the --help and look at the thread enabler for your platform.



Take care

Garrett



On Jan 11, 2010, at 12:44 PM, Garrett Potts wrote:


Hello All:

Just did a test on making the ffmpeg thread safe.  You should not  
have to modify the plugin but here is a cut and past:


extern "C"
{
int ffmpeg_lock_callback(void **mutex, enum AVLockOp op);
}

int ffmpeg_lock_callback(void **mutex, enum AVLockOp op)
{
  static OpenThreads::Mutex m;

  switch(op)
  {
 case AV_LOCK_CREATE:
 {
*mutex = &m;
 break;
 }
 case AV_LOCK_OBTAIN:
 {
((OpenThreads::Mutex*)(*mutex))->lock();
break;
 }
 case AV_LOCK_RELEASE:
 {
((OpenThreads::Mutex*)(*mutex))->unlock();
   break;
 }
 case AV_LOCK_DESTROY:
 {
   *mutex = 0;
   break;
 }

  }

  return 0;
}


You can then register your function via the avcodec interface call:

av_lockmgr_register(&ffmpeg_lock_callback);


To me this needs to be done at the application level.  doing this  
will automatically allow for thread safe access to parts of  
libavcodec that need it.  ffmpeg calls the callback method and  
passes the different ops it would like you to do.



you probably could have gotten rid of the type casts and just access  
the Mutex lock directly.



Take care

Garrett

___
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] ffmpeg and information on how to make thread safe

2010-01-11 Thread Robert Osfield
HI Garret,

>
> Just did a test on making the ffmpeg thread safe.  You should not have to
> modify the plugin but here is a cut and past:
> ..
> To me this needs to be done at the application level.  doing this will
> automatically allow for thread safe access to parts of libavcodec that need
> it.  ffmpeg calls the callback method and passes the different ops it would
> like you to do.

Would it not just be appropriate to stick this mutex set up in the
plugin?  Would there be any draw back in this?

I would prefer to provide a plugin that wraps up all the details
within the plugin and not be tightly coupled with application code.

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


Re: [osg-users] [build] Build problem

2010-01-11 Thread Andy Garrison
Hi,

... 
Thanks I decided to add a virtual box with a 32 bit Ubuntu OS and install it 
there


Thank you!

Cheers,
Andy

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





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


Re: [osg-users] ffmpeg and information on how to make thread safe

2010-01-11 Thread Garrett Potts

Hello Robert:

You could wrap it up in there.  Is there a singleton entry point to  
OSG plugins?  If there is a singleton access point that is similar to  
something like a plugin init then you could actually put it in the  
plugins initialization code.



Take care

Garrett

On Jan 11, 2010, at 12:57 PM, Robert Osfield wrote:


HI Garret,



Just did a test on making the ffmpeg thread safe.  You should not  
have to

modify the plugin but here is a cut and past:
..
To me this needs to be done at the application level.  doing this  
will
automatically allow for thread safe access to parts of libavcodec  
that need
it.  ffmpeg calls the callback method and passes the different ops  
it would

like you to do.


Would it not just be appropriate to stick this mutex set up in the
plugin?  Would there be any draw back in this?

I would prefer to provide a plugin that wraps up all the details
within the plugin and not be tightly coupled with application code.

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


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


Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Simon Hammett
2010/1/11 Dominic Stalder 

> camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0); -->
> camera->attach(Camera::DEPTH_BUFFER, image.get(), 0, 0);
>

Well you are trying to attach a depth texture to the color buffer, that's
not going to work.

Try

camera->attach(Camera::DEPTH_BUFFER, ...

instead.

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


Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Mourad Boufarguine
Hi Dominic,

AFAIK, the png plugin does not support writing depth image. Try the tiff
plugin in svn/trunk ; a recent submission made it write depth images, and it
works for me.

Mourad

On Mon, Jan 11, 2010 at 4:17 PM, Dominic Stalder  wrote:

> Hi there
>
> I have the following RTT method:
>
>ref_ptr image = new Image;
>image->allocateImage(osgViewer->width(), osgViewer->height(), 1,
> GL_RGBA, GL_UNSIGNED_BYTE);
>
>// resets the size of the texture
>texture->setTextureSize(osgViewer->width(), osgViewer->height());
>
>// sets the clear mask the depth buffer
>camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
>
>// sets the clear color to white
>camera->setClearColor(Vec4(1.0, 1.0, 1.0, 1.0));
>
>...matrices and viewport...
>
>// sets the reference frame to an absolute coordinate frame
>camera->setReferenceFrame(Camera::ABSOLUTE_RF_INHERIT_VIEWPOINT);
>
>// sets the texture camera to render before rendering to the screen
>camera->setRenderOrder(Camera::PRE_RENDER);
>
>// sets the rendering target of the texture camera to the frame buffer
> object (FBO)
>camera->setRenderTargetImplementation(Camera::FRAME_BUFFER_OBJECT);
>
>// attaches the texture to the texture camera (important: samples
> mustn't be greater than zero)
>// buffer component, texture, level, face, mip map generation, samples,
> color samples
>camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0);
>
>// adds the node to the texture camera (this node will be rendered to
> the texture)
>camera->addChild(node);
>
>// adds the texture camera to the root node
>root->addChild(camera);
>
> If I write this image to file, it works great, I have my "balance" in the
> middle of the image --> see attachment color_buffer.png. Now I would like to
> write the depth buffer to the image (just for debugging, afterward I write
> it to the texture), so I change the following lines:
>
> image->allocateImage(osgViewer->width(), osgViewer->height(), 1, GL_RGBA,
> GL_UNSIGNED_BYTE); --> image->allocateImage(osgViewer->width(),
> osgViewer->height(), 1, GL_DEPTH_COMPONENT, GL_FLOAT);
>
> camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0); -->
> camera->attach(Camera::DEPTH_BUFFER, image.get(), 0, 0);
>
> After that I get the image depth_buffer.png, but this isn't correct, is it?
>
> The texture looks like this, is it correct?
>
>// creates the texture for the shadow map
>texShadowMap = new Texture2D;
>texShadowMap->setInternalFormat(GL_DEPTH_COMPONENT);
>texShadowMap->setShadowComparison(true);
>texShadowMap->setShadowTextureMode(Texture2D::LUMINANCE);
>texShadowMap->setFilter(Texture2D::MIN_FILTER, Texture2D::LINEAR);
>texShadowMap->setFilter(Texture2D::MAG_FILTER, Texture2D::LINEAR);
>texShadowMap->setWrap(Texture2D::WRAP_S, Texture2D::CLAMP_TO_BORDER);
>texShadowMap->setWrap(Texture2D::WRAP_T, Texture2D::CLAMP_TO_BORDER);
>texShadowMap->setBorderColor(Vec4(1.0, 1.0, 1.0, 1.0));
>
> What am I doing wrong in this function?
>
> Thanks a lot
> Dominic
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Trajce Nikolov
Hi,

I am trying to do the same. I noticed two methods of Texture2D.
texShadowMap->setShadowComparison(true);
texShadowMap->setShadowTextureMode(Texture2D::LUMINANCE);

what are these doing? Also, what is to be done to display the depth texture
on screen.
Thanks
Nick

http://www.linkedin.com/in/tnick
Sent from Ünalan, İstanbul, Turkey

On Mon, Jan 11, 2010 at 11:27 PM, Mourad Boufarguine <
mourad.boufargu...@gmail.com> wrote:

> Hi Dominic,
>
> AFAIK, the png plugin does not support writing depth image. Try the tiff
> plugin in svn/trunk ; a recent submission made it write depth images, and it
> works for me.
>
> Mourad
>
> On Mon, Jan 11, 2010 at 4:17 PM, Dominic Stalder <
> dominic.stal...@bluewin.ch> wrote:
>
>> Hi there
>>
>> I have the following RTT method:
>>
>>ref_ptr image = new Image;
>>image->allocateImage(osgViewer->width(), osgViewer->height(), 1,
>> GL_RGBA, GL_UNSIGNED_BYTE);
>>
>>// resets the size of the texture
>>texture->setTextureSize(osgViewer->width(), osgViewer->height());
>>
>>// sets the clear mask the depth buffer
>>camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
>>
>>// sets the clear color to white
>>camera->setClearColor(Vec4(1.0, 1.0, 1.0, 1.0));
>>
>>...matrices and viewport...
>>
>>// sets the reference frame to an absolute coordinate frame
>>camera->setReferenceFrame(Camera::ABSOLUTE_RF_INHERIT_VIEWPOINT);
>>
>>// sets the texture camera to render before rendering to the screen
>>camera->setRenderOrder(Camera::PRE_RENDER);
>>
>>// sets the rendering target of the texture camera to the frame buffer
>> object (FBO)
>>camera->setRenderTargetImplementation(Camera::FRAME_BUFFER_OBJECT);
>>
>>// attaches the texture to the texture camera (important: samples
>> mustn't be greater than zero)
>>// buffer component, texture, level, face, mip map generation, samples,
>> color samples
>>camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0);
>>
>>// adds the node to the texture camera (this node will be rendered to
>> the texture)
>>camera->addChild(node);
>>
>>// adds the texture camera to the root node
>>root->addChild(camera);
>>
>> If I write this image to file, it works great, I have my "balance" in the
>> middle of the image --> see attachment color_buffer.png. Now I would like to
>> write the depth buffer to the image (just for debugging, afterward I write
>> it to the texture), so I change the following lines:
>>
>> image->allocateImage(osgViewer->width(), osgViewer->height(), 1, GL_RGBA,
>> GL_UNSIGNED_BYTE); --> image->allocateImage(osgViewer->width(),
>> osgViewer->height(), 1, GL_DEPTH_COMPONENT, GL_FLOAT);
>>
>> camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0); -->
>> camera->attach(Camera::DEPTH_BUFFER, image.get(), 0, 0);
>>
>> After that I get the image depth_buffer.png, but this isn't correct, is
>> it?
>>
>> The texture looks like this, is it correct?
>>
>>// creates the texture for the shadow map
>>texShadowMap = new Texture2D;
>>texShadowMap->setInternalFormat(GL_DEPTH_COMPONENT);
>>texShadowMap->setShadowComparison(true);
>>texShadowMap->setShadowTextureMode(Texture2D::LUMINANCE);
>>texShadowMap->setFilter(Texture2D::MIN_FILTER, Texture2D::LINEAR);
>>texShadowMap->setFilter(Texture2D::MAG_FILTER, Texture2D::LINEAR);
>>texShadowMap->setWrap(Texture2D::WRAP_S, Texture2D::CLAMP_TO_BORDER);
>>texShadowMap->setWrap(Texture2D::WRAP_T, Texture2D::CLAMP_TO_BORDER);
>>texShadowMap->setBorderColor(Vec4(1.0, 1.0, 1.0, 1.0));
>>
>> What am I doing wrong in this function?
>>
>> Thanks a lot
>> Dominic
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] MinGW and OpenSceneGraph

2010-01-11 Thread Laurence Muller
Hi all,

unfortunately the OSG server seems to be down, so hopefully I'm posting this
on the right mailing list...

For my projects I'm using OpenSceneGraph with great pleasure. Recently I had
to switch from Visual Studio (VS) to MinGW because of some incompatible
libraries.
Compiling OpenSceneGraph in MSYS/MinGW is a bit less trivial compared to VS.
Since there isn't a lot of information online available (this page seem to
be a bit outdated:
http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/Mingw)
I created a brief tutorial (based on trial and error) to help fellow OSG
users.

It should work for the stable release (2.8.x) and the development release
(2.9.x):
http://www.multigesture.net/articles/how-to-compile-openscenegraph-2-x-using-mingw/
Stable and Development binaries can also be found on the page.

While creating this tutorial I found some minor issues (In the tutorial I
explain how to patch it):
(1) osgPlugin: jpeg
Problem: boolean is not defined
Solution:
- Open
C:\OpenSceneGraphSrc\OpenSceneGraph-2.8.2\src\osgPlugins\jpeg\ReaderWriterJPEG.cpp
- Goto line 78 and add:
/* Expanded data source object for stdio input */
typedef int boolean;
#define FALSE 0
#define TRUE 1

(2) osgPlugin: freetype
Problem: It can't find the freetype header files
Solution:
- In MinGW you will need to use freetype2/ instead of freetype/ as directory
- Open
C:\OpenSceneGraph\OpenSceneGraph-2.8.2\src\osgPlugins\freetype\FreeTypeFont3D.cpp
- Change lines 32 and 33:
#include 
#include 
 to
#include 
#include 

(3) osgPlugin: curl
Including libcurl (include / lib) doesn't seem to be enough to build this
project and will result in linking errors. It probably needs to link against
libws2_32.a and libwinmm.a . I know how to link using a Makefile, but I got
no clue on how to fix it in the CMake files...


Hopefully this helps other users as well :)

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


Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Dominic Stalder

Hi Simon

I'm attaching to the depth buffer (look on the right --> 
camera->attach(Camera::DEPTH_BUFFER, image.get(), 0, 0); ;-)


Thanks anyway.

Dominic


Am 11.01.10 22:15, schrieb Simon Hammett:
2010/1/11 Dominic Stalder >


camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0); -->
camera->attach(Camera::DEPTH_BUFFER, image.get(), 0, 0);


Well you are trying to attach a depth texture to the color buffer, 
that's not going to work.


Try

camera->attach(Camera::DEPTH_BUFFER, ...

instead.

--
http://www.ssTk.co.uk


___
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] resizing embedded windows...

2010-01-11 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Robert,

Thanks for the advice. As a follow up question that may be obvious (forgive
me), how do I enable the clear on the graphics context? I've poked around
and I can't find where this is done.

Per your suggestion, I tried my own "brute force" clear which appears to
solve the problem but I would rather use the context's clear if possible. It
seems more elegant for what I'm trying to accomplish.

Thanks,
-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Monday, January 11, 2010 3:39 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] resizing embedded windows...

Hi Shayne,

I haven't personally tried doing exactly what you are doing, but try
changing the GraphicsWindowEmbedded context's size, and also try
enable it's clear as the graphics context by default leaves it's own
clear disabled leaving it to the clear done during the rendering of
the Camera's scene graph that is clamped to the Camera's viewport.

Another thing you could try is doing your own clear before the call to
viewer.frame().

Robert.

On Fri, Jan 8, 2010 at 11:05 PM, Tueller, Shayne R Civ USAF AFMC 519
SMXS/MXDEC  wrote:
> All,
>
>
>
> I'm in the process of porting an OGL app using GLUT to OSG using
osgViewer.
>
>
>
> Currently this app has multiple viewports embedded in a single GLUT window
> where one of the viewports is rendering a 3D view into a scene. Due to
time
> constraints, I want to replace the 3D viewport with an embedded OSG viewer
> into the GLUT window as an interim solution. It should be noted, that the
> embedded window is a small subset of the larger GLUT window (GLUT is using
> game mode). Using the osgviewerGLUT example as a guide, I've been able to
> get things working but I've run into a snag. I have a need to resize the
> embedded window on occasion and I can't get it to work properly. When I
> resize the embedded window by setting viewer->getCamera()->setViewport(x,
y,
> width, height), the new embedded window appears just fine but I still have
> portions of the old embedded window left over as if the "clear" didn't
> happen. I've tried several ways of getting the old embedded window to
clear
> out without success. It's as if I can't override the original settings
when
> I created the embedded window using
> viewer->setUpViewerAsEmbeddedInWindow(.).
>
>
>
> Has anyone run into this problem or know of a good/correct way of resizing
> or moving embedded OSG windows in a larger GLUT window? If it can't be
done,
> it would be nice to know so that I don't spend an exorbitant amount of
time
> trying to get it to work.
>
>
>
> For the record, I'm aware of the shortcomings and drawbacks about using
GLUT
> with OSG. Again, my attempt here is to come up with a stopgap measure
until
> I can get the entire port to osgViewer completed.
>
>
>
> Thanks in advance,
>
> -Shayne
>
> ___
> 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


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Wojciech Lewandowski
Hi Nick,

ShadowComparison = true 
causes opengl to use result of TexFilter(depth_at_texel > depth_map_coord_r) 

ShadowComparison = false 
causes opengl to use TexFilter( depth_at_texel ) value. 

To display depth texture on some hud its neccessary to turn ShadowComparison 
off. Its kinda tricky because it has to be also on for use with shadow mapping.
I used to apply special callback that was used to change the mode to draw 
shadow map on the screen. See osgShadow/DebugShadowMap.cpp 
DrawableDrawWithDepthShadowComparisonOffCallback callback

Wojtek


From: Trajce Nikolov 
Sent: Monday, January 11, 2010 10:31 PM
To: OpenSceneGraph Users 
Subject: Re: [osg-users] Depth buffer for shadow mapping


Hi, 


I am trying to do the same. I noticed two methods of Texture2D.   
texShadowMap->setShadowComparison(true);
texShadowMap->setShadowTextureMode(Texture2D::LUMINANCE);


what are these doing? Also, what is to be done to display the depth texture on 
screen. 
Thanks
Nick

http://www.linkedin.com/in/tnick
Sent from Ünalan, İstanbul, Turkey 


On Mon, Jan 11, 2010 at 11:27 PM, Mourad Boufarguine 
 wrote:

  Hi Dominic, 


  AFAIK, the png plugin does not support writing depth image. Try the tiff 
plugin in svn/trunk ; a recent submission made it write depth images, and it 
works for me.


  Mourad


  On Mon, Jan 11, 2010 at 4:17 PM, Dominic Stalder  
wrote:

Hi there

I have the following RTT method:

   ref_ptr image = new Image;
   image->allocateImage(osgViewer->width(), osgViewer->height(), 1, 
GL_RGBA, GL_UNSIGNED_BYTE);

   // resets the size of the texture
   texture->setTextureSize(osgViewer->width(), osgViewer->height());

   // sets the clear mask the depth buffer
   camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

   // sets the clear color to white
   camera->setClearColor(Vec4(1.0, 1.0, 1.0, 1.0));

   ...matrices and viewport...

   // sets the reference frame to an absolute coordinate frame
   camera->setReferenceFrame(Camera::ABSOLUTE_RF_INHERIT_VIEWPOINT);

   // sets the texture camera to render before rendering to the screen
   camera->setRenderOrder(Camera::PRE_RENDER);

   // sets the rendering target of the texture camera to the frame buffer 
object (FBO)
   camera->setRenderTargetImplementation(Camera::FRAME_BUFFER_OBJECT);

   // attaches the texture to the texture camera (important: samples 
mustn't be greater than zero)
   // buffer component, texture, level, face, mip map generation, samples, 
color samples
   camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0);

   // adds the node to the texture camera (this node will be rendered to 
the texture)
   camera->addChild(node);

   // adds the texture camera to the root node
   root->addChild(camera);

If I write this image to file, it works great, I have my "balance" in the 
middle of the image --> see attachment color_buffer.png. Now I would like to 
write the depth buffer to the image (just for debugging, afterward I write it 
to the texture), so I change the following lines:

image->allocateImage(osgViewer->width(), osgViewer->height(), 1, GL_RGBA, 
GL_UNSIGNED_BYTE); --> image->allocateImage(osgViewer->width(), 
osgViewer->height(), 1, GL_DEPTH_COMPONENT, GL_FLOAT);

camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0); --> 
camera->attach(Camera::DEPTH_BUFFER, image.get(), 0, 0);

After that I get the image depth_buffer.png, but this isn't correct, is it?

The texture looks like this, is it correct?

   // creates the texture for the shadow map
   texShadowMap = new Texture2D;
   texShadowMap->setInternalFormat(GL_DEPTH_COMPONENT);
   texShadowMap->setShadowComparison(true);
   texShadowMap->setShadowTextureMode(Texture2D::LUMINANCE);
   texShadowMap->setFilter(Texture2D::MIN_FILTER, Texture2D::LINEAR);
   texShadowMap->setFilter(Texture2D::MAG_FILTER, Texture2D::LINEAR);
   texShadowMap->setWrap(Texture2D::WRAP_S, Texture2D::CLAMP_TO_BORDER);
   texShadowMap->setWrap(Texture2D::WRAP_T, Texture2D::CLAMP_TO_BORDER);
   texShadowMap->setBorderColor(Vec4(1.0, 1.0, 1.0, 1.0));

What am I doing wrong in this function?

Thanks a lot
Dominic


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





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









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

Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Dominic Stalder
Its still not working with tiff. But I also have problems when I put it 
directly into the texture, it doesn't work too.


Any ideas?

Am 11.01.10 22:27, schrieb Mourad Boufarguine:

Hi Dominic,

AFAIK, the png plugin does not support writing depth image. Try the 
tiff plugin in svn/trunk ; a recent submission made it write depth 
images, and it works for me.


Mourad

On Mon, Jan 11, 2010 at 4:17 PM, Dominic Stalder 
mailto:dominic.stal...@bluewin.ch>> wrote:


Hi there

I have the following RTT method:

   ref_ptr image = new Image;
   image->allocateImage(osgViewer->width(), osgViewer->height(),
1, GL_RGBA, GL_UNSIGNED_BYTE);

   // resets the size of the texture
   texture->setTextureSize(osgViewer->width(), osgViewer->height());

   // sets the clear mask the depth buffer
   camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

   // sets the clear color to white
   camera->setClearColor(Vec4(1.0, 1.0, 1.0, 1.0));

   ...matrices and viewport...

   // sets the reference frame to an absolute coordinate frame
   camera->setReferenceFrame(Camera::ABSOLUTE_RF_INHERIT_VIEWPOINT);

   // sets the texture camera to render before rendering to the screen
   camera->setRenderOrder(Camera::PRE_RENDER);

   // sets the rendering target of the texture camera to the frame
buffer object (FBO)
   camera->setRenderTargetImplementation(Camera::FRAME_BUFFER_OBJECT);

   // attaches the texture to the texture camera (important:
samples mustn't be greater than zero)
   // buffer component, texture, level, face, mip map generation,
samples, color samples
   camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0);

   // adds the node to the texture camera (this node will be
rendered to the texture)
   camera->addChild(node);

   // adds the texture camera to the root node
   root->addChild(camera);

If I write this image to file, it works great, I have my "balance"
in the middle of the image --> see attachment color_buffer.png.
Now I would like to write the depth buffer to the image (just for
debugging, afterward I write it to the texture), so I change the
following lines:

image->allocateImage(osgViewer->width(), osgViewer->height(), 1,
GL_RGBA, GL_UNSIGNED_BYTE); -->
image->allocateImage(osgViewer->width(), osgViewer->height(), 1,
GL_DEPTH_COMPONENT, GL_FLOAT);

camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0); -->
camera->attach(Camera::DEPTH_BUFFER, image.get(), 0, 0);

After that I get the image depth_buffer.png, but this isn't
correct, is it?

The texture looks like this, is it correct?

   // creates the texture for the shadow map
   texShadowMap = new Texture2D;
   texShadowMap->setInternalFormat(GL_DEPTH_COMPONENT);
   texShadowMap->setShadowComparison(true);
   texShadowMap->setShadowTextureMode(Texture2D::LUMINANCE);
   texShadowMap->setFilter(Texture2D::MIN_FILTER, Texture2D::LINEAR);
   texShadowMap->setFilter(Texture2D::MAG_FILTER, Texture2D::LINEAR);
   texShadowMap->setWrap(Texture2D::WRAP_S,
Texture2D::CLAMP_TO_BORDER);
   texShadowMap->setWrap(Texture2D::WRAP_T,
Texture2D::CLAMP_TO_BORDER);
   texShadowMap->setBorderColor(Vec4(1.0, 1.0, 1.0, 1.0));

What am I doing wrong in this function?

Thanks a lot
Dominic

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

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



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


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


Re: [osg-users] Rendering a depth texture quickly

2010-01-11 Thread Dominic Stalder

knarf wrote:
> 
> I've implemented a feature that is similar to shadow mapping in that I first 
> have to render the scene from another point of view, and this rendering is 
> depth-only. I'm not using it for shadows, but this first depth-only pass is 
> conceptually the same.
> 
> 


Hi Frank

I actually can't render the depth buffer to a texture nor to an image. Would it 
be possible to post sour RTT code?

Thanks a lot and regards
Dominic

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





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


Re: [osg-users] MinGW and OpenSceneGraph

2010-01-11 Thread Jean-Sébastien Guay

Hi Laurence,

Thanks for your tutorial, it's always useful to document things so new 
users can get up and running as fast as possible.


Thanks also for your explanations for changes to make. Perhaps some can 
be made to the baseline so MinGW users won't have to manually patch 
things...


About this one:


(3) osgPlugin: curl
Including libcurl (include / lib) doesn't seem to be enough to build 
this project and will result in linking errors. It probably needs to 
link against libws2_32.a and libwinmm.a . I know how to link using a 
Makefile, but I got no clue on how to fix it in the CMake files...


libws2_32 was added already for the WIN32 case, if it's not being linked 
in it's probably because it's not included in the MINGW case... Search 
for that name in the CMakeLists.txt file in the src/osgPlugins/curl 
directory, and you should see where it's added. Then search other 
plugins for a MinGW specific path and that will tell you what to test 
for to know you're on MinGW, and in that case add the library to be 
linked against.


That should take care of that case. Once you've made the changes please 
submit the modified file to osg-submissions so others will benefit :-)


Thanks,

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


[osg-users] Dragger no longer "sees" click

2010-01-11 Thread Neil Clayton
Hi,

I've modified a dragger node so that instead of drawing using GL_POLYGON, it 
uses GL_LINE_LOOP.

When using polygon mode, I can click and drag the handle - and all is well. 
When using any kind of LINE (Strip/Loop etc) the clicks are ignored.  

Any idea why this might be?  I added debug info to BoundingSphere 
Geode::computeBound(), and it's returning non-empty (from a radius point of 
view) bounds in both cases (LINE or POLYGON mode).

Do draggers respond to clicks only in certain cases? Is there some change I 
have to make to get a dragger node to work when drawn as a line?

Thank you!
Neil

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





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


[osg-users] Viewport inheritance and RTT

2010-01-11 Thread Christiansen, Brad
Hi,

I have a scene setup with a texture attached to a camera which is setup
for pre-rendering.
In my scene I set the viewport for the RTT camera to the dimensions of
the texture. Despite having done this, the viewport for the RTT camera
is being inherited from the main scenes camera, i.e. if the viewport of
the main camera is (0,0,8000,600) then only this section of the texture
is rendered, despite the viewport for the rtt camera being
(0,0,1024,1024).

I have stepped through the CullVistor with a debugger and have found
that the viewport does seem to be setup correctly by the cull visitor.

By the time I get to this section of the CullVisitor:

switch(camera.getRenderOrder())
{
case osg::Camera::PRE_RENDER:
//In the following line the viewport for the camera and the rtts is
correct
 
getCurrentRenderBin()->getStage()->addPreRenderStage(rtts.get(),camera.g
etRenderOrderNum());
break;
default:
 
getCurrentRenderBin()->getStage()->addPostRenderStage(rtts.get(),camera.
getRenderOrderNum());
break;
}

the viewport seems to have been setup correctly. Both the rtts's
viewport and the cameras viewport is (0,0,1024,1024), but when it is
rendered this is not the viewport that is used.

I am not quite sure where to go from here. Does anyone have any
suggestions on what I may have done wrong or what area I should debug
next?

I am using version 2.9.5 of OSG.

Cheers,

Brad



DISCLAIMER:---
This e-mail transmission and any documents, files and previous e-mail messages
attached to it are private and confidential. They may contain proprietary or 
copyright
material or information that is subject to legal professional privilege. They 
are for
the use of the intended recipient only.  Any unauthorised viewing, use, 
disclosure,
copying, alteration, storage or distribution of, or reliance on, this message is
strictly prohibited. No part may be reproduced, adapted or transmitted without 
the
written permission of the owner. If you have received this transmission in 
error, or
are not an authorised recipient, please immediately notify the sender by return 
email,
delete this message and all copies from your e-mail system, and destroy any 
printed
copies. Receipt by anyone other than the intended recipient should not be 
deemed a
waiver of any privilege or protection. Thales Australia does not warrant or 
represent
that this e-mail or any documents, files and previous e-mail messages attached 
are
error or virus free.
--

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


Re: [osg-users] Node::Description into ageneralized propertymechanism?

2010-01-11 Thread Ulrich Hertlein
Hi Robert,

On 5/01/10 9:26 PM, Robert Osfield wrote:
> I've done a quick read of you proposal and it sounds good.  For
> convenience perhaps adding a getIntProperty(), getFloatProperty() etc.
> methods might be appropriate, or perhaps one could use the bool
> getProperty(const std::string&, Property) interface that I adopted in
> osg::ArgumentParser, where Property is a temporary helper object.

Sorry for the delay, I'm down under moving and didn't get around to this.

I understand where you're going with the convenience functions, but I was 
hoping to find a
more generic way to store data types which is why I came up with the template 
class.  I'll
try to work the interface into a more user friendly version.

Another thing that I realized is that the template I currently have makes it a 
bit
difficult to write the properties out to file.  But maybe I'm missing 
something, so if
anyone has a clever idea of how to serialize something like:

template  class Foo {
 T _data;
}

I'd be interested to learn about that.  The output should contain the type as a 
string and
the value, so that it can be parsed and recreated again.

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


Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Trajce Nikolov
Thanks Wojciech,

what I am after is , I implemented a shader for light lobes and I want to
use shadow map technique to avoid lightening behind obstacles. I might have
more questions. If you have some hints, then please drop them

Nick

http://www.linkedin.com/in/tnick
Sent from Ünalan, İstanbul, Turkey

On Tue, Jan 12, 2010 at 12:35 AM, Wojciech Lewandowski <
lewandow...@ai.com.pl> wrote:

>  Hi Nick,
>
> ShadowComparison = true
> causes opengl to use result of TexFilter(depth_at_texel >
> depth_map_coord_r)
>
> ShadowComparison = false
> causes opengl to use TexFilter( depth_at_texel ) value.
>
> To display depth texture on some hud its neccessary to turn
> ShadowComparison *off*. Its kinda tricky because it has to be also* on*for 
> use with shadow mapping.
> I used to apply special callback that was used to change the mode to
> draw shadow map on the screen. See osgShadow/DebugShadowMap.cpp
> *DrawableDrawWithDepthShadowComparisonOffCallback* callback
>
> Wojtek
>
>  *From:* Trajce Nikolov 
> *Sent:* Monday, January 11, 2010 10:31 PM
> *To:* OpenSceneGraph Users 
> *Subject:* Re: [osg-users] Depth buffer for shadow mapping
>
> Hi,
>
> I am trying to do the same. I noticed two methods of Texture2D.
> texShadowMap->setShadowComparison(true);
> texShadowMap->setShadowTextureMode(Texture2D::LUMINANCE);
>
> what are these doing? Also, what is to be done to display the depth texture
> on screen.
> Thanks
> Nick
>
> http://www.linkedin.com/in/tnick
> Sent from Ünalan, İstanbul, Turkey
>
> On Mon, Jan 11, 2010 at 11:27 PM, Mourad Boufarguine <
> mourad.boufargu...@gmail.com> wrote:
>
>> Hi Dominic,
>>
>> AFAIK, the png plugin does not support writing depth image. Try the tiff
>> plugin in svn/trunk ; a recent submission made it write depth images, and it
>> works for me.
>>
>> Mourad
>>
>>   On Mon, Jan 11, 2010 at 4:17 PM, Dominic Stalder <
>> dominic.stal...@bluewin.ch> wrote:
>>
>>>  Hi there
>>>
>>> I have the following RTT method:
>>>
>>>ref_ptr image = new Image;
>>>image->allocateImage(osgViewer->width(), osgViewer->height(), 1,
>>> GL_RGBA, GL_UNSIGNED_BYTE);
>>>
>>>// resets the size of the texture
>>>texture->setTextureSize(osgViewer->width(), osgViewer->height());
>>>
>>>// sets the clear mask the depth buffer
>>>camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
>>>
>>>// sets the clear color to white
>>>camera->setClearColor(Vec4(1.0, 1.0, 1.0, 1.0));
>>>
>>>...matrices and viewport...
>>>
>>>// sets the reference frame to an absolute coordinate frame
>>>camera->setReferenceFrame(Camera::ABSOLUTE_RF_INHERIT_VIEWPOINT);
>>>
>>>// sets the texture camera to render before rendering to the screen
>>>camera->setRenderOrder(Camera::PRE_RENDER);
>>>
>>>// sets the rendering target of the texture camera to the frame buffer
>>> object (FBO)
>>>camera->setRenderTargetImplementation(Camera::FRAME_BUFFER_OBJECT);
>>>
>>>// attaches the texture to the texture camera (important: samples
>>> mustn't be greater than zero)
>>>// buffer component, texture, level, face, mip map generation,
>>> samples, color samples
>>>camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0);
>>>
>>>// adds the node to the texture camera (this node will be rendered to
>>> the texture)
>>>camera->addChild(node);
>>>
>>>// adds the texture camera to the root node
>>>root->addChild(camera);
>>>
>>> If I write this image to file, it works great, I have my "balance" in the
>>> middle of the image --> see attachment color_buffer.png. Now I would like to
>>> write the depth buffer to the image (just for debugging, afterward I write
>>> it to the texture), so I change the following lines:
>>>
>>> image->allocateImage(osgViewer->width(), osgViewer->height(), 1, GL_RGBA,
>>> GL_UNSIGNED_BYTE); --> image->allocateImage(osgViewer->width(),
>>> osgViewer->height(), 1, GL_DEPTH_COMPONENT, GL_FLOAT);
>>>
>>> camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0); -->
>>> camera->attach(Camera::DEPTH_BUFFER, image.get(), 0, 0);
>>>
>>> After that I get the image depth_buffer.png, but this isn't correct, is
>>> it?
>>>
>>> The texture looks like this, is it correct?
>>>
>>>// creates the texture for the shadow map
>>>texShadowMap = new Texture2D;
>>>texShadowMap->setInternalFormat(GL_DEPTH_COMPONENT);
>>>texShadowMap->setShadowComparison(true);
>>>texShadowMap->setShadowTextureMode(Texture2D::LUMINANCE);
>>>texShadowMap->setFilter(Texture2D::MIN_FILTER, Texture2D::LINEAR);
>>>texShadowMap->setFilter(Texture2D::MAG_FILTER, Texture2D::LINEAR);
>>>texShadowMap->setWrap(Texture2D::WRAP_S, Texture2D::CLAMP_TO_BORDER);
>>>texShadowMap->setWrap(Texture2D::WRAP_T, Texture2D::CLAMP_TO_BORDER);
>>>texShadowMap->setBorderColor(Vec4(1.0, 1.0, 1.0, 1.0));
>>>
>>> What am I doing wrong in this function?
>>>
>>> Thanks a lot
>>> Dominic
>>>
>>> ___
>>> osg-users mailing list
>>> os

[osg-users] Concerning texture subloading using Subloadcallback

2010-01-11 Thread Julien Valentin
Hello
I'm trying to make a GPU texture  loading strategy based on an osg::Image.
I maintain update bounds in a derived MyImage class in a setData method and
would like to use glTexSubImage in order to update local Image changes so I
implement a coupled Subloadcallback in order to do that.
But I don't manage  the Subload Method to be called as when I call dirty on
osg::Image it always call the Load Method.
Can you tell me what to do in order to make Subloadcallback::SubLoad to be
called?

MySubloadcallback  : public Subloadcallback {
load(...){
 cout<___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org