PDA

View Full Version : is this method any good (FP)?



tellaman
03-11-2003, 02:44 PM
i was wondering if this is a good way to get frag position in eye space from a frag prog:

get fragment.position (window coords)
add w/2 to x and h/w to y (where w and h are viewport dims)
unproject with matrix.projection.inverse

it seems to work but i havent tested it extensively yet
please let me know your thoughts thanks

ScottManDeath
03-12-2003, 02:19 AM
Originally posted by tellaman:
i was wondering if this is a good way to get frag position in eye space from a frag prog:

get fragment.position (window coords)
add w/2 to x and h/w to y (where w and h are viewport dims)
unproject with matrix.projection.inverse

it seems to work but i havent tested it extensively yet
please let me know your thoughts thanks

Hi

well, I do it by calculating the eye space position in a vertex program and then I interpolate it in a texture coordinate.

Bye
ScottManDeath