Comments (4)
the problem is, typings were changed. a lot. We cant compile it with TS anymore.
I can only modify resulting JS and publish it.
Alternatively, I can move it to new build system like pixi-tilemap
was moved.
from pixi-compressed-textures.
Also PixiJS v6 has compressed-textures internally, if you dont need my special kind of loader :)
https://github.com/pixijs/pixi.js/tree/dev/packages/compressed-textures
from pixi-compressed-textures.
hi @ivanpopelyshev, vey cool it's all integrated now!
I'm not sure if was able to port my code, I'm using compressedTextures.loadFromArrayBuffer
and fetching .basis
manually. I couldn't find similar API on v6
mainTexture = fetch(
!darkMode
? await FileAttachment("[email protected]").url()
: await FileAttachment("final-100n-250-black-8192.basis").url()
)
// .arrayBuffer() // FileAttachment("final-basis-level-3.basis")
.then(d => d.blob())
.then(blob => blob.arrayBuffer())
.then(array => PIXI.compressedTextures.loadFromArrayBuffer(array))
.then(d => {
const texture = new PIXI.BaseTexture(d);
texture.scaleMode = PIXI.SCALE_MODES.NEAREST;
return texture;
})
from pixi-compressed-textures.
finally spent some time on this and found a way to use the loader functions directly
mainTexture = fetch(
!darkMode
? await FileAttachment("[email protected]").url()
: await FileAttachment("final-100n-250-black-8192.basis").url()
)
.then((d) => d.blob())
.then((blob) => blob.arrayBuffer())
.then((array) => PIXI.BasisLoader.transcodeAsync(array))
.then((transcoded) => {
const e = PIXI.BasisLoader.registerTextures("mainTexture", transcoded);
return e.texture;
})
.then((texture) => {
texture.scaleMode = PIXI.SCALE_MODES.NEAREST;
return texture;
})
here is the final example!
https://observablehq.com/@radames/blocks-embeddings
from pixi-compressed-textures.
Related Issues (14)
- The "example" link is 404 HOT 2
- 404 not found - demo example 3 console errors HOT 1
- Unable to load etc1 (pvr) texture HOT 7
- pixi-compressed-textures TypeScript Definition HOT 4
- premultipliedAlpha not work HOT 11
- Module not found: Error: Can't resolve 'fs' HOT 2
- Not working with PIXI v5.1.1 HOT 15
- KTX support? HOT 3
- Documentation enhancements
- Plugin always assumes that compressed texture has not premultiplied alpha HOT 13
- Can anyone teach me to use this compress , please...😇 HOT 1
- how can i load a .dds file with pixijs-v6?
- how can i make a line clickable? HOT 1
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 pixi-compressed-textures.