Is your feature request related to a problem?
Rough edge in EffectComposer: when multisampling is set above 0 on WebGL2, it needs gl.renderbufferStorageMultisample. Some contexts report as WebGL2 but don't implement it, e.g. expo-gl (React Native). Their docs list it as unimplemented: https://docs.expo.dev/versions/latest/sdk/gl-view/
Instead of skipping multisampling, it throws and crashes the whole app. Repro'd via @react-three/postprocessing + N8AO on Android emulator: multisampling > 0 crashes on first frame, multisampling={0} works fine. Root cause is in EffectComposer, not the wrapper or N8AO. Note that wrapper sets a non-zero default on its own, so users can hit this without asking for MSAA.
Related: pmndrs/react-postprocessing#339
Describe the solution you'd like
multisampling's setter already clamps samples to gl.getParameter(gl.MAX_SAMPLES). Extend that to also check if renderbufferStorageMultisample actually works, not just that it exists (on expo-gl it exists as a stub that throws when called), and fall back to samples = 0 if not.
Describe alternatives you've considered
Leave as is and document it, or handle it in wrappers instead. Raising it here since this is the one place that fixes it for every consumer at once.
Additional context
More a proposal than a bug report, not sure it's worth the complexity since it seems specific to partial WebGL2 implementations like React Native.
Is your feature request related to a problem?
Rough edge in EffectComposer: when multisampling is set above 0 on WebGL2, it needs gl.renderbufferStorageMultisample. Some contexts report as WebGL2 but don't implement it, e.g. expo-gl (React Native). Their docs list it as unimplemented: https://docs.expo.dev/versions/latest/sdk/gl-view/
Instead of skipping multisampling, it throws and crashes the whole app. Repro'd via @react-three/postprocessing + N8AO on Android emulator: multisampling > 0 crashes on first frame, multisampling={0} works fine. Root cause is in EffectComposer, not the wrapper or N8AO. Note that wrapper sets a non-zero default on its own, so users can hit this without asking for MSAA.
Related: pmndrs/react-postprocessing#339
Describe the solution you'd like
multisampling's setter already clamps samples to gl.getParameter(gl.MAX_SAMPLES). Extend that to also check if renderbufferStorageMultisample actually works, not just that it exists (on expo-gl it exists as a stub that throws when called), and fall back to samples = 0 if not.
Describe alternatives you've considered
Leave as is and document it, or handle it in wrappers instead. Raising it here since this is the one place that fixes it for every consumer at once.
Additional context
More a proposal than a bug report, not sure it's worth the complexity since it seems specific to partial WebGL2 implementations like React Native.