webgl-gltf icon indicating copy to clipboard operation
webgl-gltf copied to clipboard

Mipmaping generate with image that are not power of 2 ?

Open clap8 opened this issue 3 years ago • 3 comments
trafficstars

I looking for source code and i'm surprise why there is no check for texture size before generate mipmaping. Is it normal ?

clap8 avatar Mar 03 '22 19:03 clap8

WebGL 1 doesn't support none power of two textures so it could make sense to have a check there but WebGL 2 does support it so I guess it should be based on the platform and maybe parameters when loading the model.

I guess adding it would make sense, I'm currently not actively developing this library but are open to PRs.

larsjarlvik avatar Mar 04 '22 02:03 larsjarlvik

Yes or just assume this plugin is for webgl2 only but your example is getting context from webgl1. Maybe browser get webgl2 by default ? that's why i'm a little bit confused.

clap8 avatar Mar 04 '22 11:03 clap8

It supports both, up to you which you you want to use, reason for using webgl 1 is mainly to support iOS safari in the demo.

I can see that not trying trying to mipmap npot textures if not supported makes sense or have mipmap as an option but it's not there at the moment. I mainly built the library for own usage so it's not covering everything.

larsjarlvik avatar Mar 04 '22 12:03 larsjarlvik