当前位置:网站首页>Unity之ASE实现全屏风沙效果
Unity之ASE实现全屏风沙效果
2022-07-07 13:02:00 【PassionY】
前言
最近在做一个沙漠环境的2D游戏,里面需要加一个风沙的全屏特效,本来我们是用粒子特效实现的,但是后面发现,粒子数量有点多,性能消耗很大。而且由于是全屏风沙,当粒子特效面积过大,叠层过多时,引起的overdraw的增加,会使cpu压力更大。甚至最后导致我们游戏切换前后台时会卡死。
所以,我们最后打算用shader来实现一个风沙效果,虽然不能完全模拟粒子的效果,但是基本还原90%的风沙效果。
先看效果图:
实现原理
1.风的实现 原理:使用一个流动的噪波图,实现对云雾图片的UV扰动。
2.沙粒实现 原理:先让颗粒状或者条装的图片在风向上平移,然后使用一个噪波图的R通道对沙粒的平移结果进行踢出,最后在乘个叠加色。
噪波干扰
噪波图的流动原理如下图所示:
风的属性设置

沙的属性设置
边栏推荐
- 比尔·盖茨晒48年前简历:“没你们的好看”
- ⼀个对象从加载到JVM,再到被GC清除,都经历了什么过程?
- “百度杯”CTF比赛 2017 二月场,Web:include
- Several ways of JS jump link
- 连接ftp服务器教程
- Pinduoduo lost the lawsuit, and the case of bargain price difference of 0.9% was sentenced; Wechat internal test, the same mobile phone number can register two account functions; 2022 fields Awards an
- 拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条...
- Cocoscreator operates spine for animation fusion
- A laravel background management expansion package you can't miss - Voyager
- Webrtc audio anti weak network technology (Part 1)
猜你喜欢

CTFshow,信息搜集:web3

【深度学习】图像超分实验:SRCNN/FSRCNN

CTFshow,信息搜集:web8

Computer win7 system desktop icon is too large, how to turn it down

Used by Jetson AgX Orin canfd
![[understanding of opportunity -40]: direction, rules, choice, effort, fairness, cognition, ability, action, read the five layers of perception of 3GPP 6G white paper](/img/38/cc5bb5eaa3dcee5ae2d51a904cf26a.png)
[understanding of opportunity -40]: direction, rules, choice, effort, fairness, cognition, ability, action, read the five layers of perception of 3GPP 6G white paper

Wechat applet - Advanced chapter component packaging - Implementation of icon component (I)

Ctfshow, information collection: web8

CTFshow,信息搜集:web7

CTFshow,信息搜集:web2
随机推荐
PD virtual machine tutorial: how to set the available shortcut keys in the parallelsdesktop virtual machine?
CTFshow,信息搜集:web10
2022 cloud consulting technology series high availability special sharing meeting
A laravel background management expansion package you can't miss - Voyager
【服务器数据恢复】戴尔某型号服务器raid故障的数据恢复案例
Stm32cubemx, 68 sets of components, following 10 open source protocols
TypeScript 发布 4.8 beta 版本
Ctfshow, information collection: web6
Apache multiple component vulnerability disclosure (cve-2022-32533/cve-2022-33980/cve-2021-37839)
Novel Slot Detection: A Benchmark for Discovering Unknown Slot Types in the Dialogue System
Five pain points for big companies to open source
2022年5月互联网医疗领域月度观察
Xiaomi's path of chip self-development
Data Lake (IX): Iceberg features and data types
Used by Jetson AgX Orin canfd
Several ways of JS jump link
15、文本编辑工具VIM使用
Pandora IOT development board learning (HAL Library) - Experiment 12 RTC real-time clock experiment (learning notes)
6. Electron borderless window and transparent window lock mode setting window icon
Ctfshow, information collection: web9