Skip to content

Commit b5a6736

Browse files
committed
Updates for latest demo
1 parent 244cce0 commit b5a6736

File tree

8 files changed

+733
-1276
lines changed

8 files changed

+733
-1276
lines changed

dist/basics/textured-mesh.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ px.import({ scene: 'px:scene.1.js',
2626
strip.x = -40;
2727
strip.y = 300;
2828

29-
// app.stage.addChild(strip);
29+
app.stage.addChild(strip);
3030

3131
var g = new PIXI.GraphicsV8();
3232
g.x = strip.x;

dist/demos/render-texture-demo.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@ px.import({ scene: 'px:scene.1.js',
1414
app.renderer.width,
1515
app.renderer.height
1616
);
17+
18+
var renderTexture2 = PIXI.RenderTexture.create(
19+
app.renderer.width,
20+
app.renderer.height
21+
);
22+
1723
var currentTexture = renderTexture;
1824

25+
1926
// create a new sprite that uses the render texture we created above
2027
var outputSprite = new PIXI.Sprite(currentTexture);
2128

@@ -67,6 +74,13 @@ px.import({ scene: 'px:scene.1.js',
6774
}
6875

6976
count += 0.01;
77+
78+
// swap the buffers ...
79+
var temp = renderTexture;
80+
renderTexture = renderTexture2;
81+
renderTexture2 = temp;
82+
83+
// set the new texture
7084
outputSprite.texture = renderTexture;
7185

7286
// twist this up!
@@ -75,7 +89,7 @@ px.import({ scene: 'px:scene.1.js',
7589

7690
// render the stage to the texture
7791
// the 'true' clears the texture before the content is rendered
78-
app.renderer.render(app.stage, renderTexture, false);
92+
app.renderer.render(app.stage, renderTexture2, false);
7993
});
8094

8195
}).catch( function importFailed(err){

dist/layers/lighting.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ px.import({
3535
lighting.on('display', function(element) {
3636
element.blendMode = PIXI.BLEND_MODES.ADD
3737
});
38-
lighting.filters = [new PIXI.filters.VoidFilter()];
38+
lighting.filters = [new PIXI.filters.VoidFilter()];
3939
lighting.filters[0].blendMode = PIXI.BLEND_MODES.MULTIPLY;
4040

4141
lighting.filterArea = new PIXI.Rectangle(0, 0, WIDTH, HEIGHT);
@@ -44,7 +44,8 @@ px.import({
4444
app.stage.addChild(lighting);
4545

4646
var ambient = new PIXI.GraphicsV8();
47-
ambient.beginFill(0x808080, 0.5);
47+
ambient.beginFill(0x808080, 1);
48+
ambient.blendMode = PIXI.BLEND_MODES.MULTIPLY; // pxscene not support filters and layer, add blendMode manully
4849
ambient.drawRect(0, 0, WIDTH, HEIGHT);
4950
ambient.endFill();
5051
lighting.addChild(ambient); //<-- try comment it
@@ -92,7 +93,8 @@ px.import({
9293
lightbulb.beginFill((rr << 16) + (rg << 8) + rb, 1.0);
9394
lightbulb.drawCircle(0, 0, rad);
9495
lightbulb.endFill();
95-
lightbulb.parentLayer = lighting; //<-- try comment it
96+
lightbulb.blendMode = PIXI.BLEND_MODES.ADD; // pxscene not support filters and layer, add blendMode manully
97+
// lightbulb.parentLayer = lighting; //<-- try comment it
9698

9799
container.addChild(lightbulb);
98100

@@ -101,7 +103,7 @@ px.import({
101103
return container;
102104
}
103105

104-
for (var i = 0; i < 10; i++) {
106+
for (var i = 0; i < 40; i++) {
105107
bunnyWorld.addChild(createBunny());
106108
}
107109

0 commit comments

Comments
 (0)