Last active
March 19, 2022 00:32
-
-
Save cmiscm/d8a206176c95b401b04c790a4d9450ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var renderer = new PIXI.WebGLRenderer(1600, 1200, { | |
antialias: false, | |
transparent: true, | |
resolution: 2, | |
powerPreference: "high-performance" | |
}); | |
renderer.autoResize = true; | |
document.body.appendChild(renderer.view); | |
var stage = new PIXI.Container(); | |
var blurFilter = new PIXI.filters.BlurFilter(); | |
blurFilter.blur = 10; | |
blurFilter.autoFit = true; | |
var particleCon = new PIXI.particles.ParticleContainer(500, { | |
scale: true, | |
position: true, | |
rotation: false, | |
uvs: false, | |
alpha: false | |
}); | |
stage.addChild(particleCon); | |
var i, b; | |
for (i=0; i<500; i++) { | |
b = new PIXI.Sprite(loader.resources["img/drop-alpha.png"].texture); | |
b.anchor.set(0.5); | |
particleCon.addChild(b); | |
} | |
var thresholdFilter = new ThresholdFilter(); | |
thresholdFilter.threshold = 0.5; | |
stage.filters = [blurFilter, thresholdFilter]; | |
stage.filterArea = renderer.screen; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment