Global Position to UV Offset in spatial shader

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By droc101

I am trying to take a large image (4096x4096), and select a part of it from the world position of the mesh(128x128). The pixel position of the texture would be the same as the world position of the vertex. I would like this to be usable with both the fragment and vertex functions in a shader.