Multisampling on newer iOS depth/stencil issue
See original GitHub issueDescription of the bug
The scene depth/stencil rendering is broken on iOS devices version 15.4+ (supporting WebGL 2.0) when multisampling is enabled. This works as intended on the desktop and also on older iOS devices, where WebGL2 is not supported. When the multisampling property is removed, all works even on 15.4+ iOS versions. Tested on several iOS devices.
This video shows what is happening:
To Reproduce
Everything is standard code for working with PP.
const renderer = new THREE.WebGLRenderer({
powerPreference: "high-performance",
antialias: false,
stencil: false,
depth: false
});
const maxSamples = renderer.capabilities.maxSamples;
const composer = new EffectComposer(renderer, { multisampling: Math.min(4, maxSamples) });
const noiseEffect = new NoiseEffect({premultiply: true})
const effectsPass = new EffectPass(
camera,
noiseEffect
);
composer.addPass(new RenderPass(scene, camera));
composer.addPass(effectsPass);
Expected behavior
This video shows the expected behaviour. It is the same footage as the previous one, but without the issue / multisampling set to 0:
Library versions used
- Three: 0.144.0
- Post Processing: 6.28.7
Mobile
- Device: iPhone SE 2020
- OS: iOS 15.4+
- Browser: Safari / Chrome
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Copying depth texture to buffer on… | Apple Developer Forums
P.S.: I'm running iOS 9.3.5 on an iPhone 6 and an iPad Pro. Implementation roughly looks like this (using non multi-sampling):. MTLRenderPassDescriptor ...
Read more >Multisampling on iOS can't get depth texture? - Stack Overflow
I have set up rendering to a framebuffer with color and depth textures on iOS, all works ok. I then tried to add...
Read more >Using modern OpenGL ES features with ... - Qt
It conveniently hides the differences between OpenGL and OpenGL ES, enables easy usage of packed depth-stencil attachments, multisample ...
Read more >Multisampled Render Targets and Resolve Operations · Issue ...
(2) There is no “resolveTarget” field for depth or stencil attachments, and the field “hasResolveTarget” of "depthStencilAttachment" must be ...
Read more >Reading the Depth Buffer in Apple's Metal API
And this is where weird problems started to occur. When I used a large render target size (e.g. 2048×2048 or more), everything worked...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can also confirm that this bug is no longer present on iOS v15.7
I was able to reproduce the issue on an iPhone 13 with iOS v15.4 via browserstack but I did not see the bug on iOS v15.5. So it looks like this was fixed in v15.5.
I used the following Sandboxes for testing: