Advertisement
Guest User

CommandBufferLight.cs

a guest
Mar 25th, 2021
595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.Rendering;
  3.  
  4. [ExecuteInEditMode]
  5. public class CommandBufferLight : MonoBehaviour
  6. {
  7.     CommandBuffer cmd;
  8.     Light lightC;
  9.     public string shadowTexName = "_DirectionalShadowMap";
  10.     // Start is called before the first frame update
  11.     void Start()
  12.     {
  13.         lightC = GetComponent<Light>();
  14.         cmd = new CommandBuffer();
  15.         cmd.name = "Shadows";
  16.         cmd.SetGlobalTexture(shadowTexName, BuiltinRenderTextureType.CurrentActive);
  17.         lightC.AddCommandBuffer(LightEvent.AfterScreenspaceMask, cmd);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement