whs.js
whs.js copied to clipboard
Improve TextureModule
Some improvements can be made to TextureModule
- [x] allow setting more options on underlying texture from constructor (make sure includes every option three does)
- [x]
minFilter
andmagFilter
- [x]
- [ ] allow passing in an "image object", i.e.
(new THREE.TextureLoader()).load(imageUrl)
- [ ] support data textures (or maybe make a
DataTexture
module - I have a wip for this) - [ ] support for a
LoaderModule
which can pass the resolved texture to the component, while managing loading status for all items used in it - see #215
Version:
- [x] v2.x.x
- [ ] v1.x.x
Issue type:
- [ ] Bug
- [x] Proposal/Enhancement
- [ ] Question
Tested on:
Desktop
- [ ] Chrome
- [ ] Chrome Canary
- [ ] Chrome dev-channel
- [ ] Firefox
- [ ] Opera
- [ ] Microsoft IE
- [ ] Microsoft Edge
Android
- [ ] Chrome
- [ ] Firefox
- [ ] Opera
IOS
- [ ] Chrome
- [ ] Firefox
- [ ] Opera
@thejmazz
There is a way to modify the texture before it is applied to mesh. See fix()
property. This one works similarly to module bridges.
https://github.com/WhitestormJS/whitestorm.js/blob/beta/src/modules/mesh/TextureModule.js#L27
Usage:
// ...
new TextureModule({
url: 'my/path/to/texture.png',
fix(tex) {
tex.minFilter = // ...
return tex;
}
})
hello,I have some issues in textureModule,Can you help me ? issue is here
@elva2596 Yes, will do. /ping @hirako2000