so in webr xr lighting estimation we get xrLight.environment
cubeMap as seen in this webxr example three.js examples
which
when used on meshPhongMaterial.envMap
and scene.background
works fine
but
when used on scene.environment
or meshStandardMaterial.envMap
does not work
am i missing something here ?
i tried material.needsUpdate=true after updating envMap but no luck
Top sphere : cubemap on meshPhong.envMap
Bottom sphere: cubemap on meshStandard.envMap
Background : cubemap on scene.background
Using PMREMGenerator .fromCubemap() texture as environment i’m able to get this output (bottom sphere is meshstandard mat)
also there’s some warnings three.module.js:27070 WebGL: INVALID_OPERATION: drawBuffers: COLOR_ATTACHMENTi_EXT or NONE
&
using texture.mapping = THREE.CubeReflectionMapping
gives black
@Mugen87 any idea what can be done here ?
This use case is currently not supported. However, there is a PR trying to fix this:
mrdoob:dev
← Mugen87:dev19
opened 09:08AM - 07 Jan 22 UTC
Related issue: -
**Description**
This PR restores the PBR materials suppor… t of `XREstimatedLight` . I have some concerns though:
The WebXR API returns an environment map which seems to be an irradiance environment map. I'm not sure but is this type of map the intended input of `PMREMGenerator`?
Wouldn't it be more correct to transform the irradiance environment map to an instance of `LightProbe` (since we can't directly sample irradiance environment maps right now) and add it to the scene?
Besides, `XREstimatedLight` uses an instance of `LightProbe` and `DirectionalLight` for representing the estimated lighting. Does it make sense to add an instance of `XREstimatedLight` _and_ the irradiance environment map to the scene? Isn't the irradiance added twice now?
/cc @toji
1 Like