In the realm of three.js, there exist 3 wrapping modes:
THREE.RepeatWrapping
THREE.ClampToEdgeWrapping
THREE.MirroredRepeatWrapping
For instance:
var texture = new THREE.TextureLoader().load( "textures/water.jpg" );
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
My use case involves using textures in shaders for gpgpu computing. I aim to have the texture return zero outside its boundaries. When ClampToEdge is used, attempting to access values beyond the texture bounds will result in fetching the color of the closest pixel within the bounds. For example, requesting a value at coordinates (1.3, .5) will actually retrieve the color at (1., .5) as 1.3 exceeds the valid texture coordinates.
Therefore, my goal is to obtain zero outside the limits. Alternatively, if this isn't achievable, I seek a method to consistently set the boundary values to zero. What approach would be most effective for achieving this?