I'm trying to construct a Matrix to use in a shader for a projector. Projection-shaders normaly use _Projection and _ProjectionClip Matrices, and I want to replace _ProjectionClip with my own Matrix. The goal is to use the second Texture step to cut a hole in the first texture. I'd like to move that hole too, so I need to update the Matrix at various points. I'm using orthographic projection and wanted to first see if I could replace _Projection with my own Matrix and get exactly the same result. Tried with MAtrix4x4.Ortho, feeding in the orthoSize and clipPlanes from the projector but I guess I need to transform it into world sapce too? Any help apprecieated, thanks, Patrik
Added a camera (inactive) to the projector gameObject and set it up to match the projector. This code: Code (csharp): _ClipMatrix = c.projectionMatrix*c.worldToCameraMatrix; where c is the camera gets me closer to what I want. The projected image is offset and rotated, but not stretched or otherwise distorted. Moving on... /P