Jump to content

When you replace a diffuse texture how do you stop if from disappearing?


chicagobob123
 Share

Recommended Posts

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?

 

checkboard.PNG

Link to comment
Share on other sites

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?  :)

Link to comment
Share on other sites

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. :huh: 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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...