Double multiplied by far clip plane
Closed this issue · 3 comments
jcowles commented
Shouldn't the far clip plane already be accounted for by the inverse projection? Why is the ray multiplied by far again?
keijiro commented
No. vpos
is on the near clip plane in the clip space, then mul(unity_CameraInvProjection, vpos)
gives the positions of the near clip plane vertices. We can get the far vertices of the view frustum by multiplying it with far
.
keijiro commented
I'm closing this issue. Please feel free to reopen for further questions.
jcowles commented
That doesn't make sense to me, why would near * far = far?
I haven't done the math yet, but my hunch is that ray should be divided by W (after mul), but W is currently ignored. I check the math and report back, no need to reopen.