Page 1 of 1

Get pixel location from shader

PostPosted: Oct 3, 2005 @ 12:34pm
by noaktree
Hi,

I just found PocketFrog and am interested in the pixel shaders. I see that you can get the color of the source and destination pixels within the shader. Is there an easy way to get the current pixel's screen (x,y) location?

I made this:

If you look at the source you will see that I did a cheap trick to maintain a pixel cursor during a fragment run. This only works with non-masked rectangular sprites though.

Thanks,
Neil

PostPosted: Oct 3, 2005 @ 1:56pm
by fast_rx
I think you'd be better off using a surface lock operation... and it could be faster than using the shader.