chicagobob123 Posted February 23, 2018 Share Posted February 23, 2018 I loaded and assigned a texture maps to a plane 2048 planes. in a grid pattern. Loaded each with an image. plane.material.diffuseTexture = new BABYLON.Texture("grnd.png", scene, false, false, null, function() { }); As I zoom in I want to replace the images in view and what happens is all the previous images disappear all at once before the new ones are painted. So in short it looks blank then new images roll on. YUCK This is what it looks like being replaced. Blank background while pieces being replaced. Anyway of not erasing the old before they are replaced? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted February 23, 2018 Share Posted February 23, 2018 You would need to assign a new material when it changes. Otherwise the change on the one will go over to all the other meshes that share the material. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 24, 2018 Share Posted February 24, 2018 Hi guys. CB, you are STILL trying to "replace image"... by loading them, right? There's no way of loading them all into a "textures tank" at scene load-time? MUST you load them on-the-fly? https://www.babylonjs-playground.com/#16Z24R#5 There's a 4-texture sequencer with textures from a 'texturesTank'. *shrug* It switches textures real nicely. Oh but... you were talking about 200 labels, recently, right? SO... you probably want to ONLY load new images... for the section that is being zoomed-upon. So, we'd be talking 600-800 texture pre-loads... for all 200 scene entities to have a 3-4 texture-change upon zooming-in? Yuh, you only want to pre-fetch the textures that pertain to the zoomed-upon area/item... I bet. If so, never mind me. But still... use a "smart texturesTank", maybe. The camera.movedAlongAxisToTarget...Observer... keeps the texturesTank fresh. The texturesTankManager could constantly monitor the camera target and position, and... Oh wait... this is why you were asking about loading textures in the background, isn't it? You were already thinking about a smart texture-loading robot. Ok, I got no ideas at all. heh. Nothing new there, eh? Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted February 24, 2018 Author Share Posted February 24, 2018 Total picture size is GB. What I am doing is selectively loading tiles based on position distance and zoom. So at zoom level far away I load the 64 x 32 grid of planes on a 8k x 4k ground with images from zoom level x as I get closer and when the zooming has stopped I load new tiles at the new zoom levels. Basically defering trying to load a ton of data. We modeled the ground in a prior version and it was 239MB 2.7 million polys and that wasn't totally complete. Basically OUCH. So I was trying to swap them out on the fly as we zoomed closer. Instead of just getting tile x updated and y and z overlaying the original I get DELETE all tiles and bring in new ones one at a time. Not what i expected at all. What i want is virtual texturing without the pain. Being able to seamlessly swap out textures was part of the plan that didn't work. And to answer Prymate there should be no sharing of material Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted February 26, 2018 Share Posted February 26, 2018 Try something like that (not tested as I'm on holidays :)) var texture = new BABYLON.Texture("grnd.png", scene, false, false, null, function() { plane.material.diffuseTexture = texture }); Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.