zoukankan      html  css  js  c++  java
  • 粒子贴片渲染的边缘柔化。

    我们在制作中不时会遇到需要贴片类型的粒子渲染,它的速度快,细节可以调到很丰富。可是有个尴尬的问题,一旦它与场景中的物体相交,就会出现硬边。这样所有的体积感和烟雾等物体的质感也都完全不存在了,观众可以一下发现那是一张扁平的平面。

    Particle sprites is often needed in production because it's fast, with a good amount of details. But an awkward problem occurs that hard edges intersecting with objects appear when they need to react with the scenes. The illusion of volumetric effect breaks as it's easy for anyone to realize that they're just flat patches.


    针对这个问题,我研究了一种可以让边缘柔化的方法,对于大多数的场景都会适用。不过设置起来稍微有点麻烦。大体的原理就是把模型所有顶点,按法线方向位移,这个位移的长度是一个高频率的sin函数插入帧数值驱动的动画。这样在渲染的时候,运动模糊会大体上在接近物体边缘的部位抠出一些空间,来制造虚化的效果。
    I developed a method which could soften the intersection edges, works well in most scenes, but a little bit hard to set up. Basically the way it works is by moving all vertices along the normal direction by a length which is driven by a high frequency sin function fed into frame numbers. Then when in render time, some amount of space wrapped around the objects is hold out with the contribution of motion blur, so to say, the softened edge done.

    最早看到这个技术是在一个意马的特效师的作品集里,他用的是意马自己开发的PRMan的Shader。它的算法比较复杂,可是功能性很好。
    I saw this function in a Hong Kong VFX artist's demo reel, he used an inside PRMan shader. The complex algorithm makes it a better tool to use. 

    看图。(原谅我这个难看的效果,重点在技术,忽略难看的勉强还能称作"烟雾"的东西……)
    It's actually smoke the patches represent, sorry for the ugly texture...

    右面是没有经过边缘柔化的效果,可以看到在物体周围出现很多细条,这些硬边导致所有的效果崩溃。
    左边使用了边缘柔化,可以看到即使效果不是物理上的真实,可是基本可以保留体积雾状的质感。
    As you can see, the right image has a lot of lines around the cube, and the other still keeps the look of volumetric smoke, it will work even though the output isn't physically accurate.

    下面是视频:

  • 相关阅读:
    Mybatis 使用Mybatis时实体类属性名和表中的字段名不一致
    getResourceAsStream 地址
    Memory Allocation with COBOL
    静态call 动态call LINK
    反编译
    eclipse 设置英文
    WAR/EAR 概念
    application.xml
    对ContentProvider中getType方法的一点理解
    总结使人进步,可视化界面GUI应用开发总结:Android、iOS、Web、Swing、Windows开发等
  • 原文地址:https://www.cnblogs.com/ovspianist/p/1865440.html
Copyright © 2011-2022 走看看