oh my poor English. Please, bear with me.
I'm trying to figure out the math in texture projection. and such shader code comes to me:
half4 col = tex2Dproj( _GrabTexture, i.uvgrab);
//half4 col = tex2D( _GrabTexture, i.uvgrab);
half4 col = tex2Dproj( _GrabTexture, i.uvgrab);
equals to
half4 col = tex2D( _GrabTexture, i.uvgrab / i.uvgrab.w);
what I don't get is the reason for this.
the concept of texture projection is finding the texcoord of each vertex in projector's draw call, and convert screen coords([-1,1], [-1, 1], [ -1,1]) to clamped texture coords ([0,1], [0, 1], [ -1,1]) . and then the modified screen coords can be used to sample frame buffer(rt) and draw those vertices again. But it seems to me at this point it's sufficed. I don't see the reason to divide the depth field.
can anyone give me a clue.