Comments (7)
The unfortunate part about this is that all other tooling related to writing these shaders breaks (syntax highlighting, compilation checking, etc).
from filters.
@finscn's approach is useful if you need to compose multiple fragments. It can help reduce common code and to create better maintainability and encapsulation of functionality. The tradeoff, like @englercj is that it makes the shaders less friendly with outside tools.
Since we don't have a big need to compose multiple fragments (other than maybe Godray #40), there isn't really a big need to convert .frag files to JS modules for the purpose of templating. And the common code eliminated is so small, the tradeoff doesn't seem worth it.
Interesting approach, but not the right choice for pixi-filters.
from filters.
@bigtimebuddy @englercj , I think we could Create a tool to convert the pure .frag
/ .vert
files to js file .frag.js
/ .vert.js
.
And import the .frag.js
and .vert.js
in filter js.
when build pixi , run the convert tool first , then do ES6 compile.
the convert tool fetch all .frag
and .vert
files that start with // convert-js
(just a flag) , then add
export default `
and
`;
to the files , then create new files .frag.js
and .vert.js
.
The files don't start with // convert-js
won't be converted.
And I think we can add this feature to pixify
, the gulp script could do the work.
from filters.
@finscn, you are proposing more complexity for little reward. Introducing a lot of hidden magic into the build process is not a big win.
What problem are you trying to solve? If you want to chop a bunch of small files into even smaller files so that you can reuse single lines (e.g., varying vec2 vTextureCoord;
), that's not worth the effort. If your goal is to compose fragments, doing a simple JS string replace with a token will do the same thing without a lot of custom build operations or plugins.
I agree with you that glslify or babel-plugin-static-fs are not great solutions for PixiJS. But Rollup allows us to easily import non-JS as strings and has lots of benefits over Browserify and works with Webpack and browsers.
from filters.
I don't want to solve any problem.
I just love standard ES script.
So I don't like that there are some non-ES-feature in pixi's JS file.
When will you use Rollup for pixi.js ? Is there a roadmap or plan ?
from filters.
As soon as @GoodBoyDigital finishes merging dev into next then I'm going to start implementing Rollup and Lerna for v5. I'm hoping sometime in the next few weeks.
from filters.
Waiting that pixi.js uses Rollup and Lerna.
from filters.
Related Issues (20)
- Pixi v6 + Vue 3 (Vite) has error on import HOT 1
- Pixi core 7.0.0 dependancy HOT 2
- How to clone filters from a spirte applied to anther sprite ? HOT 1
- Get error trying to use CRTFilter HOT 1
- Uncaught TypeError: class constructors must be invoked with 'new' using Shockwave filter
- Incorrect options type in `ColorGradientFilter` HOT 1
- `DropShadowFilter`'s `offset` doesn't respect target scale
- Deprecation Warning: `utils.hex2rgb` when using PixiJS filters with PixiJS v7.2.0+ HOT 3
- a polar filter
- Bug with wgsl on some filters (v8) HOT 1
- CDN doesn't provide latest
- demo site not working HOT 2
- Deprecation Warning in Drop Shadow Filter
- Shockwave filter not supporting alpha HOT 1
- Bug: ShockwaveFilter WebGPU vs WebGL (PixiJS v8) HOT 1
- Get the bitmap data of a display object with a filter applied HOT 1
- No v6.x module support on jsDelivr HOT 1
- Cannot find module 'gradient-parser' HOT 1
- `BevelFilter` rotation defaults to 0° instead of 45° HOT 2
- TiltShiftFilter shows a strange behavior where the effect starts and ends
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filters.