Hi Rune,
On Mon, 2004-10-04 at 06:32, Rune Laursen wrote:
> Hi,
>
> I'm working on an image based rendering application and I need to upload
> texture data on a per frame basis. The textures are rather large and
> therefore it is necessary to only upload a portion of them to maintain
> real-time frame rates. It seems that there is no way of doing this in
> OpenSG (e.g. passing a user defined "dirty rect" to be used in
> glTexSubImage2d) and I'm wondring if there's another way of achieving
> this or if it's a functionality that might be worth adding?
Hm, that's a tricky one. OpenSG is designed to work with whole objects,
especially when it comes to the cluster. Given that the communication to
the cluster tries hard to be only one-way, adding that is not trivial.
What I could do is add is the ability to only upload parts of the
texture on imageContentChanged. As the refresh uses glTexSubImage
already anyway, adding a rectangle is simple.
I just did that, you just have to call
TextureChunk::imageContentChanged(left,right,bottom,top); with your
dirty rectangle (all pixel coordinates inclusive, i.e. the full image is
(0, getWidth()-1, 0 getHeight()-1)). It won't work for cube textures,
and it won't work for compressed textures either. It will also not be
additive, i.e. you can only set one rectangle per texture per redraw,
calling it more than once will overwrite the previous rectangle.
I haven't tried it on a cluster, but it should work. The problem with
the cluster is the Image, as that can't be updated partially. So unless
you're not running cluster, or you're running the Image change locally
on the server, the whole Image will be shipped. You can also make
partial Image changes work, but that would be a little harder. You would
need an Updater object that keeps the data to change and a pointer to
the texture, and on the server side copies the data into the image and
calls imageContentChanged(). The problematic part is getting rid of
these updaters, as you have to do it after the cluster's sync call, or
they won't be shipped over the net.
Hope it helps
Dirk
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users