Created
May 3, 2022 11:38
-
-
Save niuage/2cb875f35686281a6700a4e66ab4f33b to your computer and use it in GitHub Desktop.
Caustics feature for setting the light direction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Rendering.Universal; | |
public class CausticsFeature : ScriptableRendererFeature | |
{ | |
[System.Serializable] | |
public class CausticsSettings | |
{ | |
public RenderPassEvent renderPassEvent = RenderPassEvent.AfterRenderingTransparents; | |
public Material causticsMaterial; | |
} | |
CausticsPass pass; | |
public CausticsSettings settings = new(); | |
public override void Create() | |
{ | |
pass = new CausticsPass(settings); | |
} | |
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData) | |
{ | |
renderer.EnqueuePass(pass); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment