Members - Reputation: 144
Posted 10 October 2012 - 05:03 AM
I'll be glad if someone could explain. Thanks. =)
Members - Reputation: 1831
Posted 10 October 2012 - 05:20 AM
But note that the homogeneous/perspective divide by W is not a linear operation, but since that's done inside the GPU per-pixel, it's ok.
To do projective texturing, project the world space position of the vertex using the projection matrix of the projector and pass the projected point out as a varying vector. In pixel shader, sample the texture using the projected coordinates as the UV coordinates for the sampler.
Moderators - Reputation: 9126
Posted 10 October 2012 - 10:43 AM
Edited by Brother Bob, 10 October 2012 - 10:44 AM.