PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Get pixel location from shader

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: http://www.neilkemp.us/3d_comments.php?id=6

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
I think you'd be better off using a surface lock operation... and it could be faster than using the shader.