renderFilter method

  1. @override
void renderFilter (RenderState renderState, RenderTextureQuad renderTextureQuad, int pass)
override

Implementation

@override
void renderFilter(
    RenderState renderState, RenderTextureQuad renderTextureQuad, int pass) {
  RenderContextWebGL renderContext = renderState.renderContext;
  RenderTexture renderTexture = renderTextureQuad.renderTexture;

  ChromaKeyFilterProgram renderProgram = renderContext.getRenderProgram(
      r"$ChromaKeyFilterProgram", () => ChromaKeyFilterProgram());

  renderContext.activateRenderProgram(renderProgram);
  renderContext.activateRenderTexture(renderTexture);
  renderProgram.configure(
      backgroundColor, solidThreshold, invisibleThreshold);
  renderProgram.renderTextureQuad(renderState, renderTextureQuad);
  renderProgram.flush();
}