URP
URP doesn’t support OnPreCull
, OnPreRender
, OnPostRener
, and OnRenderImage
. URP does support OnRenderObject
and OnWillRenderObject
, but it doesn’t support recursive rendering. URP has 4 new hooks:
RenderPipelineManager.beginFrameRendering
RenderPipelineManager.beginCameraRendering
RenderPipelineManager.endCameraRendering
RenderPipelineManager.endFrameRendering
// we can subscribe these events
private void OnEnable()
{
RenderPipelineManager.beginCameraRendering += ExecuteRenderActions;
}
public void ExecuteRenderActions(ScriptableRenderContext context, Camera camera)
{
// rendering code ..
}
Planar Reflection
The idea is to create a reflected camera to render the screen from below, and render what the reflected camera sees on the planar. Use Householder transformation to calculate the reflection matrix of the plane, and update the reflected camera’s worldToCamera
matrix.
To clip the objects below the plane, we can calculate the oblique projection.
Resource
Inkle: https://www.inklestudios.com/ink/ This is a tool to create narrative for games. It has multiple integration with different platforms.
Procedural
catlikecoding: https://catlikecoding.com/unity/tutorials/procedural-grid/
triangulation: https://brilliant.org/wiki/polygon-triangulation-grids/