viewportMipTexture
Provides a viewport texture with an automatically generated and complete Mipmap chain, key for implementing high-performance blur, bloom, and other effects.
Core Advantages
Fully automates the complex Mipmap generation process, allowing developers to sample low-resolution versions of the screen with very high performance, thus easily achieving real-time effects like bloom and frosted glass that require extensive blurring.
Common Uses
Bloom Effect
Frosted Glass / Distortion Refraction
LOD (Level of Detail) Reflections
How to adjust
Controlled by adjusting its `uvNode` and `levelNode` parameters. `uvNode` controls the sampling position for spatial distortions, while `levelNode` controls the Mipmap level to vary the amount of blur, for instance, by linking `level` to time or the distance from the screen center.
Code Examples
1// Sample the 4th Mipmap level (a low-resolution, blurred version)
2const blurredColor = viewportMipTexture( null, float( 4.0 ) );
3
4// Return the blurred color as the output
5return blurredColor;