// Use this for initialization
    void Start()
    {
        Camera lightCamera = CreateCamera.Execute(gameObject, depthShadowMap);
        Camera viewCamera  = Camera.main;

        if (frustumType == FrustumType.FIT_TO_SCENE)
        {
            SetFitToScene(lightCamera);
        }
        else
        {
            SetFitToView(lightCamera, viewCamera);
        }

        CaptureDepth depthCapturer = lightCamera.gameObject.AddComponent <CaptureDepth>();

        depthCapturer.SetCaptureShader(depthCaptureShader);

        SetProjectionMatrix.Execute(lightCamera);
    }
Beispiel #2
0
    void Update()
    {
        CaptureDepth cd = GetComponentInChildren <CaptureDepth>();

        Shader.SetGlobalMatrix("_LightViewProjMatrix", cd.lightViewProjMatrix);
    }