How do projectors work?

After doing some experiments I have come to the conclusion that I don't really understand how projectors work in Unity. I put a projector at (100, 50, 100) and point it straight down. I put a terrain at (0,0,0) that's large enough to be effectively infinite. I project a black diffuse texture through the projector and it hits the terrain, making it black. I then put a plane with a solid red material in between the projector and the terrain (100, 20, 100). Both the plane and the terrain are now all black. (Shouldn't the terrain beneath the plane be its original color?). Now I move the plane until it only partially intersects the frustum of the projector, it is still all black. (Should only the portion that intersects the frustum be black?). Only when it completely does not intersect the frustum does the plane turn red (its original color)

I want to be able to project a green circle onto the surface of a sphere, and I can't quite figure out how projectors work.

Projectors are somewhat counter-intuitive, caused by the way they work. How a projector works is by using a system similar to a camera by having it’s own view projection matrices. When a surface is drawn, in addition to the camera drawing it, the projector also renders it out into it’s own view space. Then, if an area is inside the projectors view space and also within the mask, the projector will make that area darker.

The reason the plane does not block the projector is doing that would also involve rendering two depth maps, something Unity would rather avoid.

To put it in layman’s terms. Projectors are kind of lame but good for singular effects. They are like a light that shines on a whole scene. Just because you put blinders on the light to limit it to a frustum it does not actually do any clipping (like a camera frustum would).

The limits of the frustum just tell it how to orient the image but it is really a huge repeating tiled image. The ‘clamping’ on the texture image allows the repeating tiles to repeat the last pixel on the edge of the texture. Clamp on a texture is like capping a floating point number using Ceil or Floor but it clamps the U,V values. Repeat is like performing Mod (Modulus) on the U,V’s so every U,V stays between 0 and 1. The tiling image you see you should imagine as a grid of U,V values where the values are usually 0,0 to 1,1 where you see the frustum but count up or down beyond that (-3, -2, -1, 0, 1, 2, 3, 4, 5…). Clamp does this (0, 0, 0, 0, 1, 1, 1, 1, 1). Repeat does this (0, 1, 0, 1, 0, 1, 0, 1, 0,…).

Ultimately, the ENTIRE surface is drawn over on every frame so using this more than a few times can really drag your game down. Modern cards can put out multiple textures (mutitexturing) in one call so it’s only abusive after a set number of texture layers. Just imagine each projector as adding another layer to your terrain and other surfaces.