Search Unity

How does projector work?? What is the basic theory of it??

Discussion in 'General Graphics' started by JohnSonLi, Mar 16, 2018.

  1. JohnSonLi

    JohnSonLi

    Joined:
    Apr 15, 2012
    Posts:
    586
    Anyone shows me a link to detail it?? cuz I am curious about it.
    Thx.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    There are two main parts to the projector. First is choosing which meshes it affects. For that it does a bounds test against for each mesh and the frustum of the projector. The same thing done for cameras, this is frustum culling. Then those meshes are rendered again, but with the projector’s shader. The shader gets passed two additional matrices along with the usual ones for rendering onto the screen. The first is a projection matrix that calculates a position within the XY coordinates of the projector’s frustum, this is just like those used to render to the screen from a camera, you’re basically calculating the “screen pos” of the projector. The second additional matrix is an orthographic matrix used to calculate a linear Z coordinate used by the falloff texture.
     
  3. JohnSonLi

    JohnSonLi

    Joined:
    Apr 15, 2012
    Posts:
    586
    Well, sort of understanding it. thanks