Don't mix up texture and texture units. What has been called "texture unit" in former days are "samplers" today. Even with fixed functionality, it was well possible to bind the same texture to multiple texture units.Originally Posted by Yann LE PETITCORPS
What we want is achieve is to sample the same series of image data in a different way with each sampler accessing it.
For instance, I'd like to access a certain texture twice in a shader, once with GL_REPEAT and once with GL_CLAMP_TO_EDGE. Today this is only possible if I create two distinct texture objects (thereby replicating the image data, doubling the VRAM usage).
No, you cannot easily emulate this in a shader, because you also need to consider that one texture sample might tap the texture multiple times! Each tap needs to be wrapped independently.And about the wrapping, cannot this to be easily handled by something like (x%with,y%height) into shaders ?
The hardware does this very fast and efficient today.