Skip to content

Commit 5dbec83

Browse files
committed
Using new Camera Pipeline (renderTexture todo)
1 parent b73067a commit 5dbec83

1 file changed

Lines changed: 41 additions & 14 deletions

File tree

src/renderer/webgl/WebGLRenderer.js

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ var WebGLRenderer = new Class({
901901

902902
this.resize(baseSize.width, baseSize.height);
903903

904-
pipelineManager.setMulti();
904+
// pipelineManager.setMulti();
905905
},
906906

907907
/**
@@ -2076,8 +2076,28 @@ var WebGLRenderer = new Class({
20762076

20772077
var color = camera.backgroundColor;
20782078

2079-
var MultiPipeline = this.pipelines.MULTI_PIPELINE;
2079+
this.pushScissor(cx, cy, cw, ch);
20802080

2081+
if (camera.mask)
2082+
{
2083+
this.currentCameraMask.mask = camera.mask;
2084+
this.currentCameraMask.camera = camera._maskCamera;
2085+
2086+
camera.mask.preRenderWebGL(this, camera, camera._maskCamera);
2087+
}
2088+
2089+
if (color.alphaGL > 0)
2090+
{
2091+
var pipeline = this.pipelines.setCameraPipeline();
2092+
2093+
pipeline.drawFillRect(
2094+
cx, cy, cw, ch,
2095+
Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1),
2096+
color.alphaGL
2097+
);
2098+
}
2099+
2100+
/*
20812101
if (camera.renderToTexture)
20822102
{
20832103
this.flush();
@@ -2125,15 +2145,16 @@ var WebGLRenderer = new Class({
21252145
camera.mask.preRenderWebGL(this, camera, camera._maskCamera);
21262146
}
21272147
2128-
if (color.alphaGL > 0)
2129-
{
2130-
MultiPipeline.drawFillRect(
2131-
cx, cy, cw , ch,
2132-
Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1),
2133-
color.alphaGL
2134-
);
2135-
}
2148+
// if (color.alphaGL > 0)
2149+
// {
2150+
// MultiPipeline.drawFillRect(
2151+
// cx, cy, cw , ch,
2152+
// Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1),
2153+
// color.alphaGL
2154+
// );
2155+
// }
21362156
}
2157+
*/
21372158
},
21382159

21392160
/**
@@ -2163,7 +2184,8 @@ var WebGLRenderer = new Class({
21632184

21642185
/**
21652186
* Controls the post-render operations for the given camera.
2166-
* Renders the foreground camera effects like flash and fading. It resets the current scissor state.
2187+
*
2188+
* Renders the foreground camera effects like flash and fading, then resets the current scissor state.
21672189
*
21682190
* @method Phaser.Renderer.WebGL.WebGLRenderer#postRenderCamera
21692191
* @since 3.0.0
@@ -2172,15 +2194,19 @@ var WebGLRenderer = new Class({
21722194
*/
21732195
postRenderCamera: function (camera)
21742196
{
2175-
var multiPipeline = this.pipelines.setMulti();
2197+
if (camera.flashEffect.isRunning || camera.fadeEffect.isRunning)
2198+
{
2199+
var pipeline = this.pipelines.setCameraPipeline();
21762200

2177-
camera.flashEffect.postRenderWebGL(multiPipeline, Utils.getTintFromFloats);
2178-
camera.fadeEffect.postRenderWebGL(multiPipeline, Utils.getTintFromFloats);
2201+
camera.flashEffect.postRenderWebGL(pipeline, Utils.getTintFromFloats);
2202+
camera.fadeEffect.postRenderWebGL(pipeline, Utils.getTintFromFloats);
2203+
}
21792204

21802205
camera.dirty = false;
21812206

21822207
this.popScissor();
21832208

2209+
/*
21842210
if (camera.renderToTexture)
21852211
{
21862212
multiPipeline.flush();
@@ -2223,6 +2249,7 @@ var WebGLRenderer = new Class({
22232249
// Force clear the current texture so that items next in the batch (like Graphics) don't try and use it
22242250
this.setBlankTexture(true);
22252251
}
2252+
*/
22262253

22272254
if (camera.mask)
22282255
{

0 commit comments

Comments
 (0)