深度值
创建一个自定义Pass
可以发现模板中已经帮我们获取好深度值了
详情见官方文档:https://docs.unity3d.com/cn/Packages/com.unity.render-pipelines.high-definition@7.4/manual/Custom-Pass.html
参考文献(但失败):
HDRP中获取深度值-上午八点-https://blog.csdn.net/h5502637/article/details/86592210/
法线
添加引用文件
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl"
函数如下
NormalData normalData;
DecodeFromNormalBuffer(posInput.positionSS, normalData);
return float4(normalData.normalWS, color.a);
结果