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/

Reply via email to