Material Editor
When you choose one of the Projector Shaders for a material, you can see “Projector Type” property in the material editor.

Usually, you can just use “Unity Projector” type (default value).

“Custom Projector” is used with “ProjectionReceiverRenderer” component. If the projector material doesn’t have “Custom Projector” type, it will duplicate the material to change the type. If you chose “Custom Projector” type in advance, duplicate will not happen.

“ProjectionReceiverRenderer” is used for lightmapped mesh receiver (see Mixed Lighting Blob Shadow Projector section). It is better to use “Custom Projector” type for the mixed lighting blob shadow materials.

“Projector For LWRP” type should be used when you use Projector For LWRP.

FastShadowReceiver/Projector/Multiply
FastShadowReceiver/Projector/Multiply Without Falloff

These shaders are similar to “Projector/Multiply Shadow” shader which is included in Standard Assets (Projectors). The difference is both of the FashShadowReceiver shaders have “Shadow Darkness” property to control shadow darkness.

“FastShadowReceiver/Projector/Multiply” have FallOff texture like “Projector/Multiply Shadow” shader (the left image). On the other hand, “FastShadowReceiver/Projector/Multiply Without Falloff” doesn’t have FallOff texture. So, the shadow which is far from the projector is still dark (the right image), and this shader is faster than the others.

screenshot-multiply screenshot_multiply_nofalloff

 

FastShadowReceiver/Projector/Multiply Diffuse
FastShadowReceiver/Projector/Multiply Diffuse Without Falloff

These shaders take into account normal vectors of a surface like diffuse lighting so that shadows can be more realistic. Also, these shaders can avoid the backside projection problem whereby a shadow is projected on a surface which is not facing to the projector.

These shaders require normal vectors. Don’t forget to check ‘Has Normals’ property in MeshShadowReceiver if any.

screenshot_multiply_diffuse screenshot-multiply_diffuse_nofalloff

 

FastShadowReceiver/Projector/Multiply Lightmap Subtractive Shadow
FastShadowReceiver/Projector/Multiply Lightmap Subtractive Shadow Without Falloff

These shaders can be used when you are using mixed lighting with subtractive mode. The shadows casted by these shader are mixed with the shadows in the lightmaps to remove the overlapping shadows which can be seen in the screenshots above.

In subtractive mode, a lightmap has both direct and indirect light contributions in a single texture, and there is no way to find out how much the direct light is shadowed by the static objects. So, these shaders requires ‘Ambient Color’ property to be set as the darkest color of the shadows.

If you want to use these shaders, please have a look at Mixed Lightmap Blob Shadow Projector section.

 

FastShadowReceiver/Projector/Multiply Lightmap Shadowmasked Shadow
FastShadowReceiver/Projector/Multiply Lightmap Shadowmasked Shadow Without Falloff

These shaders have the same features as the previous shaders, but for ‘shadowmask’ mixed lighting mode.

Unlike subtractive mode, lightmaps have only indirect light information, and ‘Ambient Color’ property is not needed.

However, these shaders need another property ‘Shadowmask Channel’ because a single shadowmask texture can have shadows for up to 4 lights by using R, G, B and A channels. The default value of ‘Shadowmask Channel’ property is (1, 0, 0, 0) which means it uses only R channel.

If you want to use these shaders, please have a look at Mixed Lightmap Blob Shadow Projector section.

 

FastShadowReceiver/Projector/Multiply Diffuse x Shadowmask
FastShadowReceiver/Projector/Multiply Diffuse x Shadowmask Without Falloff

These shaders are simpler version of ‘Mulitply Lightmap Shadowmasked Shadow’ shaders above. They use only a shadowmask texture and they are faster to draw shadows. But usually, subtractive mode has better performance. You should use these shaders only when you have to use shadowmask mixed lighting mode, but don’t care very much about shadow quality.

These shaders requires ‘Ambient’ property to control shadow intensity, because they don’t use lightmaps which contain indirect light information.

If you want to use these shaders, please have a look at Mixed Lightmap Blob Shadow Projector section.

 

FastShadowReceiver/Projector/Visualize Receiver

This shader is used for debug purpose. It can visualize meshes which are receiving a shadow from the projector.

screenshot_visualize

Links

One thought on “Projector Shaders

  • 2017/06/10 at 4:40 PM
    Permalink

    A shader to add light to objects could be used to project any image onto other objects, similarly to an overhead projector or a movie projector.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Anti Spam Code *