PDA

View Full Version : Get the raw buffer of ShaderEffectSource(qml2)



stereoMatching
14th June 2013, 12:46
Do anyone know how to obtain the raw buffer of ShaderEffectSource? I would like to do some postprocessing on it(save image, video record etc)

wysota
14th June 2013, 16:33
"Get" it where? You can use a shader effect to do postprocessing of the shader effect source. I don't think saving a single item is possible. You can grab the whole window, if you want.

stereoMatching
14th June 2013, 17:13
I can grab the whole window by grabWindow()
but it is too slow if I want to record the qml scene as video
That is why I want to get the raw buffer of the texture
rendered by shaderEffectSource and encode it into
a video file.

wysota
14th June 2013, 19:35
And you really think stopping the GL pipeline and transferring the image back to the CPU memory would not be slow? :)

stereoMatching
14th June 2013, 20:00
And you really think stopping the GL pipeline and transferring the image back to the CPU memory would not be slow? :)
You hit the point, looks like this is not a good solution.
What kind of solution could I use?

wysota
14th June 2013, 22:19
I think it depends how low-level can you go with your code. Tapping into QPA plugin would probably be best performance wide. But probably you can get away with using QQuickWindow::setRenderTarget() and passing an FBO that you can later convert to a image (possibly in another thread).