Page 1 of 1

pixel coordinates for BitmapExpression

Posted: Mon Jul 02, 2012 11:19 pm
by shviller
Hello guys. Really sorry if this was already discussed (or, hopefully, even implemented), but I'd love two additional variables available inside BitmapExpression.

There are already X and Y that return the current coordinates in the 0..1 range. I'd love to be able to access the actual coordinates of a pixel. That is, for a pixel with X=1.0, Y=1.0 on a 64x128 bitmap, those coordinates will be PX=63, PY=127.

I know that

Code: Select all

int PX = round(X*(16<<BitmapName.Width));
int PY = round(Y*(16<<BitmapName.Height));
but I'm not sure about the whole half pixel offset thing, and I'd very much love to have a shortcut.

The use case is creating lookup textures for complex effects.

Thanks in advance!