实现特效,尤其是一些后处理特效,经常需要将各物体的shader替换为另一套shader进行渲染到纹理,再后再进行合成或以某种叠加方式叠加到最后的画面上去. 再复杂一点儿的,可能不同的物体所用的替换shader还不一样. unity中Camera.RenderWithShader可实现这个功能. 下面是官方文档原话: Rendering with Replaced Shaders Some rendering effects require rendering a scene with a dif…
实现特效,尤其是一些后处理特效,经常需要将各物体的shader替换为另一套shader进行渲染到纹理,再后再进行合成或以某种叠加方式叠加到最后的画面上去. 再复杂一点儿的,可能不同的物体所用的替换shader还不一样. unity中Camera.RenderWithShader可实现这个功能. 下面是官方文档原话: Rendering with Replaced Shaders Some rendering effects require rendering a scene with a dif…
一.概述 先看一下Shader类的介绍: /** * Shader is the based class for objects that return horizontal spans of colors during drawing. * A subclass of Shader is installed in a Paint calling paint.setShader(shader). * After that any object (other than a bitmap) that…