From: Brian P. <bri...@tu...> - 2008-06-27 13:30:45
|
Glenn Forney wrote: > I guess we need to understand the off screen drawing capabilities of > Mesa better. I saw the word "batch" in some of the documentation and > thought this capability was what we needed. We were hoping to be able > to modify an OpenGL/GLUT application so that it would not require the > presence of a video card. That's do-able, but you'll have to disable all the GLUT calls that depend on having a real window. > In particular ... > > This is what we are trying to do. We have a very large interactive > OpenGL/GLUT based visualization application (Smokeview). Smokeview > reads in a large amount of data generated on a Linux cluster. If the > data bandwidth is good (like at our office) then there is not a problem > we can run Smokeview moving the data where it is needed. Sometimes > though our users may be located far away from the Linux cluster. We > would then like to run SMokeview on the cluster (where the data is) and > have it render PNG's to briefly examine the state of a modeling run. This is a non-interactive task, right? That is, you want to produce images without a bunch of keyboard/mouse actions, right? If the app requires keyboard/mouse input, that requires a window. > We > would then transfer small number PNG files over the internet rather than > large data sets. So the question then is how to run (if it is possible) > an OpenGL/GLUT app without it connected to the host's video card. We > don't care that the graphics performance will be slow since we are only > going to be generating a few image files. > I did come up with one solution, to use the X11 server Xming. This > works at our work but again is to slow when we are away from our local > fast intranet. > > Any pointers will be appreciated. My guess is you can simply disable all the GLUT calls and implement some mechanism to invoke your drawing code (which would use OSMesa) at whatever interval you desire. -Brian > glenn > > Brian Paul wrote: >> Alexander Mont wrote: >>> You may have misunderstood what I was attempting to do. >>> >>> I do not want to have *two* separate rendering contexts: one for the >>> offscreen rendering and one for the onscreen rendering. Rather, I >>> want to >>> have a *single* offscreen rendering context, but I want the GLUT display >>> functionality to still work. >>> >>> The attached file is a simple test program that explains what I am >>> attempting to do. The OSTEST preprocessor definition controls whether >>> OSMesa >>> is used, while the CREATEWINDOW preprocessor definition controls whether >>> GLUTCreateWindow is called. >>> >>> If OSTEST is turned off, it is a simple GLUT application that uses the >>> window, and it works correctly. If OSTEST is turned on, what I am >>> doing is >>> creating the window, then switching the rendering context to the >>> OSMesa one. >>> In this case, when I run the program, a window comes up, which appears >>> broken. If you wait several seconds and then close the window, >>> however, the >>> files will have come up as desired. >>> >>> What I want to do is have exactly this behavior, except for it not to >>> have >>> to create an actual window at all. This is because I want to run it on a >>> machine (such as a cluster node) that does not have a windowing >>> system. If I >>> try to avoid creating the window by simply removing the call to >>> GLUTCreateWindow() (which can be done in this test program by >>> removing the >>> #define CREATEWINDOW) then the program immediately fails with an access >>> violation when glutMainLoop() is called. >>> >>> Is it even possible to use GLUT without creating an actual window, >>> and if so >>> how? >> >> No, I don't think that's possible. I seem to recall that GLUT should >> issue an error message if you try to enter the main loop without >> creating a window. >> >> >>> (It is possible that the only way to do this would be to modify the GLUT >>> libraries that come with Mesa. If that is the case, then I would be >>> willing >>> to submit any modifications I make back to the Mesa project so that >>> other >>> users who desire the same functionality could use it.) >> >> I guess what I'm wondering is this: why make any GLUT calls at all if >> you're just going to use OSMesa to render to an off-screen buffer? >> >> -Brian >> >> > |