feds.nz Posted March 20, 2017 Share Posted March 20, 2017 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. Zooming in closer you can see the issue When Zoomed right in you can see that one of the other textures is bleeding through, there's rocks behind the stone 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? Quote Link to comment Share on other sites More sharing options...
feds.nz Posted March 21, 2017 Author Share Posted March 21, 2017 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? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 21, 2017 Share Posted March 21, 2017 Good catch and thank you for letting us know Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 21, 2017 Share Posted March 21, 2017 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 Quote Link to comment Share on other sites More sharing options...
zahachtah Posted March 22, 2017 Share Posted March 22, 2017 I'd be very interested in learning how you do this, any chance you could share some code? particularly how to read in tiles and make a larger ground mesh as well as how to update as the player moves. 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.