- #Unity terrain splatmap texture edge blending how to#
- #Unity terrain splatmap texture edge blending mods#
Inside every chunk blending if okay, since I have the only material for the current mesh I have only to blend its textures depending on heights - and this is done by the shader. So I have a terrain made of a certain number of chunks, that are a certain number of meshes generated as the game launches. Every material has its own shader attached. is rendered with marching cubes algoritmĮvery Material is made of 3 texture: one main texture and 2 minor textures to be blended with the main one depending on the slope.contains a Mesh derived from the surface points of the voxel array.contains a NxNxN voxel array generated with perlin noise 3d.I'm developing a procedural terrain structured with voxel chunks. So basically, every time the texture has been sampled it either swaps the U and V sampling coordinates to rotate it, or does 1 minus U or V to mirror it.I think I should structure this question better. Here's an open question to anyone with shader experience: I'm wondering if there is a way to change the UV sampling direction each time the texture would repeat. The downfall to this approach is that, especially with upscaled textures, there will be a big increase in texture size and the texture will still repeat predictably, just less often. The most straightforward method to reduce repetition when using a splatmap would be to use a much larger texture that has variations baked into it. InterKarma baked these translations into a texture atlas (called a tileset) and builds one big texture from them stitched together, mapped by the tilemap which indicates which texture gets painted onto which location. From reading InterKarma's post about his tilemap shader, it looks like classic DF would rotate and mirror the textured tiles to create more variations from the same textures. One thing that stands out at the moment about the splatmap approach is that the textures appear to repeat a lot. So yeah, I mostly agree I'll probably do more development before I tackle any demonstrative comparisons. If I do a comparison at the moment, it would just show a few edge cases of how the textures look blended together. Otherwise, I'd have to try to create a splatmap by hand to get a reasonably accurate apples-to-apples comparison which would probably be time consuming with little payback. I'll need to read in InterKarma's tilemap data and generate a splatmap from that. It won't be any trouble to make a comparison, but only after I've tackled the programming side of it. "Just run the original game and see for yourself" maybe? Yea I guess the comparison can ppl make when its ready, now its just another thing to distract you, IMO. Does this sound like a worthwhile endeavor?Īs an aside, another feature I'd like to include is a detail texture that reduces texture tiling repetition when viewed at a far distance.Īside #2: Using a splatmap was alluded to in this post from InterKarma back in 2015 (see benefit number 9 in his list). I don't have much to show at this point, but I wanted to get some general feedback from the community before I spent any more time on it. On the other hand, it may not look as good when using just the vanilla graphics.
#Unity terrain splatmap texture edge blending mods#
My opinion is that a splatmap based terrain shader would work much better for mods, particularly mods where upscaling the terrain graphics is needed (such as DREAM and PVE), and where custom road paths (or rivers!) may be drawn ( Roads of Daggerfall). My plan (which I have only just barely started looking at) is to try to intercept the tilemap index values and map them to a custom tileset atlas that that will build a splatmap to indicate where and how much of each texture to draw onto the terrain. In the case of the temperate tile set (archive 302), I have the dirt texture as a base, then the (R) channel of the splatmap is for Roads, the (G) channel is for Grass, (B) is for water, and (A) is for rock. So far, I've gotten a shader that, if provided with a RGBA splatmap, can draw up to 5 albedo/normals over the terrain with heightmap blending between them. I'm terrible with shader code, but I've recently purchased amplify shader editor and have been having fun with it and thought it would be neat to take a stab at creating a new terrain shader that could generate a splatmap from the DFTFU generated tilemap, as detailed here.
#Unity terrain splatmap texture edge blending how to#
I had been thinking on how to overcome this issue and haven't been able to come up with any other alternative but to try to use a custom terrain shader with a splatmap. In working with upscaled graphics, I've noticed that it is very difficult, if not impossible, to get the terrain textures to align seamlessly when they are stitched together in the context of the tilemap.