当前位置:网站首页>Unity 阴影——阴影平坠(Shadow pancaking)
Unity 阴影——阴影平坠(Shadow pancaking)
2022-06-27 15:44:00 【番茄猿】
阴影平坠(Shadow pancaking)
为了减少阴影暗斑(Shadow acne)Unity采取了一种叫做阴影平坠(Shadow pancaking)的技术,它的思路就是减少沿光照方向渲染阴影贴图时使用的光照空间范围,这样子可以提高阴影贴图的精度,减少阴影暗斑(Shadow acne)
如下图所示,主要就是取灯光照射方向和视锥体之间的交集
淡蓝色圆圈表示产生阴影投射的物体
深蓝色矩形框表示原来的灯光空间
绿色线表示经过优化后的近平面,把所有不在视锥体也就是看不见的阴影投射物体都排除了
这样子,等于我们将阴影投射的物体截断在优化后的灯光近裁剪平面之内(在顶点Shader中),需要注意的是虽然一般情况下表现都没问题,但是遇到了一些特别大的横跨这个近裁剪平面的三角面时就会出问题。
如上图所示,蓝色的三角面中只有一个顶点是在近裁剪平面之外的,并且被截断了,这样就出问题了,会改变三角面的形状,产生错误的阴影。

我们可以调整Unity中质量设置中的Shadow Near Plane Offset的值来解决这个问题,让灯光空间的近裁剪平面往后移,但是如果这个值设置高了又会导致阴影暗斑(Shadow acne),因为又提高了阴影贴图所对应的灯光方向的空间。或者我们也可以通过将这个大三角面拆细来解决这个问题。
参考
https://docs.unity3d.com/2019.4/Documentation/Manual/ShadowPerformance.html
边栏推荐
- List to table
- A robot is located in the upper left corner of an M x n grid. The robot can only move down or right one step at a time. The robot attempts to reach the lower right corner of the grid. How many differe
- [pygame Games] ce jeu "eat Everything" est fantastique? Tu manges tout? (avec code source gratuit)
- Data center table reports realize customized statistics, overtime leave summary record sharing
- Construction and management practice of ByteDance buried point data flow
- 泰山OFFICE技术讲座:第一难点是竖向定位
- A distribution fission activity is more than just a circle of friends!
- 事务的四大特性
- 字节跳动埋点数据流建设与治理实践
- LeetCode每日一练(主要元素)
猜你喜欢

Domain name binding dynamic IP best practices

Yyds dry inventory solution sword finger offer: a path with a certain value in the binary tree (3)

Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing

Centos8 PostgreSQL initialization error: initdb: error: invalid locale settings; check LANG and LC_* environment

面试半年,上个月成功拿到阿里P7offer,全靠我啃烂了这份2020最新面试题!

LeetCode每日一练(无重复字符的最长子串)

SQL injection principle

带你认识图数据库性能和场景测试利器LDBC SNB
![[Niuke's questions] nowcoder claims to have remembered all Fibonacci numbers between 1 and 100000. To test him, we gave him a random number N and asked him to say the nth Fibonacci number. If the nth](/img/70/fa79ba38e28c41ed28bce2ec73cd79.png)
[Niuke's questions] nowcoder claims to have remembered all Fibonacci numbers between 1 and 100000. To test him, we gave him a random number N and asked him to say the nth Fibonacci number. If the nth

10分钟掌握mysql的安装步骤
随机推荐
C système de gestion de la charge de travail des enseignants en langues
面试半年,上个月成功拿到阿里P7offer,全靠我啃烂了这份2020最新面试题!
Four characteristics of transactions
Taishan Office Technology Lecture: the first difficulty is vertical positioning
字节跳动埋点数据流建设与治理实践
鸿蒙发力!HDD杭州站·线下沙龙邀您共建生态
QT5 之信号与槽机制(演示控件自带的信号与槽函数关联)
继手机之后 报道称三星也削减了电视等家电产品线的产量
Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear
logstash排除特定文件或文件夹不采集上报日志数据
Openssf security plan: SBOM will drive software supply chain security
Centos8 PostgreSQL initialization error: initdb: error: invalid locale settings; check LANG and LC_* environment
关于#mysql#的问题:问题遇到的现象和发生背景
About how vs2019c # establishes the login interface, the user name and password entered must match the records in the access database
Annual comprehensive analysis of China's audio market in 2022
C language set operation
The time of localdatetime type (2019-11-19t15:16:17) is queried with the time range of Oracle
Mode setting of pulseaudio (21)
[pygame Games] ce jeu "eat Everything" est fantastique? Tu manges tout? (avec code source gratuit)
Principle Comparison and analysis of mechanical hard disk and SSD solid state disk