needle-engine-support icon indicating copy to clipboard operation
needle-engine-support copied to clipboard

WebGL Error on mobile. INVALID_OPERATION: readPixels: pixels is not TypeUint16

Open snorulf opened this issue 2 years ago • 2 comments

Describe the bug 💬

Tester is getting random crashes on Iphone. Pulled this error from log.

[Error] WebGL: INVALID_OPERATION: readPixels: pixels is not TypeUint16
	readPixels
	(anonymous function) (index-ac4969aa.js:3564:87659)
	fromCubeRenderTarget (index-ac4969aa.js:4250:3865)
	getSphericalHarmonicsArray (index-ac4969aa.js:4255:17531)
	(anonymous function) (index-ac4969aa.js:4255:16656)
	(anonymous function) (index-ac4969aa.js:4255:16689)

Is this related to https://github.com/mrdoob/three.js/issues/26765 ? If so, sounds fixed by Three?

We're using a procedural skybox and three reflection probes. Crash appears to happen at random times, sometimes instantly and sometimes after quite a while.

Operating System 👩‍💻

iOS (mobile)

What browsers are you seeing the problem on? 🏄‍♂️

Safari

Editor Version 🎲

2022.x

Needle Exporter version

3.24.0

Project Info (Unity only) 📜

No response

Steps to reproduce 🔢

Sry for no steps to repro here.

Reproduction ♻

No response

Discord or Discussion link

No response

Validations 🩹

snorulf avatar Dec 04 '23 10:12 snorulf

Thanks, I believe I've seen this before and it's not related to spherical harmonics – instead seems to be related to our on-device poster generation in dev mode running out of memory on some devices (I've seen it on older iOS devices).

We'll investigate; in the time being you can disable poster generation in the vite.config.js by adding noPoster: true: image

We'll also soon-ish update three.js again, I do think that cubemap readback error should go away then.

hybridherbst avatar Dec 05 '23 12:12 hybridherbst

Ok, I'll try that. But in dev mode? Maybe I misunderstand here but this happens on production builds.

snorulf avatar Dec 06 '23 08:12 snorulf