- Home /
 
 
               Question by 
               dbc_orp_kids · Jun 04, 2016 at 03:51 PM · 
                texturegraphicstexture2dwrapmode  
              
 
              Texture sampling - clamping to a border color
I am looking for a way to sample a texture in a shader which would return a constant border color for out-of-texture look-ups.
So if my shader samples the texture with UV coordinates that are outside of the regular UV square, I want the sample to not be from a repeated texture nor a mirrored texture, but instead simply a constant color (in my case black).
This would be useful for certain image processing effects that I'm trying to implement.
For example, in HLSL you can use sampler_state to declare AddressU = Border, and provide a border color with BorderColor = float4(0.0f, 0.0f, 0.0f, 0.0f). It seems to me, however, that such behavior is not possible with Texture.wrapMode...
Am I missing out on something? Any help would be appreciated.
               Comment
              
 
               
              Your answer