Files
UltimateFishing/Assets/Scripts/Assembly-CSharp/UltimateWater/WaterShadowCastingLight.cs
2026-02-21 16:45:37 +08:00

24 lines
720 B
C#

using UnityEngine;
using UnityEngine.Rendering;
namespace UltimateWater
{
public sealed class WaterShadowCastingLight : MonoBehaviour
{
private CommandBuffer _CommandBuffer;
private void Start()
{
int waterShadowmap = ShaderVariables.WaterShadowmap;
_CommandBuffer = new CommandBuffer
{
name = "Water: Copy Shadowmap"
};
_CommandBuffer.GetTemporaryRT(waterShadowmap, Screen.width, Screen.height, 32, FilterMode.Point, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
_CommandBuffer.Blit(BuiltinRenderTextureType.CurrentActive, waterShadowmap);
Light component = GetComponent<Light>();
component.AddCommandBuffer(LightEvent.AfterScreenspaceMask, _CommandBuffer);
}
}
}