emadurandal / GLBoost

A Useful WebGL Library for Small Turning (Outdated, Deprecated to use)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

glTF ファイルでテクスチャが2の累乗でない場合に表示されない。

cx20 opened this issue · comments

commented

現状、GLBoost の glTF Loader はテクスチャが2の累乗でな場合、表示できない。
他の WebGL ライブラリの glTF Loader を調査したところ、211x211→256x256 のように、2の累乗となるようリサイズしているケースがほとんどであった。
GLBoost の glTF Loader もテクスチャをリサイズして表示するようにしてはどうか?

[WebGL] GLBoost + BoxTextured.gltf
http://jsdo.it/cx20/8gKC

<2の累乗でない場合に表示されるコンソール上の警告>

RENDER WARNING: texture bound to texture unit 0 is not renderable.
It maybe non-power-of-2 and have incompatible texture filtering.

<211x211 テクスチャを使用している例>
■ glTF/sampleModels/BoxTextured/glTF-Embedded/BoxTextured.gltf
https://github.com/KhronosGroup/glTF/blob/master/sampleModels/BoxTextured/glTF-Embedded/BoxTextured.gltf

<関連>
■ [WebGL] Three.js + BoxTextured.gltf
http://jsdo.it/cx20/2hFA
■ [WebGL] Babylon.js + BoxTextured.gltf
http://jsdo.it/cx20/CnCg
■ [WebGL] GLBoost + BoxTextured.gltf
http://jsdo.it/cx20/8gKC
■ [WebGL] xeoEngine + BoxTextured.gltf
http://jsdo.it/cx20/uOGz

現在のバージョン( 4da7319 以降 )で対応できていますので、クローズします。