Offscreen Rendering exits suddenly

Found a bug? Post here.
User avatar
Posts: 323
Joined: Thu 14. Dec 2006, 09:56
Location: TU Berlin

Re: Offscreen Rendering exits suddenly

Post by gunn » Tue 27. Mar 2012, 08:34

As I mentioned in a previous post, when I suggested saving a "screenshot" in jReality rather than an "image": the main advantage, as I understand it, of using offscreen rendering is the ability to specify arbitrary sizes. If, in fact, as you suggest, it's possible to set the canvas size arbitrarily large (whether there is a physical display or not) when making a screenshot, then this advantage disappears, because then you can also create large images using "screenshot". I haven't had time to test this out. Perhaps you can do so and report back the results?

The pbuffer object is, as I understand it, actually deprecated in the current OpenGL "codescape", and instead one should use more modern objects such as frame buffer objects for such rendering tasks -- again, I'm not really up-to-date on this issue and would welcome hearing more expert opinions. jReality does have some rudimentary support for FBO's, in order to create textures which can be used in the rendering process. See for example de.jreality.jogl.JOGLFBOViewer, and the associated tutorial de.jreality.tutorial.viewer.JOGLFBOTextureExample. The offscreen rendering could be ported to work in this context if there is enough interest, or if someone wants to jump in and do it.

Finally, in the interests of tracking down the bug you've encountered in offscreen rendering: I don't think we've established yet whether it's a bug in the Intel graphics configuration you have, or in jReality proper. As I mentioned, I make heavy use of the offscreen renderer and at the current time know of no issues with it, except for problems saving the alpha channel correctly. As a way of answering this question, I would be interested if you could make the following changes to your code and report the results:
1) Leave display lists turned off.
2) Either turn off display of vertices and lines with the following code ...:

Code: Select all

ap.setAttribute(CommonAttributes.VERTEX_DRAW, false);
ap.setAttribute(CommonAttributes.EDGE_DRAW, false);
3) ... or turn off use of spheres and tubes to display vertices and edges with the following code:

Code: Select all

ap.setAttribute(CommonAttributes.SPHERES_DRAW, false);
ap.setAttribute(CommonAttributes.TUBES_DRAW, false);
In order to get the display of vertices and edges to match (as close as possible) the original display, you may also need to adjust the point size and line width with the following code:

Code: Select all

ap.setAttribute(CommonAttributes.POINT_SIZE, ...);
ap.setAttribute(CommonAttributes.LINE_WIDTH, ...);
Even if you can't manage under these constraints to produce the picture that you want, it would help the debugging process if you are able to carry out the suggested changes. My suspicion is that there is a problem with display lists in your system: turning off display lists (as suggested in a previous post) does not in fact completely turn off the use of display lists in the JOGL backend: points (as spheres) and edges (as tubes) are still drawn using display lists. The suggested changes should completely remove the use of display lists and establish whether this suspicion is correct.

For more information on the display of points and lines in the JOGL backend, see this tutorial and this tutorial.
jReality core developer

Posts: 9
Joined: Tue 20. Mar 2012, 15:14

Re: Offscreen Rendering exits suddenly

Post by neothemachine » Wed 28. Mar 2012, 22:14

Thanks for your explanations!

As for screenshot vs offscreen, I tried setting the window size of the JFrame programmatically to something bigger than my screen but when I exceed my screen limit it just maximizes the window. I tested it independently of jReality with just an empty JFrame and also AWT's Frame and it always maximizes the window, at least under Linux. I haven't figured out yet what window mechanism Ardor3D uses because it's possible there to set the window size to values bigger than the screen and then do a screenshot. So you're probably right that offscreen rendering is at least more reliable with less surprises.

Regarding the bug, I tried the attribute combinations but still get the same SIGSEGV crash.

Post Reply