-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Closed
Labels
Description
Description
When trying to use the LightProbeGenerator there are some cases where it fails.
The error message is different on
Safari: Error: WebGL: INVALID_OPERATION: readPixels: pixels is not TypeUint16
Chrome: WebGL: INVALID_OPERATION: readPixels: type HALF_FLOAT but ArrayBufferView not Uint16Array
and the coefficients being returned are all 0.
Reproduction steps
Run the fiddle in Safari or Chrome
Note WebGL: INVALID_OPERATION: readPixels: pixels is not TypeUint16 error in the console
Code
new EXRLoader().load('https://dl.polyhaven.org/file/ph-assets/HDRIs/exr/1k/farm_sunset_1k.exr', reflection => {
const size = Math.min(reflection.image.width, 512);
const target = new THREE.WebGLCubeRenderTarget(size);
let rt = target.fromEquirectangularTexture(renderer, reflection);
const sampledProbe = LightProbeGenerator.fromCubeRenderTarget(renderer, rt);
console.log("spherical harmonics", sampledProbe.sh);
});Live example
https://jsfiddle.net/tkgobqnc/20/
Screenshots
No response
Version
r156
Device
Desktop
Browser
Chrome, Firefox, Safari, Edge
OS
MacOS