zoukankan      html  css  js  c++  java
  • Dynamic Ambient Occlusion and Indirect Lighting

    This sample was presented on the Nvida witesite, which detail a new idea to calculate the ambient occlusion and indirect lighting for dynamic objects under real time mode while still keep a good performace. 
    The basic idea of such kind of dynamic ambient occlusion and indirect lighting is take the vertex relationships into account. The relationship means whether one vertex cast shadow to other, what will happen when one caster already in shadow, and the most important one is how much one cast to other. After serveral calculation pass for all those dynamic vertex array, we could get a value for all vertex that could be used to dark the  surface. That is for the ambient occlusion.

    If we could find a way to calculate how one vertex cast shadow to others, we could find some similar method to calculate how one vertex re-light to others. Those light means indirect lights bound among those vertexs. That is indirect lighting. Here is screen shot about the dynamic ambient occlusion effect will be:
    demo_screen
    The technique provided here is one method that could get more realistic image. The best one is the phsyical lighting, which is too time consuming to implment it at real time. But some one already find some methods to improve the ambient lighting, like light mapping, spherical harmonic pre-lighting, BRDF with simplified fuction (or precaluted some values into texture) and so on. All of them could have a good performance.

    I download the source code, and try to re-built on my compute. But I was failed because of the hardware limitation, it seems my computer OpenGL Pixel Shader Language could not support ‘while’ instruction. To make the program could run I have to replace the ‘while’ loop with a limit ‘for’ loop. The ‘while’ loop used to go though find all vertex that will cast shadow to a given one vertex. I think this part could be improved by find the most n items that contributes the most instead of list all items. Or Maybe I could find this issue by using some higher version OpenGL library. OpenGL ARB fuction too old not to use some advacned features on windows OS.
    Here is the screen shot that work with limit first 12 items ‘for’ loop and ‘while’ removed: (use loop 12 times because of the limitation of the pixel shader instructions size, it seems the shader compile will convert loop instruction into un-loop instruction, that mean duplicate the code with looped times )
    my_screen_shot

    The full source code and translated document could be found from here.

  • 相关阅读:
    自动化测试之读取配置文件 | 踩坑指南
    文未有福利 | BAT 名企大厂做接口自动化如何高效使用 Requests ?
    高效能 Tester 必会的 Python 测试框架技巧
    移动自动化测试从入门到高级实战
    1 天,1000+ 测试工程师分享了这个课程 | 年度福利
    H5性能分析实战来啦~
    接口测试实战 | Android 高版本无法抓取 HTTPS,怎么办?
    实战 | 接口自动化测试框架开发(Pytest+Allure+AIOHTTP+用例自动生成)
    第一期线上沙龙PPT领取方式
    Java日志第48天 2020.8.24
  • 原文地址:https://www.cnblogs.com/open-coder/p/3440303.html
Copyright © 2011-2022 走看看