textureLoad
Fetches the raw, unfiltered data of a single pixel (texel) from a texture using precise integer coordinates, bypassing any interpolation or filtering.
Core Advantages
It guarantees exact, unmodified data retrieval from a specific texel, which is essential for using textures as data look-up tables (e.g., in GPU simulations) and for achieving crisp, 'pixel-perfect' rendering styles.
Common Uses
Reading from data textures (e.g., for GPU particles)
Rendering crisp, unfiltered pixel art
Custom image processing algorithms
How to adjust
By changing the integer coordinate `uvNode` to read from a different pixel, which results in a discrete 'jump' in the output value. You can also change the `levelNode` to read from a different mipmap, effectively sampling from a lower-resolution version of the texture.
Code Examples
1
2// Define the precise integer coordinate (column 15, row 22) of the pixel
3const texelCoord = ivec2( 15, 22 );
4
5// Fetch the exact, unfiltered color of that single pixel from mip level 0
6const pixelColor = textureLoad( myDataTexture, texelCoord, int( 0 ) );