Jump to content

Tiled splatmap seams


feds.nz
 Share

Recommended Posts

Hey all,

I've been toying with creating a large open world, I planned to tile this using a smaller grid of tiles around the players local grid. A sample of what I am trying to achieve is at http://community.troy.nz/hm/index.html

What I have so far is a 7x7 grid of seperate tiles that use individual 513x513 32-bit heightmaps and 64x64 24bit splatmaps (i've tried various other sizes also) and three textures. I've noticed when using the splatmapping there is a seam at the edge of each tile as depicted below.

problem1.thumb.png.ce7084d6c7a32faa8703ab03b7a46dcd.png

Zooming in closer you can see the issue

problem2.thumb.png.b9e7a3d6b690c0db37d71c42f9ea0a91.png

When Zoomed right in you can see that one of the other textures is bleeding through, there's rocks behind the stone

problem4.thumb.png.7a5025427dadc73c40a1f4ac61bc9454.png

Does anyone have any idea on what is causing this and how to fix it? I would also be interested in being able to use multiple splatmaps (ideally several individual greyscale ones) to have more than 3 textures per tile, Is there another shader available that will do this?

problem3.png

Link to comment
Share on other sites

It seems I found a solution for this, it was as simple as setting the wrapu and wrapv values on the mixTexture. I previously tried this on the diffuseTextures to no avail.

tMaterial.mixTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
tMaterial.mixTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;

I now have a beautiful, seamless tiled map. I'm guessing to use more textures for splatting I will need to look at writing my own shaders, correct?

Link to comment
Share on other sites

For more textures, you have to write an extension of the terrainMaterial:

https://github.com/BabylonJS/Babylon.js/blob/87abffb0e0282c071356c815be0b71196a5c24da/materialsLibrary/src/terrain/babylon.terrainMaterial.ts#L31

You need to replicate what was done for diffuseTexture1/2/3 and introduce the same code for diffuseTexture4 for instance

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