Rasagar/Library/PackageCache/com.unity.render-pipelines.high-definition/Samples~/WaterSamples/Scripts/ProjectCaustics.cs

21 lines
545 B
C#
Raw Normal View History

2024-08-26 13:07:20 -07:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
[ExecuteInEditMode]
public class ProjectCaustics : MonoBehaviour
{
public Material decal;
public WaterSurface waterSurface;
public float regionSize = 20f;
void Update()
{
if(waterSurface.GetCausticsBuffer(out regionSize) != null && decal.GetTexture("_Texture2D") == null)
{
decal.SetTexture("_Texture2D", waterSurface.GetCausticsBuffer(out regionSize));
}
}
}