feat:阴影模块改进 - #45
Draft
neochen2005 wants to merge 6 commits into
Draft
Conversation
Owner
|
我感觉还是之前的LOD偏移的方式好一点,现在正常距离的日光阴影的LOD一般落在L3-L5之间,瓶颈不是阴影图大小,调大阴影图性能开销太大了,另外2048选项超过了常见GPU的纹理大小限制 |
Contributor
Author
之前缩放系数是没彻底理解阴影模块原理匆忙做出来的,解法太野蛮了,以及lod说法其实不准确。源码里lod实际指一个灯光的多个阴影面,点光使用6个lod,方向光永远使用lod0。决定阴影图大小的是level值。 源码里有todo提到了负数level,所以如果官方要来优化阴影图分布,也是往这个方向做。 至于页分辨率,一般512就能实现npr的清晰阴影了,更大的数是适配200%或更高输出分辨率的。 最近很忙,有空再继续做 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
已移除shadow_map_scale
裁剪阴影图使用level表示图覆盖面积,现在支持负数level值来改善小场景的阴影分辨率。


待办:根据裁剪距离下限丢弃过小的level,避免占用预算
对比图,分别是改进后和原npr分支:
阴影图的单个物理页长宽在原生blender内被硬编码为256,现在可以在场景设置内可以调节为512到2048。需要同步扩大阴影池。物理页扩大时,场景内所有灯光都会受到影响,需要用户手动维护灯光的阴影像素尺寸限制,来避免过高的性能开销。
对比图,页分辨率分别是256,512,1024:
未来计划相机进入长焦时切换至正交模式使用的级联图