javascript - What is the best practice for loading multiple textures in three.js? -
javascript - What is the best practice for loading multiple textures in three.js? -
having switched three.js
renderer, wanting set scheme mapping textures. however, i'm not sure on best practice is. here utilize case
i have textures set in sprite sheet; each texture 64x64 pixel square, each different texture offset 64 pixels depending on position.
is necessary, or should have directory total of many different textures, loop through , create new instance of three.imageutils.loadtexture( "textures/sometexture.png" );
each one?
or there more efficient way of doing this?
since textures lightweight, on-demand approach mention in comment separate files right method because gives explicit command on loaded , when. smart handling important, load visible textures first, textures might become visible movement, else. utilize of fog , photographic camera view frustum/distance properties can create much of automatic.
it legitimate strategy arrange multiple textures larger file ( 2048 x 2048 high want go ) , load them @ once, if net connection works improve less file handling (cough coughing satellite). think strategy begins fail if ever need update individual textures because means replacing whole image. if have "zones" utilize texture sets, might thought preload these sets big images if player approaching zone , preloader not chugging.
the entire history of net story of efficient loading of media, you're on well-trodden ground. check out how browser caches work never reload image don't have to. hope helps.
javascript three.js game-engine texture-mapping node-webkit
Comments
Post a Comment