blur
Performs a high-quality, directionally-controlled convolution blur on a cubemap, primarily to simulate the blurred reflections of varying roughness levels in PBR materials.
Core Advantages
Encapsulates an extremely complex spherical blur algorithm, including handling pole singularities, into a robust, efficient, and easily integrated node, making it a key tool for generating PBR pre-filtered environment maps (PMREM).
Common Uses
Generating PBR pre-filtered environment maps (PMREM) to simulate reflections for different roughness levels.
Creating real-time "frosted glass" or blurred reflection/refraction effects.
Producing stylized blurred reflections, like motion blur, for Non-Photorealistic Rendering (NPR).
How to adjust
The effect is mainly controlled by adjusting `dTheta` (blur radius) and `samples` (blur quality). A larger `dTheta` creates a wider blur, while more `samples` result in a smoother transition at a higher performance cost. The `latitudinal` parameter can switch the blur direction (horizontal or vertical). Its most classic use is mapping a material's `roughness` to `dTheta` to achieve a smooth transition from sharp to blurry reflections.
Code Examples
1// Blurs the envMap centered around the outputDirection
2// dTheta controls blur radius, samples controls quality
3const blurredColor = blur( envMap, outputDirection, weights, samples, dTheta, mipInt, latitudinal, poleAxis );