HI Michel,
It's very hard for me to review changes out of context, which is why I
requested the whole file changed. Once I have this I can start
getting my head around things, and may well be able to point out what
problems might arise, or what other areas need changes.
As for two viewers sharing the same scene graph and osg:Texture, this
should be possible as long as you manage the contexID's correctly.
Robert.
On 8/10/06, Elk, M.G. (Michel) van <[EMAIL PROTECTED]> wrote:
Hello Robert,
Unfortunately all is not just a matter of a single change ...
The fact that the size of the image is not the same as the size of the
texture
can be caused by:
- changing the size of the image (my 'rare' case)
- using only PowerOf2 textures, which can be caused by:
- using mipmaps
- using compressed textures
- maybe more that I don't know of (this is what makes it tricky).
If I add the following lines:
if(!_resizeNonPowerOfTwoHint && !image->isMipmap() && !compressed_image)
{
inwidth=image->s();
inheight=image->t();
}
BEFORE the check in textyure.cpp:
"bool needImageRescale = inwidth!=image->s() || inheight!=image->t();"
Then the texture (and not the image) is automatically resized if the
difference
was not caused by PowerOf2 issues.
I've tried this with two viewers looking at the same scenegraph, each
having
it's own updated texture object and that works OK.
I would like to test this when two viewers share the texture, if that is
possible.
Should I let them share the RenderContext to make them share resources ?
Thanks,
Michel
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: donderdag 10 augustus 2006 12:02
To: osg users
Subject: Re: [osg-users] Dynamically changing image-sizes (used by a
texture)
Hi Michel,
Could you send me the file you have modified and I can review it.
I think one area that will need to be considering is the threading of
the update - if you have mulitple graphics context then some of the
texture objects could be update, but have others still at the original
size, then the osg::Texture* object manging all these will need to
contol things carefully to avoid a race condition.
Robert.
On 8/10/06, Elk, M.G. (Michel) van <[EMAIL PROTECTED]> wrote:
> Hi Robert,
>
> Subload detects the change in size and calls the Load function, that
> mechanism is already present in the Texture class.
> Only the Load-functions then decides to resize the image.
> If this check is simply removed then the texture-size is updated by
> the glTexImage2D call.
>
> To be honest I don't know what OpenGL does when you resize a texure by
> calling glTexImage2D twice with different sizes on the same textureID,
> but at least the visual result looks good!!
>
> Michel
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Robert
> Osfield
> Sent: donderdag 10 augustus 2006 11:37
> To: osg users
> Subject: Re: [osg-users] Dynamically changing image-sizes (used by a
> texture)
>
> Hi Michel,
>
>
>
> On 8/10/06, Elk, M.G. (Michel) van <[EMAIL PROTECTED]> wrote:
> > Hi Robert, thanks for the quick response.
> >
> > We (Raymond de Vries [see earlier mails about ImageStream] and I)
> > are working on video-streaming textures where the size of the
> > texture can change dynamically. From the image-stream class we only
> > have access to
>
> > the image, not to the texture. However you have created a nice
> > mechanism that allows us to dirty the image (edit or resize) and
> > that will trigger the texture to update automatically.
> >
> > Unfortunately for some (perhaps very well considered) reason, the
> > texture will always keep its original size and will rescale the
> > image to fit in it. This will use a lot of CPU-time if each
> > video-frame is resized and has some other disadvantages I mentioned
before.
> >
> > Do you know why the texture-size is left unchanged?
>
> Inside osg::Texture* the Image::dirty mechanism is used to tell it to
> subload the data, and in this context subloading is to an existing
> OpenGL texture object of fixed size.
>
> Potentialy osg::Texture* could be tweaked to pick up on a change in
> size and allocate a new texture object.
>
> Robert.
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
> This e-mail and its contents are subject to the DISCLAIMER at
> http://www.tno.nl/disclaimer/email.html
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
This e-mail and its contents are subject to the DISCLAIMER at
http://www.tno.nl/disclaimer/email.html
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/