MCPcopy Create free account
hub / github.com/melonjs/melonJS / beginPostEffect

Method beginPostEffect

packages/melonjs/src/video/renderer.js:388–399  ·  view source on GitHub ↗

* Begin capturing rendering to an offscreen buffer for post-effect processing. * Call endPostEffect() after rendering to blit the result to the screen. * No-op on Canvas renderer. * @param {Renderable} renderable - the renderable with postEffects to apply * @returns {boolean} false (Canvas r

(renderable)

Source from the content-addressed store, hash-verified

386 * @ignore
387 */
388 beginPostEffect(renderable) {
389 // on Canvas, only set customShader for single-effect fast path
390 const effects = renderable.postEffects.filter((fx) => {
391 return fx.enabled !== false;
392 });
393 if (effects.length === 1) {
394 this.customShader = effects[0];
395 } else {
396 this.customShader = undefined;
397 }
398 return false;
399 }
400
401 /**
402 * End post-effect capture and blit the offscreen buffer to the screen

Callers 4

drawMethod · 0.45
preDrawMethod · 0.45
preDrawMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected