Whats going on, if i connect texture output to UV of another texture

Hello everyone!
So can anyone explain, what happens, when i connect some texture to UV input of another texture?

like this:

Or like just this:
image

Are pixels in final TextureSample node shifted/multiplied/resized per each pixel?
For example: is the pixel at point (0,0) from resulting node shifted/multiplied/resized by values from the corellated pixel(0,0) from first node?

Yes, this is known as a “dependent read.” The R and G values of the first texture, are interpreted as U and V coordinates for the second texture sampler.

While this is super powerful, it also has some challenges, mainly around:

  • performance: it makes it harder for the shader to hide the sampling latency
  • MIP mapping: fast shifts in U/V coordinates will generate blurry samples; if you compensate by adjusting the MIP level or turning of MIP mapping, you instead get slow texture reads

Both of these can be mitigated somewhat by making sure the texture on the left is filtered and smooth, and doesn’t have too much variation from pixel to pixel.

1 Like