留言板

尊敬的读者、作者、审稿人, 关于本刊的投稿、审稿、编辑和出版的任何问题, 您可以本页添加留言。我们将尽快给您答复。谢谢您的支持!

姓名
邮箱
手机号码
标题
留言内容
验证码

特效电影工程中混合分辨率阴影图设计与硬阴影反走样

李华 杨华民 赵建平 陈纯毅

李华, 杨华民, 赵建平, 陈纯毅. 特效电影工程中混合分辨率阴影图设计与硬阴影反走样[J]. 中国光学(中英文), 2016, 9(1): 89-96. doi: 10.3788/CO.20160901.0089
引用本文: 李华, 杨华民, 赵建平, 陈纯毅. 特效电影工程中混合分辨率阴影图设计与硬阴影反走样[J]. 中国光学(中英文), 2016, 9(1): 89-96. doi: 10.3788/CO.20160901.0089
LI Hua, YANG Hua-min, ZHAO Jian-ping, CHEN Chun-yi. Hybrid-resolution shadow mapping design and hard shadows anti-aliasing in special effects movies[J]. Chinese Optics, 2016, 9(1): 89-96. doi: 10.3788/CO.20160901.0089
Citation: LI Hua, YANG Hua-min, ZHAO Jian-ping, CHEN Chun-yi. Hybrid-resolution shadow mapping design and hard shadows anti-aliasing in special effects movies[J]. Chinese Optics, 2016, 9(1): 89-96. doi: 10.3788/CO.20160901.0089

特效电影工程中混合分辨率阴影图设计与硬阴影反走样

doi: 10.3788/CO.20160901.0089
基金项目: 吉林省科技发展计划资助项目(No.20140204009GX),长春市重大科技攻关计划资助项目(No.14KG008)
详细信息
    通讯作者:

    李华(1977-),女,黑龙江人,博士研究生,副教授,2003年于长春理工大学获得硕士学位,主要从事虚拟现实技术及高性能计算方面的研究。E-mail:lihua@cust.edu.cn

    赵建平(1964-),男,吉林榆树人,博士,教授,博士生导师,主要从事数字图像处理技术方面的研究。E-mail:zhaojpin@aliyun.com

  • 中图分类号: TP311.1;TP391.9

Hybrid-resolution shadow mapping design and hard shadows anti-aliasing in special effects movies

  • 摘要: 在实时的虚拟场景渲染中,为减少阴影图算法由分辨率不足导致的阴影走样,提出了利用并行线性扫描的混合分辨率阴影图算法。首先,从光源视角生成高分辨率阴影图,利用并行线性扫描算法对深度均值差进行计算和分析,自底向上的合并纹素,建立纹素之间的索引关系并讨论混合分辨率阴影图的存储。在渲染阶段,利用混合分辨率阴影图进行深度测试,绘制实时的反走样阴影。实验表明,与标准阴影图相比,混合分辨率阴影图能提高20%以上的重要区域分辨率,明显改善阴影边界锯齿走样,使Dragon等模型的计算时间减少9%~18%。经实际应用验证,混合分辨率阴影图是一种有效的实时阴影绘制算法,可有效减少阴影图算法的走样。

     

  • 图 1  高分辨率阴影图的自底向上合并

    Figure 1.  Bottom-up merges of high-resolution shadow map

    图 2  RGBA缓存的128位存储格式

    Figure 2.  Storage of 128 bits RGBA-buffer

    图 3  混合分辨率阴影图索引示意

    Figure 3.  Index of hybrid-resolution shadow mapping

    图 4  标准阴影图算法(左列)与混合分辨率阴影图算法(右列) 的效果对比,阴影图分辨率分别为(a)1 024×1 024,(b)2048×2 048 降至1 024×1 024,(c)512×512,(d)1 024×1 024 降至512×512,(e)2 048×2 048,(f)4 096×4 096 降至2048×2 048

    Figure 4.  Contrast of SM(left column) and HRSM(right column),with the resolution of shadow maps are (a)1 024×1 024,(b)2 048×2 048 down to 1 024×1 024,(c)512×512,(d)1 024×1 024 down to 512×512,(e)2 048×2 048,(f)4 096×4 096 down to 2 048×2 048

    图 5  细线条目标反走样绘制,图(a)和(c)为标准阴影图算法,分辨率为2 048×2 048;图(b)和(d)为混合分辨率阴影图算法,分辨率由4 096×4 096降至2 048×2 048

    Figure 5.  Anti-aliasing with tiny objects,(a) and (c) are SM with resolution of 2048×2 048,(b) and (d) are HRSM with resolution of 4 096×4 096 down to 2 048×2 048

    图 6  混合分辨率阴影图算法自阴影效果,分辨率由2 048×2 048 降至1 024×1 024

    Figure 6.  Self-shadow of HRSM with resolution of 2 048×2 048 down to 1 024×1 024

    图 7  不同初始分辨率的混合阴影图算法绘制效果对比,(a)和(d)为标准阴影图512×512绘制效果; (b)、(c)和(e)为混合分辨率阴影图的分辨率分别由2 048×2 048降至512×512,4 096×4 096降至512×512 以及1 024×1 024降至512×512的绘制效果

    Figure 7.  Contrast of HRSM with different initial resolution,(a) and (d) are standard shadow map with resolution of 512×512; (b),(c) and (e) are HRSM with resolution of 2 048×2 048 to 512×512,4 096×4 096 to 512×512 and 1 024×1 024 to 512×512

      算法1

    Algorithm 1 Line-sweep shadow map
    pos is the coordinate of the first step in the shadow map and st is
    a vector for one step along the scanline.
    While ( steps--)
    {
    float3 sampleTexel(pos) ;
    for all (mapstexel s,s∈input) do
    D1=Depth At Point(s. Pos.Top Left())
    D2=Depth At Point(s. Pos.Topt Right())
    D3=Depth At Point(s. Pos.Bottom Left())
    D4=Depth At Point(s. Pos.Bottom Right ())
    If (Mean Difference(D1,D2,D3,D4)≤ε0)then
    {Parent Point=Merge Average(D1,D2,D3,D4)
    If (s.position)
    Output.Add(s.Parent Point());
    Store normal and ID to new shadow map} else output.Add(s)}
    pos+=st;
    }
    下载: 导出CSV

      算法2

    Algorithm 2 ShadowTest
    for Each view sample
    Project to light space intersect with texeli
    read from HRSM
    if texeli is indexed to subtexel,search index until end
    then Read dp~ in HRSM
    if dp≤dp~ then return true;
    else return false;}
    else Read dp~ in HRSM
    if dp≤dp~ then return true;
    else return false;}
    下载: 导出CSV

    表  1  SM与HRSM下Dragon的计算时间消耗情况(单位:ms)

    Table  1.   SM and HRSM time consuming of Dragon(Unit:ms)

    阴影图分辨率SM(T1)HRSM(T2)(T2-T1)/T1/%
    1 024×1 02432.629.59
    2 048×2 04834.930.811
    4 096×4 09662.951.518
    下载: 导出CSV

    表  2  不同测试模型计算时间 (单位:ms)

    Table  2.   Different model time consuming(Unit:ms)

    模型顶点多边形
    标准阴影图(SM)混合分辨率阴影图(HRSM)
    1 024×1 0242 048×2 0481 024×1 0242 048×2 048
    Dragon1 526 4332 400 00032.634.929.530.8
    Bunny872 6611 671 98423.528.220.627.3
    Ball model134 184268 8009.812.98.511.2
    Spheres1 20012 0005.37.25.06.3
    下载: 导出CSV
  • [1]
    [2]

    [3]

    [4]

    [5]
    [6]
    [7]
    [8]
    [9]
    [10]
    [11]
    [12]

    [13]

  • 加载中
图(7) / 表(4)
计量
  • 文章访问数:  1177
  • HTML全文浏览量:  333
  • PDF下载量:  807
  • 被引次数: 0
出版历程
  • 收稿日期:  2015-09-11
  • 录用日期:  2015-11-13
  • 刊出日期:  2016-01-25

目录

    /

    返回文章
    返回

    重要通知

    2024年2月16日科睿唯安通过Blog宣布,2024年将要发布的JCR2023中,229个自然科学和社会科学学科将SCI/SSCI和ESCI期刊一起进行排名!《中国光学(中英文)》作为ESCI期刊将与全球SCI期刊共同排名!