Documentation

Page contents

Updated

Generate PDF from page.

Projector Omni Lit Legacy

Files: ProjectorOmniLitLegacy.shader
Path: “CGF/Shaders/Lit/VFX”
Shader menu: “CG Framework/Unlit/VFX/Projector Omni Lit Legacy”
Asset Store

Description

Projector system to project light, shadows or decals at a low GPU cost.

Reference

Use

Create a material with this shader and assign the material to the Material property of MeshRenderer component and add the CGFProjectorBehavior component to set the Projection mode (Orthographic or directional and Omni or point.) and the Lighting model type (Unlit, PBR (Standard) and PBR-like Blinn-Phong (Lit Legacy)).

To prevent to project onto some surfaces you can use the stencil options:

  1. On the projector material set the Stencil options like these:
    • Stencil ZFail Operation to Keep
    • Stencil Reference to 0
    • Stencil Read Mask to 1
    • Stencil Write Mask to 255
    • Stencil Compare Function to Equal
  2. On the material that should avoid the projection set the Stencil options like these:
    • Stencil Compare Function to Equal
    • Stencil Reference to 1
    • Stencil Read Mask to 255
    • Stencil Write Mask to 255
    • Stencil Comparison Function to Always
    • Stencil Pass Operation to Replace
    • Stencil Fail Operationto to Replace