-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from Feu-Secret/tokenmagic-dev
Tokenmagic dev
- Loading branch information
Showing
31 changed files
with
4,381 additions
and
274 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# IDE | ||
.vs/ |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains 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
Binary file not shown.
This file contains 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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
import { spiderWeb } from '../glsl/fragmentshaders/spiderweb.js'; | ||
import { customVertex2D } from '../glsl/vertexshaders/customvertex2D.js'; | ||
import { Anime } from "../Anime.js"; | ||
import "./proto/FilterProto.js"; | ||
|
||
export class FilterSpiderWeb extends PIXI.Filter { | ||
|
||
constructor(params) { | ||
let { | ||
time, | ||
anchorX, | ||
anchorY, | ||
color, | ||
thickness, | ||
div1, | ||
div2, | ||
tear, | ||
amplitude | ||
} = Object.assign({}, FilterSpiderWeb.defaults, params); | ||
|
||
// using specific vertex shader and fragment shader | ||
super(customVertex2D, spiderWeb); | ||
|
||
this.uniforms.anchor = new Float32Array([0.5, -1.0]); | ||
this.uniforms.color = new Float32Array([0.75, 0.75, 0.75]); | ||
|
||
Object.assign(this, { | ||
time, anchorX, anchorY, color, thickness, div1, div2, tear, amplitude | ||
}); | ||
|
||
this.animated = {}; | ||
this.setTMParams(params); | ||
this.anime = new Anime(this); | ||
this.normalizeTMParams(); | ||
} | ||
|
||
get time() { | ||
return this.uniforms.time; | ||
} | ||
|
||
set time(value) { | ||
this.uniforms.time = value; | ||
} | ||
|
||
get color() { | ||
return PIXI.utils.rgb2hex(this.uniforms.color); | ||
} | ||
|
||
set color(value) { | ||
PIXI.utils.hex2rgb(value, this.uniforms.color); | ||
} | ||
|
||
get anchorX() { | ||
return this.uniforms.anchor[0]; | ||
} | ||
|
||
set anchorX(value) { | ||
this.uniforms.anchor[0] = 0.5; | ||
} | ||
|
||
get anchorY() { | ||
return this.uniforms.anchor[1]; | ||
} | ||
|
||
set anchorY(value) { | ||
this.uniforms.anchor[1] = 0.5; | ||
} | ||
|
||
get thickness() { | ||
return this.uniforms.thickness; | ||
} | ||
|
||
set thickness(value) { | ||
this.uniforms.thickness = value; | ||
} | ||
|
||
get tear() { | ||
return this.uniforms.tear; | ||
} | ||
|
||
set tear(value) { | ||
this.uniforms.tear = value; | ||
} | ||
|
||
get amplitude() { | ||
return this.uniforms.amplitude; | ||
} | ||
|
||
set amplitude(value) { | ||
this.uniforms.amplitude = value; | ||
} | ||
|
||
get div1() { | ||
return this.uniforms.div1; | ||
} | ||
|
||
set div1(value) { | ||
this.uniforms.div1 = value; | ||
} | ||
|
||
get div2() { | ||
return this.uniforms.div2; | ||
} | ||
|
||
set div2(value) { | ||
this.uniforms.div2 = value; | ||
} | ||
} | ||
|
||
FilterSpiderWeb.defaults = { | ||
time: 0.0, | ||
anchorX: 0.5, | ||
anchorY: 0.5, | ||
color: 0xBBBBBB, | ||
thickness: 1, | ||
div1: 10, | ||
div2: 10, | ||
tear: 0.54, | ||
amplitude: 0.8 | ||
}; | ||
|
||
|
||
|
||
|
This file contains 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
Oops, something went wrong.