using System; using UnityEngine; using UnityEngine.Rendering; // Token: 0x02000075 RID: 117 [ExecuteInEditMode] [RequireComponent(typeof(Light))] public class CopyShadowsBaker : MonoBehaviour { // Token: 0x06000B90 RID: 2960 RVA: 0x000DFFDA File Offset: 0x000DE1DA private void OnEnable() { this.lightComponent = base.GetComponent(); this.SetupCommandBuffer(); } // Token: 0x06000B91 RID: 2961 RVA: 0x000DFFEE File Offset: 0x000DE1EE private void OnDisable() { this.lightComponent.RemoveCommandBuffer(LightEvent.AfterScreenspaceMask, this.commandBuffer2); this.ReleaseCommandBuffer(); } // Token: 0x06000B92 RID: 2962 RVA: 0x000E0008 File Offset: 0x000DE208 private void Update() { if (this.reset) { this.OnDisable(); this.OnEnable(); this.reset = false; } if (this.tex == null || this.w != (float)Screen.width || this.h != (float)Screen.height) { if (this.tex != null) { this.tex.Release(); } this.w = (float)Screen.width; this.h = (float)Screen.height; this.tex = new RenderTexture(Screen.width, Screen.height, 24, RenderTextureFormat.ARGB32); } } // Token: 0x06000B93 RID: 2963 RVA: 0x000E00A4 File Offset: 0x000DE2A4 private void SetupCommandBuffer() { this.commandBuffer2 = new CommandBuffer(); RenderTargetIdentifier renderTargetIdentifier = BuiltinRenderTextureType.CurrentActive; this.commandBuffer2.Blit(renderTargetIdentifier, this.tex, this.material); this.commandBuffer2.SetGlobalTexture(this.textureSemanticName2, this.tex); this.lightComponent.AddCommandBuffer(LightEvent.AfterScreenspaceMask, this.commandBuffer2); } // Token: 0x06000B94 RID: 2964 RVA: 0x000E010E File Offset: 0x000DE30E private void ReleaseCommandBuffer() { this.commandBuffer2.Clear(); } // Token: 0x040011A9 RID: 4521 public string textureSemanticName = "_EnvironmentShadows"; // Token: 0x040011AA RID: 4522 public string textureSemanticName2 = "_EnvironmentShadowsScreenSpace"; // Token: 0x040011AB RID: 4523 public bool reset; // Token: 0x040011AC RID: 4524 private CommandBuffer commandBuffer; // Token: 0x040011AD RID: 4525 private CommandBuffer commandBuffer2; // Token: 0x040011AE RID: 4526 private Light lightComponent; // Token: 0x040011AF RID: 4527 public RenderTexture tex; // Token: 0x040011B0 RID: 4528 public RenderTexture pointLightTexture; // Token: 0x040011B1 RID: 4529 public Material material; // Token: 0x040011B2 RID: 4530 private float w; // Token: 0x040011B3 RID: 4531 private float h; // Token: 0x040011B4 RID: 4532 public Transform pointLight; }