Re: [osg-users] Modify texture data on runtime

2010-12-26 Thread Vicent Marti
Pt. That was much simpler than what I thought. Thanks a lot, Mourad.

Cheers,
Vicent Marti



On Sun, Dec 26, 2010 at 7:42 PM, Vicent Marti  wrote:
> Hello fine gentlemen,
>
> I'm trying to render a dynamic texture, whose pixels are manually
> modified during runtime. I'm assigning the texture like this:
>
>   osg::Texture2D* texture = new osg::Texture2D(img);
>   texture->setDataVariance(osg::Object::DYNAMIC);
>
>   osg::StateSet* state = geom->getOrCreateStateSet();
>   state->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
>
> where 'geom' is my geometry object, and 'img' is an osg::Image I've
> allocated manually, and which I plan to modify during runtime. The
> problem I'm having is that my 'geom' object is using the initial Image
> (the image as it was when assigning the TextureAttribute). Even if I
> modify the pixels in the Image, using img->data(), the rendered
> texture is not updated.
>
> What am I doing wrong? Is there a more optimal way to manually access
> the pixels of the rendered texture at runtime?
>
> Cheers,
> Vicent Marti
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [ANN] MS Kinect - official drivers available

2010-12-26 Thread Christian Richardt
Current Kinect drivers (libfreenect, SensorKinect) already expose the
640x480 depth map and the NITE skeleton tracker probably already uses
this.

The news about increased resolution is solely related to the data as
used by Xbox games which are currently limited to 320x240 resolution,
as far as I know.

Christian.

On Thu, Dec 23, 2010 at 6:12 PM, Christian Buchner
 wrote:
> Definitely nice!  But to be really useful, the skeletton should
> include head position and possibly rotation and the angles of hand and
> feet. Then the motion could be realistically mapped onto a 3D avatar.
>
> I heard news that the resolution of Kinect might be increased to
> 640x480 by firmware update (some additional compression on the USB
> link). Then this might be feasible.
>
> Christian
> ___
> 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] Modify texture data on runtime

2010-12-26 Thread Mourad Boufarguine
On Sun, Dec 26, 2010 at 6:42 PM, Vicent Marti  wrote:

> Hello fine gentlemen,
>
> I'm trying to render a dynamic texture, whose pixels are manually
> modified during runtime. I'm assigning the texture like this:
>
>   osg::Texture2D* texture = new osg::Texture2D(img);
>   texture->setDataVariance(osg::Object::DYNAMIC);
>
>   osg::StateSet* state = geom->getOrCreateStateSet();
>   state->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
>
> where 'geom' is my geometry object, and 'img' is an osg::Image I've
> allocated manually, and which I plan to modify during runtime. The
> problem I'm having is that my 'geom' object is using the initial Image
> (the image as it was when assigning the TextureAttribute). Even if I
> modify the pixels in the Image, using img->data(), the rendered
> texture is not updated.
>
> What am I doing wrong? Is there a more optimal way to manually access
> the pixels of the rendered texture at runtime?
>
> Cheers,
> Vicent Marti
>
>
Hi Vincent,

Make sure to call img->dirty() after modifying the pixels in the image, in
order to update the texture with the new data.

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


[osg-users] Modify texture data on runtime

2010-12-26 Thread Vicent Marti
Hello fine gentlemen,

I'm trying to render a dynamic texture, whose pixels are manually
modified during runtime. I'm assigning the texture like this:

   osg::Texture2D* texture = new osg::Texture2D(img);
   texture->setDataVariance(osg::Object::DYNAMIC);

   osg::StateSet* state = geom->getOrCreateStateSet();
   state->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);

where 'geom' is my geometry object, and 'img' is an osg::Image I've
allocated manually, and which I plan to modify during runtime. The
problem I'm having is that my 'geom' object is using the initial Image
(the image as it was when assigning the TextureAttribute). Even if I
modify the pixels in the Image, using img->data(), the rendered
texture is not updated.

What am I doing wrong? Is there a more optimal way to manually access
the pixels of the rendered texture at runtime?

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


[osg-users] flickerring and aliasing effects

2010-12-26 Thread issam boughanmi
Hi,

i have made a mini airport with a runway in blender and exported it to use with 
an osg application

i I placed the airport model just some unit above the terrain 

but when i fly in the scene i have a very noticeable flickering effect 
especially at high altitude + some very horrible aliasing effect in the airport 
model

is there any osg settings can i turn on to fix these two problems even with 
loosing some fps ?

thanks and good day

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





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