How to blur a background Texture?

Just want to add that the code uses the mipmaps from PMREMGenerator. These are different ones than the default mipmaps generated by gl.generateMipmap().

Related: Ability to reuse the PMREM generated texture from scene.environment - #5 by Mugen87

Apart from that, I’m not even sure something like BlurredEnvMapGenerator is useful for the OP since the original post just adds a “normal” texture to Scene.background (so no env map).

It’s probably best if you prepare the texture offline with a tool like GIMP before using it in your app. Alternatively, you can work with render-to-texture and use HorizontalBlurShader and VerticalBlurShader to apply a gaussian blur and then use the resulting render target as the background.

3 Likes