Login  Register

Re: Objects randomly not rendering on OffScreen Canvas

Posted by tinker on Aug 28, 2017; 9:27am
URL: https://forum.jogamp.org/Objects-randomly-not-rendering-on-OffScreen-Canvas-tp4038163p4038167.html

I've looked at the examples Julien posted before, and they seem to work as they are. Did not have the patience to rework them into my own code base, but I've tinkered on...

So, I did solve the issue in the end, quite unexpectedly, by simply moving the code that sets the dimensions of the Screen3D to before I create my object graph and add them to the universe. I can't really say that I understand why that would make a difference, but it did. I have since not experienced any problems with the rendering or disappearing objects.

This might make sense if one is familiar with the j3d internals, but I'm not. :)

I did try to add Thread.sleep's into the doRender method before, but experienced no difference. The rendering process is triggered through a single-threaded ExecutorService, so there should have been no concurrency issues. My only guess is that there is some kind of race condition triggered inside j3d when fiddling with the screen dimensions.

Thanks for your input, guys!