GithubHelp home page GithubHelp logo

pixijs / filters Goto Github PK

View Code? Open in Web Editor NEW
882.0 33.0 156.0 8.45 MB

Collection of community-authored custom display filters for PixiJS

Home Page: https://pixijs.io/filters/docs/

License: MIT License

JavaScript 3.00% GLSL 13.85% HTML 0.26% TypeScript 62.25% WGSL 20.64%
pixijs webgl filters-pixijs glsl-shaders

filters's Introduction

PixiJS — The HTML5 Creation Engine

pixi.js logo

Discord npm version Node.js CI Financial Contributors

This project aims to provide a fast, lightweight 2D library that works across all devices. The PixiJS renderer allows everyone to enjoy the power of hardware acceleration without prior knowledge of WebGL. Also, it's fast. Really fast.

If you want to keep up to date with the latest PixiJS news then feel free to follow us on Twitter @PixiJS and we will keep you posted! You can also check back on our site as any breakthroughs will be posted up there too!

We are now a part of the Open Collective and with your support you can help us make PixiJS even better. To make a donation, simply click the button below and we'll love you forever!

What to Use PixiJS for and When to Use It

PixiJS is a rendering library that will allow you to create rich, interactive graphics and cross-platform applications and games without having to dive into the WebGL API or deal with browser and device compatibility.

PixiJS supports WebGPU with fallback support for WebGL. As a library, PixiJS is a fantastic tool for authoring interactive content. Use it for your graphics-rich, interactive websites, applications, and HTML5 games. Out-of-the-box, cross-platform compatibility and graceful degradation mean you have less work to do and more fun doing it! If you want to create polished and refined experiences relatively quickly without delving into dense, low-level code, all while avoiding the headaches of browser inconsistencies, then sprinkle your next project with some PixiJS magic!

Boost your development and feel free to use your imagination!

Current features

  • WebGL renderer (with automatic smart batching, allowing for REALLY fast performance)
  • WebGPU renderer (new to the latest browsers!)
  • Canvas renderer (Fastest in town!)
  • Full scene graph
  • Super easy to use API (similar to the flash display list API)
  • Support for texture atlases
  • Asset loader / sprite sheet loader
  • Auto-detect which renderer should be used
  • Full Mouse and Multi-touch Interaction
  • Text
  • BitmapFont text
  • Multiline Text
  • Render Texture
  • Primitive Drawing
  • Masking
  • Filters
  • Community-Supported Plugins

Setup

It's easy to get started with PixiJS! Simply download a prebuilt build!

Alternatively, PixiJS can be installed with npm or simply using a content delivery network (CDN) URL to embed PixiJS directly on your HTML page.

NPM Install

npm install pixi.js

There is no default export. The correct way to import PixiJS is:

import * as PIXI from 'pixi.js';

CDN Install

Via jsDelivr:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pixi.min.js"></script>

Or via unpkg:

<script src="https://unpkg.com/[email protected]/dist/pixi.min.js"></script>

Basic Usage Example

import { Application, Sprite, Assets } from 'pixi.js';

// The application will create a renderer using WebGL, if possible,
// with a fallback to a canvas render. It will also setup the ticker
// and the root stage PIXI.Container
const app = new Application();

// Wait for the Renderer to be available
await app.init();

// The application will create a canvas element for you that you
// can then insert into the DOM
document.body.appendChild(app.canvas);

// load the texture we need
const texture = await Assets.load('bunny.png');

// This creates a texture from a 'bunny.png' image
const bunny = new Sprite(texture);

// Setup the position of the bunny
bunny.x = app.renderer.width / 2;
bunny.y = app.renderer.height / 2;

// Rotate around the center
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;

// Add the bunny to the scene we are building
app.stage.addChild(bunny);

// Listen for frame updates
app.ticker.add(() => {
    // each frame we spin the bunny around a bit
    bunny.rotation += 0.01;
});

Learn

  • Website: Find out more about PixiJS on the official website.
  • Getting Started:
    • Check out the getting started guide.
    • Also, check out @miltoncandelero's PixiJS tutorials aimed toward videogames with recipes and best practices here
  • Examples: Get stuck right in and play around with PixiJS code and features right here!
  • API Documentation: Get to know the PixiJS API by checking out the docs.
  • Guide: Supplementary usage guides to the API Documentation here.

Demos

Community

  • Forums: Check out the discussions and Stackoverflow -- both friendly places to ask your PixiJS questions.
  • Chat: You can join us on Discord to chat about PixiJS.

How to build

Note that for most users you don't need to build this project. If all you want is to use PixiJS, then just download one of our prebuilt releases. The only time you should need to build PixiJS is if you are developing it.

If you don't already have Node.js and NPM, go install them. Then, in the folder where you have cloned the repository, install the build dependencies using npm:

npm install

Then, to build the source, run:

npm run build

How to generate the documentation

The docs can be generated using npm:

npm run docs

Contribute

Want to be part of the PixiJS project? Great! All are welcome! We will get there quicker together :) Whether you find a bug, have a great feature request, or you fancy owning a task from the road map above, feel free to get in touch.

Make sure to read the Contributing Guide before submitting changes.

License

This content is released under the (http://opensource.org/licenses/MIT) MIT License.

filters's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

filters's Issues

[REQUEST] The Demo uses separate filters-files when `build:dev`

The Demo is not only for demo , it's also a very good test case.
I think many developers would use it for testing when the filter is under develop.
But the new Demo is hard to test and dev.

When add or modify the filters-files , users have to run npm run build again.

I think uses separate filters-files is a better choice.

Thank you.

Importing pixi-filters doesn't seem to do anything

I'm trying to get the filters to work, but am failing to do so.

I've imported both pixi.js and pixi-filters to no avail:

import 'pixi.js';
import 'pixi-filters';

// ...

const outlineFilterRed = new PIXI.filters.GlowFilter(15, 2, 1, 0xff9999, 0.5);

Produces the following error:

Property 'GlowFilter' does not exist on type 'typeof filters'.

Package Versions:
pixi.js: 4.5.5
pisi-filters: 2.0.0

Could you please point out what am I doing wrong?

P.S
This issue on stackoverflow: https://stackoverflow.com/questions/46014961/how-to-get-pixi-filters-working

Cannot find module 'glslify'

I want to use pixi-filters like this :

const PIXI = require('pixi.js'),
    filters = require('pixi-filters')

But when my browserify task is running, i get this error :
capture d ecran 2017-04-10 a 12 16 44

All my packages are up to date and correctly installed, but this one seems to have a problem with glslify.

How can I solve the problem ?

Deprecate Bower Support

Bower support has been dropped in favor of using npm/yarn in PixiJS. Should drop support for it here and undo the complex publish process.

Switch Pixi reference in examples to use HTTPS

Change http://s3-eu-west-1.amazonaws.com/pixi.js/dev/pixi.min.js to https://s3-eu-west-1.amazonaws.com/pixi.js/dev/pixi.min.js.

This would prevent issues in situations where the github.io link is HTTPS rather than HTTP and throws a Mixed Content exception.

Run Shockwave Filter just once?

I've tried setting the shockwave value to null using a settimeout and removing the filter, but that doesn't seem to work right. I want the shockwave applied just once to my bg sprite when the user clicks on it - not in a looping fashion like the sample Is there a way to do this that is performance friendly? Overall the filter is super cool but seems like it would be costly.

[SUGGEST] Make the ColorReplace Filter support multi colors.

In the real game , replace multi colors is very useful.
e.g. it could be used for making multi characters with one template image + some color palettes.

this is a template image:
image

this is a color palette, in game, the bottom colors in the template image will be replaced with top colors :
image

another color palette, could create another character:
image

`npm run build` can't run.

I've install all node_modules .
but there're some errors:

rocky@Rocky-MBP pixi-filters [* master]$ npm run build

> @ prebuild /Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters
> npm run lint


> @ lint /Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters
> eslint scripts **/src **/rollup.config.js --fix


> @ build /Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters
> lerna run build

lerna info version 2.4.0
lerna ERR! build Errored while running script in '@pixi/filter-ascii'
lerna ERR! execute callback with error
lerna ERR! Error: Command failed: npm run build
lerna ERR! [!] Error: Cannot find module '@tools/build'
lerna ERR! Error: Cannot find module '@tools/build'
lerna ERR!     at Function.Module._resolveFilename (module.js:469:15)
lerna ERR!     at Function.Module._load (module.js:417:25)
lerna ERR!     at Module.require (module.js:497:17)
lerna ERR!     at require (internal/module.js:20:19)
lerna ERR!     at Object.<anonymous> (/Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/filters/ascii/rollup.config.js:5:29)
lerna ERR!     at Module._compile (module.js:570:32)
lerna ERR!     at Object.require.extensions..js (/Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/node_modules/rollup/bin/rollup:2675:8)
lerna ERR!     at Module.load (module.js:487:32)
lerna ERR!     at tryModuleLoad (module.js:446:12)
lerna ERR!     at Function.Module._load (module.js:438:3)
lerna ERR! 
lerna ERR! 
lerna ERR! npm ERR! Darwin 17.0.0
lerna ERR! npm ERR! argv "/Users/rocky/.nvm/versions/node/v6.10.3/bin/node" "/Users/rocky/.nvm/versions/node/v6.10.3/bin/npm" "run" "build:umd"
lerna ERR! npm ERR! node v6.10.3
lerna ERR! npm ERR! npm  v3.10.10
lerna ERR! npm ERR! code ELIFECYCLE
lerna ERR! npm ERR! @pixi/[email protected] build:umd: `rollup -c -f umd && rollup -cp -f umd`
lerna ERR! npm ERR! Exit status 1
lerna ERR! npm ERR! 
lerna ERR! npm ERR! Failed at the @pixi/[email protected] build:umd script 'rollup -c -f umd && rollup -cp -f umd'.
lerna ERR! npm ERR! Make sure you have the latest version of node.js and npm installed.
lerna ERR! npm ERR! If you do, this is most likely a problem with the @pixi/filter-ascii package,
lerna ERR! npm ERR! not with npm itself.
lerna ERR! npm ERR! Tell the author that this fails on your system:
lerna ERR! npm ERR!     rollup -c -f umd && rollup -cp -f umd
lerna ERR! npm ERR! You can get information on how to open an issue for this project with:
lerna ERR! npm ERR!     npm bugs @pixi/filter-ascii
lerna ERR! npm ERR! Or if that isn't available, you can get their info via:
lerna ERR! npm ERR!     npm owner ls @pixi/filter-ascii
lerna ERR! npm ERR! There is likely additional logging output above.
lerna ERR! npm WARN Local package.json exists, but node_modules missing, did you mean to install?
lerna ERR! 
lerna ERR! npm ERR! Please include the following file with any support request:
lerna ERR! npm ERR!     /Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/filters/ascii/npm-debug.log
lerna ERR! 
lerna ERR! npm ERR! Darwin 17.0.0
lerna ERR! npm ERR! argv "/Users/rocky/.nvm/versions/node/v6.10.3/bin/node" "/Users/rocky/.nvm/versions/node/v6.10.3/bin/npm" "run" "build"
lerna ERR! npm ERR! node v6.10.3
lerna ERR! npm ERR! npm  v3.10.10
lerna ERR! npm ERR! code ELIFECYCLE
lerna ERR! npm ERR! @pixi/[email protected] build: `npm run build:umd && npm run build:es`
lerna ERR! npm ERR! Exit status 1
lerna ERR! npm ERR! 
lerna ERR! npm ERR! Failed at the @pixi/[email protected] build script 'npm run build:umd && npm run build:es'.
lerna ERR! npm ERR! Make sure you have the latest version of node.js and npm installed.
lerna ERR! npm ERR! If you do, this is most likely a problem with the @pixi/filter-ascii package,
lerna ERR! npm ERR! not with npm itself.
lerna ERR! npm ERR! Tell the author that this fails on your system:
lerna ERR! npm ERR!     npm run build:umd && npm run build:es
lerna ERR! npm ERR! You can get information on how to open an issue for this project with:
lerna ERR! npm ERR!     npm bugs @pixi/filter-ascii
lerna ERR! npm ERR! Or if that isn't available, you can get their info via:
lerna ERR! npm ERR!     npm owner ls @pixi/filter-ascii
lerna ERR! npm ERR! There is likely additional logging output above.
lerna ERR! npm WARN Local package.json exists, but node_modules missing, did you mean to install?
lerna ERR! 
lerna ERR! npm ERR! Please include the following file with any support request:
lerna ERR! npm ERR!     /Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/filters/ascii/npm-debug.log
lerna ERR! 
lerna ERR! > @pixi/[email protected] build /Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/filters/ascii
lerna ERR! > npm run build:umd && npm run build:es
lerna ERR! 
lerna ERR! 
lerna ERR! > @pixi/[email protected] build:umd /Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/filters/ascii
lerna ERR! > rollup -c -f umd && rollup -cp -f umd
lerna ERR! 
lerna ERR! 
lerna ERR!     at Promise.all.then.arr (/Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/node_modules/execa/index.js:236:11)
lerna WARN complete Waiting for 3 child processes to exit. CTRL-C to exit immediately.
lerna ERR! build Errored while running script in '@pixi/filter-color-replace'
lerna ERR! build Errored while running script in '@pixi/filter-bloom'
lerna ERR! build Errored while running script in '@pixi/filter-bulge-pinch'
(node:19430) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 12): Error: Command failed: npm run build
[!] Error: Cannot find module '@tools/build'
Error: Cannot find module '@tools/build'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/filters/ascii/rollup.config.js:5:29)
    at Module._compile (module.js:570:32)
    at Object.require.extensions..js (/Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/node_modules/rollup/bin/rollup:2675:8)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)


npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/rocky/.nvm/versions/node/v6.10.3/bin/node" "/Users/rocky/.nvm/versions/node/v6.10.3/bin/npm" "run" "build:umd"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @pixi/[email protected] build:umd: `rollup -c -f umd && rollup -cp -f umd`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @pixi/[email protected] build:umd script 'rollup -c -f umd && rollup -cp -f umd'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @pixi/filter-ascii package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     rollup -c -f umd && rollup -cp -f umd
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs @pixi/filter-ascii
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls @pixi/filter-ascii
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/filters/ascii/npm-debug.log

npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/rocky/.nvm/versions/node/v6.10.3/bin/node" "/Users/rocky/.nvm/versions/node/v6.10.3/bin/npm" "run" "build"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @pixi/[email protected] build: `npm run build:umd && npm run build:es`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @pixi/[email protected] build script 'npm run build:umd && npm run build:es'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @pixi/filter-ascii package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build:umd && npm run build:es
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs @pixi/filter-ascii
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls @pixi/filter-ascii
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/filters/ascii/npm-debug.log

> @pixi/[email protected] build /Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/filters/ascii
> npm run build:umd && npm run build:es


> @pixi/[email protected] build:umd /Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/filters/ascii
> rollup -c -f umd && rollup -cp -f umd



npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/rocky/.nvm/versions/node/v6.10.3/bin/node" "/Users/rocky/.nvm/versions/node/v6.10.3/bin/npm" "run" "build"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ build: `lerna run build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ build script 'lerna run build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     lerna run build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/rocky/DEV/@git-fav/_pixijs.com/pixi-filters/npm-debug.log
rocky@Rocky-MBP pixi-filters [* master]$ 


Add a Threshold Filter

Hello!

As per pixijs/pixijs#2297 it would be nice to have a threshold filter with a configurable threshold point. This has applications in a few other effects (bloom-like effects, faux-metaball effects, image processing).

Thank you!

Pixi.Filter is undefined

Hello! Your README approach doesn't seem to work or there's a version conflict or something.

  <script src="/node_modules/pixi.js/bin/pixi.js"></script>
  <script src="/node_modules/pixi-filters/bin/pixi-filters.js"></script>

In PIXI.Filter.prototype -> Uncaught TypeError: Cannot read property 'prototype' of undefined
PIXI.VERSION 3.0.10
pixi-filters 1.0.0

Replace Browserify Build with Rollup

Replace Browserify builds with Rollup builds. Makes it much easier to generate clean build files without the internal module overhead in Browserify. Should help reduce the overhead of building and build for es environments (pkg.module)

The arguments of Filter should not be uv coord.

Example :
the center of ShockwaveFilter used uv coord, the x/y is [0.0 , 1.0].

When user want to use it , have to do some transform.

I know the transform is easy , but uv is the low layer in renderer, it should be black-box for the game coder.

And in real case , e.g. : a stone drop into a water .
The logic of game should be :

// water is a Sprite object.

var filter = new Shockwave(store.position);
water.filters = [filter];

It's easy and clear.

if Shockwave.center use uv coord.

the code maybe like this :

// water is a Sprite object.

var center = new PIXI.Point(0,0);
center.x = store.position.x / app.renderer.width;
center.y = store.position.y / app.renderer.height;
var filter = new Shockwave();

In fact , use app.renderer.width & app.renderer.height is wrong.
it's need use filterArea. but user can't get the filterArea easily.

So I think the filter should use screen/viewport/pixel coord, and filter do transform internal .

ColorMatrixFilter broken in Chrome

Firefox version: 49.0.2
Chrome version: Version 54.0.2840.87 m

If you go to this page in both Firefox and Chrome and compare you can see the the ColorMatrixFilter has no effect.

https://pixijs.github.io/examples/#/filters/filter.js

I will include an image comparing the two where it is apparent where Firefox is on the left and Chrome is on the right. I am using this filter heavily in my application so I would b very appreciative if it was fixed, thank you.

colorizefilter_firefox_vs_chrome

DropShadowFilter

Hi!

Would it be possible to have DropShadowFIlter in pixi v4? If its simply copying files from v3 with a little change I would be happy to help.

Cheers,
P.

npm install doesn't have any js files

When I install via npm like so:

npm install pixi-filters

I don't get any js files. Just the following:

.npmignore
package.json
README.md

Am I missing a step here?

Talk about `ShockwaveFilter`

My game need shockwave effect , so I have been doing research on it recently.

I think the shockwave need these features(params) :

  • center ( already in current ShockwaveFilter, but not in pixel coord)
  • time ( already in current ShockwaveFilter)
  • speed
  • duration
  • amplitude ( already in current ShockwaveFilter, params.x )
  • refraction ( already in current ShockwaveFilter, params.y )
  • wavelength ( already in current ShockwaveFilter, params.z, but not in pixel coord )
    Q: params.z = half of wavelength ???
  • lighter

the speed & duration are very important for shockwave effect in a real game.

And the shockwave needs attenuation effect ( bad English) . I mean that the amplitude should be smaller and smaller with time.

the lighter is used for enhancing the effect. In some cases (e.g. a pond in a dark forest) , if no lighter , player will see the shockwave effect difficulty.


So I want to create a new ShockwaveFilter, then an old question:

Should I create a new AdvancedShockwaveFilter or create a new shockwave filter ?

Could you give me some advices please , thank you ?

[REQUEST] Need more arguments of BloomFilter.

The BloomFilter based on Blur Filter. There are 4 arguments in Blur Filter strength, quality, resolution, kernelSize

But only strength(named blur in BloomFilter) should be set .
I hope BloomFilter could supply all Blur Filter's arguments as optional .

They could help user to control the detail of bloom effect .


BTW , I hope strength and blur could become one name (bad english..., but I think you could understand me)

Fails to build on old node version

I'm almost certain this is because of the old node I'm running (and which the company mandates... grrrrrr) - but there's an error when it tries to run the linting part. Could the script either fail to run if it detects an older node version, and / or provide pre-built bin files for those who may be in a similar situation please? Cheers

C:\Projects\WebGL\pixi-filters>npm run lint

> [email protected] lint C:\Projects\WebGL\pixi-filters
> eslint src/**/*.js

C:\Projects\WebGL\pixi-filters\node_modules\eslint\node_modules\strip-bom\index.js:2
module.exports = x => {
                   ^^
SyntaxError: Unexpected token =>
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\Projects\WebGL\pixi-filters\node_modules\eslint\lib\config\config-file.js:23:16)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "lint"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] lint: `eslint src/**/*.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] lint script 'eslint src/**/*.js'.
npm ERR! This is most likely a problem with the pixi-filters package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     eslint src/**/*.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls pixi-filters
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Projects\WebGL\pixi-filters\npm-debug.log

C:\Projects\WebGL\pixi-filters>

normal map GodrayFilter

Hi , first , thank you guys for GodrayFilter and AdvancedBloomFilter , your are awsome !!!
is there a chance that it can work with normal map.
idea to make fake dynamic lighting or special effects on sprites. like Emboss Effect.
if yes, do you have an example, its is simple to do?

i would like use this normal map generator
https://www.codeandweb.com/spriteilluminator
GitHub Logo
thanks

[SUGGEST]Manage shader's source with ES6 standard method.

@bigtimebuddy I refactor my custom Filter and use common export string & import string & template string like this :

import commonHead from '../_shared/common-head.frag.js';
import loadDiffuse from '../_shared/load-diffuse.frag.js';
import loadNormal from '../_shared/load-normal.frag.js';
import computeNormal from '../_shared/compute-normal.frag.js';

export default `

${commonHead}

void main(void)
{

${loadDiffuse}
${loadNormal}

    uViewSize;

    // simplified lambert shading that makes assumptions for ambient color

    // compute Distance
    float D = 1.0;

${computeNormal}

    vec3 L = vec3(1.0, 1.0, 1.0);

    // pre-multiply light color with intensity
    // then perform "N dot L" to determine our diffuse
    vec3 diffuse = uLightColor * max(dot(N, L), 0.0);

    vec3 finalColor = diffuseColor.rgb * diffuse;

    gl_FragColor = vec4(finalColor, diffuseColor.a);
}

`;

then use

import vertex from './ambient.vert.js';
import fragment from './ambient.frag.js';

in Filter js file.

I think this way is standard and more common . It's better than using glslify(pixi 4.0) or readFileSync(pixi 4.5) or rollup's rule(pixi-filters).

[SUGGEST] Add `list of files modified` to Wiki

When I create a new filter , I need to modify some files.
But I often forget someone.

So, suggest add a clear list of the files need to modified.

	modified:   filters/all/src/index.js
	modified:   filters/all/package.json
	modified:   filters/all/types.d.ts
	modified:   filters/all/README.md
	modified:   examples/index.html
	modified:   tools/screenshots/config.json
	modified:   README.md

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.