深度分析屏幕空间反射算法以及在URP中的实现(二)
【USparkle专栏】如果你深怀绝技,爱“搞点研究”,乐于分享也博采众长,我们期待你的加入,让智慧的火花碰撞交织,让知识的传递生生不息! 前言 湿润的地面,倒映着远方青山,什么样的技术才能造就如此绚丽的效果呢? 本文实现的效果: 使用法线贴图的效果 平滑地面 代码仓库: GitHub: Screen Space Reflection in URP Unity版本:2022.3.60f1c1 URP版本:14.0.12 使用延迟渲染 本文承接《深度分析屏幕空间反射算法以及在URP中的实现(一)》。 二分搜索 核心代码实现: // 屏幕空间RayMarching判断 bool ScreenSpaceRayMarching(inout float2 currPosSS, inout float currInvW, float2 dPosSS, float dInvW, float rayZ, bool isVertical, out float deltaZ, inout float2 hitUV, float2 endSS, float dir, float stepCount)…
Read More