From: Nicholas L. <Nic...@gm...> - 2009-08-17 12:51:23
|
I'm attempting to develop off-screen rendering using OpenVG but am having trouble (I'm new to the whole graphics universe...surfaces, contexts, windows, oy!). Off-screen rendering means a PBuffer but I can only bind a VGImage to a Pbuffer. So what about VGPaths? I can render a blue triangle on-screen and now I'm trying to render ultimately to a ppm file. Therefore I need to know the location of the data, but all I have is the EGLDisplay, EGLSurface (a Pbuffer, right?) and EGLContext. There's no opportunity for me to malloc some memory and use it. The only thing I can think to maybe try is draw my VGPath to presumably the surface, then call either vgReadPixels to add it to memory and then create a ppm file. Does that make sense? -- View this message in context: http://www.nabble.com/Is-Off-screen-rendering-possible-with-EGL-and-OpenVG--tp24977640p24977640.html Sent from the mesa3d-users mailing list archive at Nabble.com. |
From: Chia-I Wu <ol...@gm...> - 2009-08-18 02:29:42
|
On Mon, Aug 17, 2009 at 05:51:14AM -0700, Nicholas Lowell wrote: > Off-screen rendering means a PBuffer but I can only bind a VGImage to a > Pbuffer. So what about VGPaths? I can render a blue triangle on-screen and > now I'm trying to render ultimately to a ppm file. Therefore I need to know > the location of the data, but all I have is the EGLDisplay, EGLSurface (a > Pbuffer, right?) and EGLContext. There's no opportunity for me to malloc > some memory and use it. The binding apis are usually used for cross-api rendering. E.g., have opengl render into a VGImage. > The only thing I can think to maybe try is draw my VGPath to presumably the > surface, then call either vgReadPixels to add it to memory and then create a > ppm file. Does that make sense? You can create a pbuffer (eglCreatePbufferSurface) and make it current. You then start drawing as usual, and read the result using vgReadPixels. The only difference is that the pbuffer surface will not be shown on the screen. Note that not all drivers support pbuffer. It is egl_softpipe.so that I am using. -- Regards, olv |
From: Nicholas L. <Nic...@gm...> - 2009-08-18 20:11:36
|
Chia-I Wu-2 wrote: > >> The only thing I can think to maybe try is draw my VGPath to presumably >> the >> surface, then call either vgReadPixels to add it to memory and then >> create a >> ppm file. Does that make sense? > You can create a pbuffer (eglCreatePbufferSurface) and make it current. > You then start drawing as usual, and read the result using vgReadPixels. > The only difference is that the pbuffer surface will not be shown on the > screen. Note that not all drivers support pbuffer. It is > egl_softpipe.so that I am using. > I am using softpipe. If I go from pbuffer surface to VGImage with the following: eglMakeCurrent(eglDisplay, pbuffer, pbuffer, eglContext); drawTriangle(); VGImage triangle = vgCreateImage(...); vgGetPixels(triangle, 0, 0, 0, 0, imgW, imgH); eglMakeCurrent(eglDisplay, windowSurface, windowSurface, eglContext); vgDrawImage(triangle); eglSwapBuffers(eglDispla, windowSurface); I will get my blue triangle displayed to the window but "IN[0]: Register never used" is printed out. This message is printed during the vgDrawImage call. What is it talking about? I also went from pbuffer to memory to VGImage: void *picture = malloc(...); vgReadPixels(picture, ...); vgImageSubData(triangle, picture, ...); and I get the same results (a displayed triangle with the message). -- View this message in context: http://www.nabble.com/Is-Off-screen-rendering-possible-with-EGL-and-OpenVG--tp24977640p25032633.html Sent from the mesa3d-users mailing list archive at Nabble.com. |
From: Chia-I Wu <ol...@gm...> - 2009-08-19 02:22:54
|
On Tue, Aug 18, 2009 at 01:11:20PM -0700, Nicholas Lowell wrote: > void *picture = malloc(...); > vgReadPixels(picture, ...); I have no experience with OpenVG, but You can save the "picture" to a ppm file at this point. Isn't this what you want to do? -- Regards, olv |
From: Nicholas L. <Nic...@gm...> - 2009-08-19 12:20:10
|
Chia-I Wu-2 wrote: > >> void *picture = malloc(...); >> vgReadPixels(picture, ...); > I have no experience with OpenVG, but You can save the "picture" to a > ppm file at this point. Isn't this what you want to do? > Yes, that's what I'll do. -- View this message in context: http://www.nabble.com/Is-Off-screen-rendering-possible-with-EGL-and-OpenVG--tp24977640p25042964.html Sent from the mesa3d-users mailing list archive at Nabble.com. |