The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL2 2.0.4 iOS Multisample HIGHDPI
spartanjjj


Joined: 16 Jun 2015
Posts: 4
Hello there,

I haven't found information about this so i have to ask.

Im using latest SDL2 on iOS. Create a window with high dpi, fullres on iphone6, i pass SAMPLES = 2 or 4, all goes well.
The problem is that it doesn't really seem like AntiAliasing is ON.

Actually changing samples from 2 to 4 or 0 doesn't really make much of a difference visually.

I have also used GetAttribute and GetInteger to return the number of samples for current context and it gives me the right value i used to create it in the first place.

Is there a known issue with AA on iOS? Is there a way to enable multi-sampling? Using glEnable( GL_MULTISAMPLE ) doesn't work. GL_MULTISAMPLE is not found in the GL headers.

Appreciate any help, thank you
spartanjjj


Joined: 16 Jun 2015
Posts: 4
I might have found the solution.
Have to get the framebuffer from wmInfo.info.uikit.framebuffer;
spartanjjj


Joined: 16 Jun 2015
Posts: 4
Just tested it and i returns ID = 0 on both framebuffer and colorbuffer. Visual results are just the same as before, so no that wasn't the solution.

Anyone ?
SDL2 2.0.4 iOS Multisample HIGHDPI
Alex Szpakowski
Guest

If this message shows up 3 times I apologize – my email client was sending it from the wrong account…


MSAA support for the main framebuffer is not implemented on iOS right now, unfortunately.

The main framebuffer on iOS is really an OpenGL ES Framebuffer Object, which means proper MSAA support involves an explicit MSAA resolve (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE calls, depending on the OpenGL ES version.)

SDL_GL_SwapBuffers would of course be able to call those functions internally and hide those details, but if you were to call glReadPixels it would fail unless you first explicitly resolved the MSAA color buffer to a non-MSAA color buffer, and then bound the non-MSAA color buffer to the read framebuffer binding point, before calling glReadPixels.

So I haven’t added MSAA support for the default framebuffer on iOS (yet), because I haven’t been able to reconcile the fact that users expecting glReadPixels calls to work as expected without any modifications to their code will be surprised and disappointed. Sad

If anyone has suggestions for that, I’d be happy to hear them though.


Quote:
On Jun 30, 2015, at 12:07 PM, spartanjjj wrote:
Hello there, I haven't found information about this so i have to ask. Im using latest SDL2 on iOS. Create a window with high dpi, fullres on iphone6, i pass SAMPLES = 2 or 4, all goes well. The problem is that it doesn't really seem like AntiAliasing is ON. Actually changing samples from 2 to 4 or 0 doesn't really make much of a difference visually. I have also used GetAttribute and GetInteger to return the number of samples for current context and it gives me the right value i used to create it in the first place. Is there a known issue with AA on iOS? Is there a way to enable multi-sampling? Using glEnable( GL_MULTISAMPLE ) doesn't work. GL_MULTISAMPLE is not found in the GL headers. Appreciate any help, thank you

_______________________________________________SDL mailing://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL2 2.0.4 iOS Multisample HIGHDPI
Ryan C. Gordon
Guest

Quote:
If anyone has suggestions for that, I’d be happy to hear them though.

We _could_ add a hint for this, but I'd say it's better to just do what
you need to do to enable MSAA when the app requests it and assume that
iOS developers will figure out what the correct steps are within their
app if they really want to use it. It's not like it'll subtly break in
the field for a subset of users, what you describe would be noticed and
fixed before shipping.

(and if it generates a FAQ on the wiki, that's okay.)

(also, how many people are really using glReadPixels() on the default
framebuffer in 2015?)

--ryan.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL2 2.0.4 iOS Multisample HIGHDPI
slime73


Joined: 07 Jan 2012
Posts: 4
MSAA support for the main framebuffer is not implemented on iOS right now, unfortunately.

The main framebuffer on iOS is really an OpenGL ES Framebuffer Object, which means proper MSAA support involves an explicit MSAA resolve (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE calls, depending on the OpenGL ES version.)

SDL_GL_SwapBuffers would of course be able to call those functions internally and hide those details, but if you were to call glReadPixels it would fail unless you first explicitly resolved the MSAA color buffer to a non-MSAA color buffer, and then bound the non-MSAA color buffer to the read framebuffer binding point, before calling glReadPixels.

So I haven’t added MSAA support for the default framebuffer on iOS (yet), because I haven’t been able to reconcile the fact that users expecting glReadPixels calls to work as expected without any modifications to their code will be surprised and disappointed. Sad

If anyone has suggestions for that, I’d be happy to hear them though.

Quote:
On Jun 30, 2015, at 12:07 PM, spartanjjj wrote:
Hello there, I haven't found information about this so i have to ask. Im using latest SDL2 on iOS. Create a window with high dpi, fullres on iphone6, i pass SAMPLES = 2 or 4, all goes well. The problem is that it doesn't really seem like AntiAliasing is ON. Actually changing samples from 2 to 4 or 0 doesn't really make much of a difference visually. I have also used GetAttribute and GetInteger to return the number of samples for current context and it gives me the right value i used to create it in the first place. Is there a known issue with AA on iOS? Is there a way to enable multi-sampling? Using glEnable( GL_MULTISAMPLE ) doesn't work. GL_MULTISAMPLE is not found in the GL headers. Appreciate any help, thank you

_______________________________________________SDL mailing://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL2 2.0.4 iOS Multisample HIGHDPI
slime73


Joined: 07 Jan 2012
Posts: 4
MSAA support for the main framebuffer is not implemented on iOS right now, unfortunately.

The main framebuffer on iOS is really an OpenGL ES Framebuffer Object, which means proper MSAA support involves an explicit MSAA resolve (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE calls, depending on the OpenGL ES version.)

SDL_GL_SwapBuffers would of course be able to call those functions internally and hide those details, but if you were to call glReadPixels it would fail unless you first explicitly resolved the MSAA color buffer to a non-MSAA color buffer, and then bound the non-MSAA color buffer to the read framebuffer binding point, before calling glReadPixels.

So I haven’t added MSAA support for the default framebuffer on iOS (yet), because I haven’t been able to reconcile the fact that users expecting glReadPixels calls to work as expected without any modifications to their code will be surprised and disappointed. Sad

If anyone has suggestions for that, I’d be happy to hear them though.



(I originally sent this from the wrong email account by accident, so I apologize if the same reply is posted twice.)
Quote:
On Jun 30, 2015, at 12:07 PM, spartanjjj wrote:
Hello there, I haven't found information about this so i have to ask. Im using latest SDL2 on iOS. Create a window with high dpi, fullres on iphone6, i pass SAMPLES = 2 or 4, all goes well. The problem is that it doesn't really seem like AntiAliasing is ON. Actually changing samples from 2 to 4 or 0 doesn't really make much of a difference visually. I have also used GetAttribute and GetInteger to return the number of samples for current context and it gives me the right value i used to create it in the first place. Is there a known issue with AA on iOS? Is there a way to enable multi-sampling? Using glEnable( GL_MULTISAMPLE ) doesn't work. GL_MULTISAMPLE is not found in the GL headers. Appreciate any help, thank you

_______________________________________________SDL mailing://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
spartanjjj


Joined: 16 Jun 2015
Posts: 4
Hi Slime,

I understand the problem.

what about giving us the buffers handles and so we can work with it?
default color/depth buffers and render buffer when using MSAA. That would be a way.