-
-
Notifications
You must be signed in to change notification settings - Fork 37
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 #5 from Feu-Secret/tokenmagic-dev
Tokenmagic dev
- Loading branch information
Showing
21 changed files
with
771 additions
and
174 deletions.
There are no files selected for viewing
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.
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
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,114 @@ | ||
import { seaFlood } from '../glsl/fragmentshaders/flood.js'; | ||
import { customVertex2D } from '../glsl/vertexshaders/customvertex2D.js'; | ||
import { Anime } from "../Anime.js"; | ||
import "./proto/FilterProto.js"; | ||
|
||
export class FilterFlood extends PIXI.Filter { | ||
|
||
constructor(params) { | ||
let { | ||
time, | ||
scale, | ||
glint, | ||
billowy, | ||
color, | ||
shiftX, | ||
shiftY, | ||
tintIntensity | ||
} = Object.assign({}, FilterFlood.defaults, params); | ||
|
||
// using specific vertex shader and fragment shader | ||
super(customVertex2D, seaFlood); | ||
|
||
this.uniforms.waterColor = new Float32Array([0.00, 0.18, 0.54]); | ||
this.uniforms.shift = new Float32Array([0.0, 0.0]); | ||
|
||
Object.assign(this, { | ||
time, scale, glint, billowy, color, shiftX, shiftY, tintIntensity | ||
}); | ||
|
||
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.waterColor); | ||
} | ||
|
||
set color(value) { | ||
PIXI.utils.hex2rgb(value, this.uniforms.waterColor); | ||
} | ||
|
||
get scale() { | ||
return this.uniforms.scale; | ||
} | ||
|
||
set scale(value) { | ||
this.uniforms.scale = value; | ||
} | ||
|
||
get glint() { | ||
return this.uniforms.glint; | ||
} | ||
|
||
set glint(value) { | ||
this.uniforms.glint = value; | ||
} | ||
|
||
get billowy() { | ||
return this.uniforms.billowy; | ||
} | ||
|
||
set billowy(value) { | ||
this.uniforms.billowy = value; | ||
} | ||
|
||
get tintIntensity() { | ||
return this.uniforms.tintIntensity; | ||
} | ||
|
||
set tintIntensity(value) { | ||
this.uniforms.tintIntensity = value; | ||
} | ||
|
||
get shiftX() { | ||
return this.uniforms.shift[0]; | ||
} | ||
|
||
set shiftX(value) { | ||
this.uniforms.shift[0] = value; | ||
} | ||
|
||
get shiftY() { | ||
this.uniforms.shift[1]; | ||
} | ||
|
||
set shiftY(value) { | ||
this.uniforms.shift[1] = value; | ||
} | ||
} | ||
|
||
FilterFlood.defaults = { | ||
time: 0, | ||
glint: 0.5, | ||
scale: 70, | ||
billowy: 0.5, | ||
color: 0x0020A9, | ||
shiftX: 0, | ||
shiftY: 0, | ||
tintIntensity: 0.2, | ||
}; | ||
|
||
|
||
|
Oops, something went wrong.