Unity HDRP Custom Pass 实现场景雪地效果

先使用Shader Graph连一个使用模型法线添加雪地的shader,并赋给一个material。

1.1 先拿到模型世界坐标下的顶点法线,简单处理一下,赋给透明度即可。

给场景添加Custom Pass,剔除不需要的层级。

1.在Hierarchy界面中,右键创建Volume -> Custom Pass

2.添加Draw Renderers Custom Pass 到Custom Pass Volume 中

3.附上材质,调整渲染为 All Opaque, Forward ,深度测试可以测试一下Equal,Greater,Always,。

4.Always的效果:

解决报错(Your HDRP setting do not support Forwardonly, some objects might not renderer)。

1.解决该报错,需要调整当前使用的HDRP Asset的光照渲染模式为ForwardOnly

2.当前使用的HDRP Asset可在Edit -> Project settting -> Quality -> Rendering -> Render Pipeline Asset 查看到。

优化Shader Graph。

1.可以通过Frame Debugger中查看当前Custom Pass的渲染队列

Custom Pass 挂载的材质只是在原有材质上附加了一层,如果我们需要雪地的过度,就需要对用法线得到的透明度进行剔除。主要就是对法线操作。

效果:

相关推荐
lrh302519 分钟前
Custome SRP 17 - FXAA
3d·unity·srp·render pipeline·fxaa·抗锯齿
XR技术研习社2 小时前
第二种升级Quest系统的方案
unity·xr·vr
三和尚3 小时前
AI开发之Cursor的下载安装以及Unity-MCP下载安装到你的个人Unity项目中(一)
unity·ai·游戏引擎·cursor·unity-mcp·unity自动化
__water4 小时前
RHQ《Unity2D图片切割方式》
unity·2d·精灵图切割
DaLiangChen5 小时前
Unity 导览相机实现:键鼠控制自由漫游(WASD 移动 + 右键旋转)
数码相机·unity·游戏引擎
沉默金鱼20 小时前
Unity实用技能-UI进度条
ui·unity·游戏引擎
老朱佩琪!1 天前
Unity离线开发经验分享
unity·游戏引擎
Sator11 天前
unity的GPUInstance和GPU动画
unity·游戏引擎
沉默金鱼2 天前
Unity实用技能-模型
unity·游戏引擎
阿里云云原生2 天前
AgentRun:如何利用 AI Agent 构建现代化的舆情分析解决方案?
人工智能·unity·游戏引擎