当前位置:网站首页>HDRP shader gets pixel depth value and normal information

HDRP shader gets pixel depth value and normal information

2022-08-11 09:25:00 East Bear in the morning

Depth Value

Create a custom Pass

insert image description here

You can find that the template has already helped us get the depth value
Insert image description here
For details, see the official documentation: https://docs.unity3d.com/en/Packages/[email protected]/manual/Custom-Pass.html

References (but failed):
Get depth values ​​in HDRP - 8AM - https://blog.csdn.net/h5502637/article/details/86592210/

Normal

Add reference file

#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl"

The function is as follows

NormalData normalData;DecodeFromNormalBuffer(posInput.positionSS, normalData);return float4(normalData.normalWS, color.a)span>;

Results
insert image description here

原网站

版权声明
本文为[East Bear in the morning]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/223/202208110907164040.html