You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

20 lines
545 B

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));
}
}
}