当前位置:网站首页>Unity之ASE实现全屏风沙效果
Unity之ASE实现全屏风沙效果
2022-07-07 13:02:00 【PassionY】
前言
最近在做一个沙漠环境的2D游戏,里面需要加一个风沙的全屏特效,本来我们是用粒子特效实现的,但是后面发现,粒子数量有点多,性能消耗很大。而且由于是全屏风沙,当粒子特效面积过大,叠层过多时,引起的overdraw的增加,会使cpu压力更大。甚至最后导致我们游戏切换前后台时会卡死。
所以,我们最后打算用shader来实现一个风沙效果,虽然不能完全模拟粒子的效果,但是基本还原90%的风沙效果。
先看效果图:
实现原理
1.风的实现 原理:使用一个流动的噪波图,实现对云雾图片的UV扰动。
2.沙粒实现 原理:先让颗粒状或者条装的图片在风向上平移,然后使用一个噪波图的R通道对沙粒的平移结果进行踢出,最后在乘个叠加色。
噪波干扰
噪波图的流动原理如下图所示:
风的属性设置
沙的属性设置
边栏推荐
- Five pain points for big companies to open source
- Novel Slot Detection: A Benchmark for Discovering Unknown Slot Types in the Dialogue System
- Zhiting doesn't use home assistant to connect Xiaomi smart home to homekit
- Niuke real problem programming - day16
- Read PG in data warehouse in one article_ stat
- What is the process of ⼀ objects from loading into JVM to being cleared by GC?
- @ComponentScan
- Discussion on CPU and chiplet Technology
- Comparable and comparator of sorting
- 简述keepalived工作原理
猜你喜欢
随机推荐
Infinite innovation in cloud "vision" | the 2022 Alibaba cloud live summit was officially launched
word中删除一整页
How to enable radius two factor / two factor (2fa) identity authentication for Anheng fortress machine
Ctfshow, information collection: web7
Concurrency Control & NoSQL and new database
Used by Jetson AgX Orin canfd
Protection strategy of server area based on Firewall
Wechat applet - Advanced chapter component packaging - Implementation of icon component (I)
"July 2022" Wukong editor update record
Navigation - are you sure you want to take a look at such an easy-to-use navigation framework?
Ctfshow, information collection: web2
Integer learning
Summer safety is very important! Emergency safety education enters kindergarten
TypeScript 发布 4.8 beta 版本
CTFshow,信息搜集:web2
asp.netNBA信息管理系统VS开发sqlserver数据库web结构c#编程计算机网页源码项目详细设计
Guangzhou Development Zone enables geographical indication products to help rural revitalization
【深度学习】图像超分实验:SRCNN/FSRCNN
Novel Slot Detection: A Benchmark for Discovering Unknown Slot Types in the Dialogue System
Ctfshow, information collection: web9