[osg-users] Synchronizing with textures uploads.

Altin Gjata altingjataj at gmail.com
Thu Mar 8 04:18:37 PST 2018


Hi Robert.

This has become such a big (psychological even) problem to me, that I'm ready to rewrite this whole thing from scratch if it need be.

I don't know what code to provide more. This is basically all I do. All I have left out are details on converting matrices from OpencCV to OpenGL, and using a circular_buffer to post true / false booleans that are read by a class that derives from GraphicsContext::SwapCallback to decide whether to allow or not swapping buffers.

I use (the default) DrawThreadPerContext for the moment.

Steeping through the code, It seems that uploading the image is done by applyTexImage_subload() called from within TextureRectangle::apply(state) called from a GraphicsThread. And this operation is triggered by renderingTraversals(). It just doesn't upload in time and the background rectangle drawn by this renderingTraversal() uses the previous image.

Is there any way I can trigger applyTexImage_subload() sooner?
Would it help if I used another camera that also uses the same ImageStream as texture and renders to a small texture, and set its rendering order before that of the camera that renders the background?

I don't know what else to do, other than presuming that this source file is cursed and start creating a new file and rewriting this part of the program from the beginning.

Thank you!

Cheers,
Altin

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







More information about the osg-users mailing list