minh
June 14, 2022, 7:11am
1
What is the background effect?
Thank you!
Sidenote: three.js
does currently not support blurring the scene’s background. Meaning the environment map has to be blurred before you apply it to the scene. However, the engine might support a more flexible solution in the future, see:
mrdoob:dev
← Mugen87:dev63
opened 04:00PM - 12 Mar 22 UTC
Related issue: -
**Description**
We have tried to integrate background blu… rriness in the past (e.g. #20463), however the approach at that time wasn't right. This one uses `textureCubeLodEXT()`/`textureLod()` to retrieved blurred samples of the configured environment map.
The PR introduces `WebGLRenderer.setBackgroundBlurriness()` which accepts values in the `[0,1]` range. Because `textureCubeLodEXT()`/`textureLod()` relies on mipmapping, the environment map has to set `generateMipmaps` to `true` and also use `LinearMipmapLinearFilter`.
Important: The configuration of the environment map has to be done on app level and can't be changed in `WebGLBackground`. That's because equirectangular textures are internally converted to cube map render targets and it is not possible to change render target texture parameters after their creation right now, see #14375.
1 Like