kruseborn
02-26-2009, 01:39 AM
Im am drawing a cube around a position. what i want is to get a vector from the camera(eye position) to the pixel I am drawing.
I have tried to just take the (vertex position - eye pos) in the pixel shader but that does not give the right answer, its just gives me the vector to the vertex position. In some way it is possible to get the view vector to the pixel its drawing but i cant get it to work.
Does anyone now how?
I have tried to just take the (vertex position - eye pos) in the pixel shader but that does not give the right answer, its just gives me the vector to the vertex position. In some way it is possible to get the view vector to the pixel its drawing but i cant get it to work.
Does anyone now how?