UE5的渲染Debug技巧
ShaderPrint
UE5相对UE4使用的ComputeShader(GPU Driven)的地方多很多。因为UE5为了方便查看ComputeShader的某些值,开发了“ShaderPrint”,方便直接在Shader 打印信息到屏幕,而不用采用CPUReadback在print的方式。
比如r.nanite.ShowStats等命令是采用了ShaderPrint
如何接入ShaderPrint
r.Lumen.ScreenProbeGather.RadianceCache.Stats是一个比较好的例子,得同时在CPP端和CS端加额外实现。
LumenRadianceCacheDebug.usf是典型案例
CPP端
CS端
ShaderPrintZoom
探测鼠标所在屏幕的局部区域进行像素放大,可以放大化看某些问题
渲染资源显存占用(buffer和Texture)
参考
Advanced Rendering and Debugging Tips for Unreal Engine 5 | Unreal Fest Gold Coast 2024