I can acces to the UV position of one texture in this way:
But I need the orientation too, it could be easy if I could get the .x coordinate of the adjacent pixels, it is trivial using pixel shaders:
- Code: Select all
// (red channel of the texture sampler represents the u coordinate)
currentU=Tex2D(mySampler, float2(myCoords.x, myCoords.y));
nextU=Tex2D(mySampler, float2(myCoords.x+1/widthOfImage, myCoords.y));
previousU=Tex2D(mySampler, float2(myCoords.x-1/widthOfImage, myCoords.y));
upperU=Tex2D(mySampler, float2(myCoords.x, myCoords.y+1/heightOfImage));
lowerU=Tex2D(mySampler, float2(myCoords.x, myCoords.y-1/heightOfImage));
Is there any way to access to other pixels? Is there anyway to detect the orientation?
Thanks in advance, Víctor.