2.3.3 multi pass shader 求助

在製作一個H5遊戲項目,有需求要製作multi pass的效果,但是不知道怎麼把第一個pass的結果傳到第二個。
網上查了一下,multi-pass rendering 貌似要把第一個pass的結果另外寫到一個framebuffer,並在第二個pass 讀入。具體的語法該怎麼寫?

附上目前代碼
MultiPass.effect

CCEffect %{
  techniques:
  - passes:
    - vert: vs
      frag: fs:pass1
      blendState:
        targets:
        - blend: true
      rasterizerState:
        cullMode: none
    - vert: vs
      frag: fs:pass2
      blendState:
        targets:
        - blend: true
      rasterizerState:
        cullMode: none
      properties: {
        texture0: {value: white}
      }
}%


CCProgram vs %{
  // 省略
}%


CCProgram fs %{
  precision highp float;
  
  // #include <alpha-test>
  #include <texture>

  in vec4 v_color;
  in vec2 v_uv0;
  uniform sampler2D texture;
  uniform sampler2D texture0;

  vec4 pass1 () {
    vec4 o = vec4(1, 1, 1, 1);
    o = texture2D(texture, v_uv0);
    o.rgb = o.gbr;
    return o;
  }
  
  vec4 pass2 () {
    vec4 o = vec4(1, 1, 1, 1);
    o = texture2D(texture0, v_uv0);
    return o;
  }
}%

MultiPass.ts

export default class MultiPass extends cc.Component {
  protected _sprite: cc.Sprite = null;

  start() {
    this._sprite = this.node.getComponent(cc.Sprite);
    let mat = this._sprite.getMaterial(0);
    mat.setProperty('texture0', this._sprite.spriteFrame.getTexture(), 1);
  }
}

有解决吗?我试了下两个pass,都有起作用,但两个都是在原像素上处理的。并非第2个以第1个的结果为基础处理。

I also concern about it. Anyone can help ?

同问,官方有例子吗

可以参考我这里的做法~