Is the texture coordinate format for SampleLevel the same as the viewport (ie +-1.0 x and y) or is it integer based?
The reason I ask is I need to do a edge check in my pixel shader where I will sample 4 pixels around each point to see if they are black. Not sure how to go about this.
Also, anyone got a efficient solution for a white noise generator in HLSL? I found this: http://www.reedbeta.com/blog/2013/01/12/quick-and-easy-gpu-random-numbers-in-d3d11/
but from the comments I understand it can be rather slow.
Also found this in the comments:
return fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);
But would like to know if there is anything faster out there. I want to noise up the texture for a certain distance within the edges as I locate them.
Edited by Naruto-kun, 09 February 2014 - 08:40 AM.