当前位置:网站首页>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转Table
- 3.2 multiple condition judgment
- A distribution fission activity is more than just a circle of friends!
- Logstash excludes specific files or folders from collecting report log data
- 事务的隔离级别详解
- Google Earth Engine(GEE)——Export. image. The difference and mixing of toasset/todrive, correctly export classification sample data to asset assets and references
- Leetcode daily practice (sum of two numbers)
- What is RPC
- [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
- Openssf security plan: SBOM will drive software supply chain security
猜你喜欢
3.3 one of the fixed number of cycles
Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing
基于 Nebula Graph 构建百亿关系知识图谱实践
Hung - Mung! HDD Hangzhou station · salon hors ligne vous invite à construire l'écologie
Etcd可视化工具:Kstone部署(一),基于Helm快速部署
面试半年,上个月成功拿到阿里P7offer,全靠我啃烂了这份2020最新面试题!
带你认识图数据库性能和场景测试利器LDBC SNB
Open source 23 things shardingsphere and database mesh have to say
带你认识图数据库性能和场景测试利器LDBC SNB
Leetcode daily practice (Yanghui triangle)
随机推荐
字节跳动埋点数据流建设与治理实践
Hongmeng makes efforts! HDD Hangzhou station · offline salon invites you to build ecology
P. Simple application of a.r.a method in Siyuan (friendly testing)
[pyGame games] this "eat everything" game is really wonderful? Eat them all? (with source code for free)
跨域图像的衡量新方式Style relevance:论文解读和代码实战
Mihayou sued Minmetals trust, which was exposed to product thunderstorms
Array represents a collection of several intervals. Please merge all overlapping intervals and return a non overlapping interval array. The array must exactly cover all the intervals in the input. 【Le
[pygame Games] ce jeu "eat Everything" est fantastique? Tu manges tout? (avec code source gratuit)
数据中心表格报表实现定制统计加班请假汇总记录分享
What is RPC
Huawei cloud devcloud launched four new capabilities, setting two domestic firsts
The array of C language is a parameter to pass a pointer
利用Redis实现订单30分钟自动取消
Google Earth Engine(GEE)——Export. image. The difference and mixing of toasset/todrive, correctly export classification sample data to asset assets and references
Logstash excludes specific files or folders from collecting report log data
List转Table
Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm
SIGKDD22|图“预训练、提示、微调”范式下的图神经网络泛化框架
Julia constructs diagonal matrix
About MySQL: the phenomenon and background of the problem