Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to render to an QOffscreenSurface? #43

Open
likewise opened this issue Apr 19, 2019 · 3 comments
Open

How to render to an QOffscreenSurface? #43

likewise opened this issue Apr 19, 2019 · 3 comments

Comments

@likewise
Copy link

I would like to render to an QOffscreenSurface, i.e. not rendering for a display but for an image file with much larger resolution. What needs to be changed to do so?

@QUItCoding
Copy link
Owner

You can render with QNanoPainter into offscreen FBO using QOpenGLFramebufferObject and then use QNanoImage::fromFrameBuffer() to get paintable image from FBO handle. Gallery qnanopainter_features contains example of this, see commit d5ab8f3

If something else is needed regarding this please explain or preferably even provide a patch =)

@daljit97
Copy link

daljit97 commented Jan 2, 2020

@QUItCoding is it possible to still antialiasing with QOpenGLFrameBufferObject? Currently QNanoImage::fromFrameBuffer() requires that the buffer object is without multisampling. I have tried to call QOpenGLFramebufferObject::blitFramebuffer without success.

@QUItCoding
Copy link
Owner

I think you can't use multisampled QOpenGLFrameBufferObject for texture images. But you can paint antialiased paths also into FBOs using QNanoPainter setAntialias(float).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants