Skip to content

Commit bddfd70

Browse files
committed
Added preBatchCamera and postBatchCamera and the rest of the Utility methods
1 parent b019c6f commit bddfd70

1 file changed

Lines changed: 36 additions & 19 deletions

File tree

src/renderer/webgl/PipelineManager.js

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -458,26 +458,36 @@ var PipelineManager = new Class({
458458

459459
preBatch: function (gameObject)
460460
{
461-
if (!gameObject || !gameObject.postPipeline)
462-
{
463-
return;
464-
}
465-
466461
this.flush();
467462

468-
gameObject.postPipeline.postBind(gameObject);
463+
gameObject.postPipeline.preBatch(gameObject);
469464
},
470465

471466
postBatch: function (gameObject)
472467
{
473-
if (!gameObject || !gameObject.postPipeline)
468+
this.flush();
469+
470+
gameObject.postPipeline.postBatch(gameObject);
471+
},
472+
473+
preBatchCamera: function (camera)
474+
{
475+
if (camera.postPipeline)
474476
{
475-
return;
477+
this.flush();
478+
479+
camera.postPipeline.preBatch(camera);
476480
}
481+
},
477482

478-
this.flush();
483+
postBatchCamera: function (camera)
484+
{
485+
if (camera.postPipeline)
486+
{
487+
this.flush();
479488

480-
gameObject.postPipeline.postFlush(gameObject);
489+
camera.postPipeline.postBatch(camera);
490+
}
481491
},
482492

483493
/**
@@ -509,31 +519,38 @@ var PipelineManager = new Class({
509519
);
510520
},
511521

512-
copyFrame: function (source, target, brightness)
522+
copyFrame: function (source, target, brightness, clearAlpha)
513523
{
514-
if (brightness === undefined) { brightness = 1; }
515-
516524
var pipeline = this.setUtility(this.UTILITY_PIPELINE.copyShader);
517525

518-
pipeline.copyFrame(source, target, brightness);
526+
pipeline.copyFrame(source, target, brightness, clearAlpha);
519527

520528
return this;
521529
},
522530

523-
drawFrame: function (source, target)
531+
drawFrame: function (source, target, clearAlpha, colorMatrix)
524532
{
525533
var pipeline = this.setUtility(this.UTILITY_PIPELINE.colorMatrixShader);
526534

527-
pipeline.drawFrame(source, target);
535+
pipeline.drawFrame(source, target, clearAlpha, colorMatrix);
528536

529537
return this;
530538
},
531539

532-
bindAndDraw: function (source, target)
540+
blendFrames: function (source1, source2, target, strength, clearAlpha)
533541
{
534-
var pipeline = this.setUtility(this.UTILITY_PIPELINE.colorMatrixShader);
542+
var pipeline = this.setUtility(this.UTILITY_PIPELINE.linearShader);
543+
544+
pipeline.blendFrames(source1, source2, target, strength, clearAlpha);
545+
546+
return this;
547+
},
548+
549+
blendFramesAdditive: function (source1, source2, target, strength, clearAlpha)
550+
{
551+
var pipeline = this.setUtility(this.UTILITY_PIPELINE.addShader);
535552

536-
pipeline.bindAndDraw(source, target);
553+
pipeline.blendFrames(source1, source2, target, strength, clearAlpha);
537554

538555
return this;
539556
},

0 commit comments

Comments
 (0)