pmremTexture
Samples a pre-filtered environment map (PMREM) to achieve high-performance, physically-based reflections and lighting that vary with roughness.
Core Advantages
Achieves physically accurate blurred reflections with minimal performance cost using pre-computed Mipmap levels, and unifies both specular and diffuse environment lighting from a single map, making it core to PBR.
Common Uses
PBR Material Metal/Mirror Reflections
Scene Background/Skybox
Calculating Indirect Diffuse Light (IBL)
How to adjust
Adjusting the `levelNode` (blur level) is key. Connecting a low value (e.g., `float(0)`) yields sharp, mirror-like reflections, while a high value results in a fully blurred, diffuse effect. The most common use is connecting it to the material's `roughness` node, allowing the reflection blur to change dynamically and smoothly with the surface roughness.
Code Examples
1// Sample the PMREM texture using the reflection vector and roughness
2const envColor = pmremTexture( texture( envMap ), reflectVec, roughness );