BabylonNative icon indicating copy to clipboard operation
BabylonNative copied to clipboard

MSAA iOS/Android

Open CedricGuillemet opened this issue 3 years ago • 7 comments

MSAA is disabled in the code for iOS and Android. https://github.com/BabylonJS/BabylonNative/blob/5b5ad204466693ab849806616c063694d2986701/Core/Graphics/Source/GraphicsImpl.cpp#L40 On iOS, it caused an issue with Highlighting https://github.com/BabylonJS/BabylonReactNative/issues/215 An issue has been open on bgfx : https://github.com/bkaradzic/bgfx/issues/2620 On Android, it leads to a crash https://github.com/BabylonJS/BabylonNative/issues/507

Some partners will need MSAA and it must be re-enabled at some point.

CedricGuillemet avatar Jan 28 '22 08:01 CedricGuillemet

On Android, glBlitFramebuffer is broken with Mali chips : https://developer.arm.com/documentation/101897/0200/fragment-shading/multisampling-for-opengl-es

https://github.com/bkaradzic/bgfx/blob/89ae74122cdd8fc719ff467c2fbc377e45ea8b6c/src/renderer_gl.cpp#L3867

CedricGuillemet avatar Jun 14 '22 11:06 CedricGuillemet

Is there a workaround?

bghgary avatar Jun 14 '22 23:06 bghgary

Yes https://github.com/bkaradzic/bgfx/pull/2818

CedricGuillemet avatar Jun 15 '22 09:06 CedricGuillemet

@CedricGuillemet Is this fixed now?

bghgary avatar Aug 03 '22 00:08 bghgary

@bghgary No. There are issues on some devices. My guess is it's because of the size of the GPU internal framebuffer. It gets too big with MSAA. I have built some release .apk with variation on the MSAA technic, framebuffer size,.. I need to test. This will give me a better idea on how to fix it.

CedricGuillemet avatar Aug 03 '22 07:08 CedricGuillemet

I get there are issues on some devices, but MSAA is now enabled again right?

bghgary avatar Aug 03 '22 17:08 bghgary

yes.

CedricGuillemet avatar Aug 03 '22 17:08 CedricGuillemet

MSAA fixed with context config. Closing.

CedricGuillemet avatar Sep 07 '22 09:09 CedricGuillemet