Jump to content

Merge Two Grounds.


amethlex
 Share

Recommended Posts

Hi All,

 

I am using Babylonjs to create map these days. Basically, I have two layers, one layer is tiledmap, which is a png image, another is semantic map, which is a svg file. The size of two map is almost same. So I just create two grounds whose materials are created by the png image and the svg file and put them at the same position. 

If I make them locate at different heights, one ground will hide another. If I make them locate at the same heights, they cannot merge perfectly, at some angle you can see svg materials clearly, and png materials at  some other.

My problem is how to merge these two grounds perfectly?

 

Link to comment
Share on other sites

Huh?  Do you want to merge their geometry or create a single plane that is a combination of the two height values?

 

also for this to really work you would want the two images to be the same size or at least at some sort of whole ratio this can be done by loading the context into secondary canvases and making sure their original context is scaled to fit the two, so maybe pick the larger of the two images and scale the other up to it or downsize the big one to be the same size of the small one both will have slightly different results. 

the  make a final image that is a blending of the two images and use that as the height map.

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