[Released] MegaSplat, a 256 texture splat mapping system..

MegaSplat is out! Don’t know what MegaSplat is?

MegaSplat is a collection of shaders and tools to allow you to splat map meshes with up to 256 textures in a single pass. It features consistent shader performance regardless of how many textures you paint onto your mesh or terrain, and that performance is faster than traditional splat map techniques.

MegaSplat works with Unity Terrains, or Meshes!

Asset Store Link

MegaSplat includes a unique shader compiler, generating unique and efficient shaders for the features you want. Shaders are based off Unity’s standard shader metallic workflow, and support all the lighting and rendering modes they support. In additional to a full PBR workflow, they also support features like:

  • Tessellation, Displacement, and Parallax
  • Flow Mapping for moving surfaces
  • Refractive Flow Mapping for watery surfaces
  • Paintable Puddles and Wetness
  • Global Snow, with adjustable sparkle (ice BDRF)
  • Triplanar UVs, projected UVs, and multiple UV set support
  • Texture Clustering, which prevents visible tiling of textures better than any other solution
  • Macro Texturing/Detail Texturing with multiple blend modes (overlay, multiply2x, normal, etc)
  • Distance cross-fading to a macro texture to use a simpler representation in the distance
  • Multiple texture packing options
  • Ability to paint splat maps over regularly textured objects
  • Alpha and Alpha Test (clipmap) modes
  • Integration with many Unity store assets
  • And much more


MegaSplat also includes my Vertex Painting toolset, which is one of the most advanced and performant Vertex Painting systems for Unity. Easily paint over hundreds of objects with millions of vertices, paint into any vertex channel (color, uvs, etc), edit mesh geometry, paint flow directions, visualize vertex data, bake ambient occlusion and lighting information into your vertices and much more.

MegaSplat also includes a Terrain Painting tool for working with Unity Terrains using the same workflow. All features available in the Mesh workflow are available in the Terrain workflow.

MegaSplat also includes custom brushes for working with it’s shaders. Easily paint multiple textures down in a single stroke, choosing which texture gets applied to which vertex based on 3d noise functions, height, or slope. With so many textures available, whole new ways to texture terrain are possible!


MegaSplat includes 60 high quality PBR terrain textures to get you started. Having this many textures available for splat mapping greatly expands the types of techniques you can use. The included textures are paired into several variations each, which allows you to prevent visible tiling by varying and blending the textures together using it’s unique Texture Cluster technology.

You can easily convert terrains generated in Terrain Generation tools like Gaia, Terrain Composer, and Map Magic to MegaSplat format. Simply map your source texture to one of the Texture Clusters in MegaSplat and press convert, then proceed to paint even more textures down.

Native integrations available for:

  • Map Magic
  • Landscape Builder
  • Gaia 2.0 (coming soon)
  • Terrain Engine
  • Amplify Shader Editor

Includes native procedural texturing tools.
Use a shader graph like interface to design custom texturing procedures which work natively in MegaSplat format, allowing you to take advantage of hundreds of textures at once. Adjustments to parameters show their results in real time, as you work, instead of having to wait minutes to see the results.
A runtime procedural system based on triplanar projection is also available for meshes, allowing you to project two layers of top/side/bottom textures, mixed by noise functions, and using Texture Clusters to vary textures in the projections.

MegaSplat also includes:

  • Tools for rapidly painting a terrain from a guide image
  • Components for determining which texture is hit with raycasts or collisions
  • Shader modes for painting splat maps over traditionally textured objects
  • Tools to “Render Bake” out the final splat mapping results (Albedo, Normal, etc) to use as distance LODs
  • Nodes which integrate into the Amplify Shader Editor, allowing you to use the splat mapping technique easily in your own shaders
  • Tools for creating and automatically managing Texture Arrays in Unity
  • Tools for integrating physics interactions with tessellated/displaced surfaces
  • Extensive documentation and videos

Note that MegaSplat requires shader model 3.5 and Unity 5.4 or greater for Texture Array support. This means that it will not work on openGLES 2.0 or DX9 devices, but will run on devices with openGLES 3.0, openGL3.2, Metal, and most console platforms. Tessellation requires shader model 4.6, and will run on PCs, OSX, consoles, and high end mobile hardware.

Why be limited to just a few textures, let you imagination run wild!

20 Likes

Here’s a quick video showing off painting in MegaSplat:

4 Likes

Awesome!!Super cool!!
I’ll be sure to buy it !

Distance cross fading seems interesting, as only worry I have about this is that it’s meshes without any lod support… what performance would we be looking at?

1 Like

Distance cross fading is strickly optional, but can actually be a performance optimization, since I can stop doing the splat mapping once the opacity is 0 on the splats, making the shader much cheaper in the distance (I haven’t actually added this optimization yet, but will very soon).

This is AWESOME. I was like…WHERE are the cool new terrain shaders using texture arrays!!! Finally!
Would like to get a sneak preview of your documentation, if possible.

A couple of questions:
Why the 2 layer limit? Not a big deal, I personally think 2-4 textures at one location MAX is plenty, I’m just curious.

I tried to view the video using just youtube, says removed by user. That correct?
The video quality is low, I found myself wanting to see more detail on how your textures look when using normal maps, height maps, etc. Looking forward to seeing your terrain painting in all its glory.

Here’s another video I recorded going over the process of setting up meshes and texture arrays with MegaSplat:

1 Like

So, to be able to work with TextureArrays in this manner, you need to get an index value from the vertex to the pixel shader for each vertex on a given triangle. As an example, you might paint index 1 on the first point, 5 on the next, and 9 on the third vertex. In this pixel shader, you need to sample these three textures and height blend them together. So the first issue is that if you simply put those values into the vert2fragment structure, they’re going to be interpolated, which will cause it to sample every texture between 1 and 9 across the face.

So the mesh preprocess marks some filtering data onto the vertex colors which can be used to ensure that the correct values make it to the pixel shader, and only textures 1, 5, and 9 are sampled. This means that each layer of texture requires 3 samples per texture, and one texcoord worth of data in the vert2fragment structure. If you use the NormalSmoothnessAO packing I use, that means you have 6 texture samples per pixel for one layer of splat mapping. When you go to two layers, that’s now 12 texture samples per pixel and two texcoords.

A third layer may be possible to add, but that would be 18 samples minimum per pixel and 3 texcoords. If you’ve ever written shaders, you know that texcoords are in short supply, so that might bump the minimum requirement up to shader model 4.0.

Timing, I just updated it (chopping off the 2 minutes of black at the end).

It’s a 1080p video- although I think YouTube caps playback at 720. You can adjust the quality settings in the bottom right, but if you’d like I can cut out some screenshots of things up close. Most of the quality is limited by the quality of your textures and especially the height map; the better they are, the better it looks.

Here is a link to the current documentation, which I’m continuing to work on. Let me know if any section is unclear or needs more explanation.

jbooth, thank you very much for your clarification and video update and the link.
Best of luck to your asset!

Your new shader looks really interesting. A few questions:

  1. The brush painting blending is based on height. Which height information? The one in the alpha channel of the brush texture? Or in the alpha channel of the macro texturing maps?
  2. Is it possible to use in the painting process a B&W bitmap mask UV mapped on the mesh?
  3. Is it possible to import a mesh with vertices already painted and associate the vertex colors with the texture clusters or individual textures?
  4. I`m also curious about the price. :slight_smile:

Good luck with your interesting asset!

  1. Alpha channel of the splat map diffuse. So each terrain texture has an alpha channel, and it’s used to resolve the blend between multiple splat maps.
  2. The vertex painter allows you to project textures onto a mesh, so yes, you could do this. You’d map your texture choice to the color.a value for the first layer (index/255 being the value to use), and UV3.w for the second. UV3.x is the blend between the two layers.
  3. As long as the vertex data is specified in the format above, sure.
  4. Currently $30, but the plan is to raise it after the beta period/more features/etc.

In regards to more features, I’m pretty open to working with people on their needs. Some of the things I’m currently looking at is integration into Amplify’s shader editor, so you can roll whatever shaders you want using the technique, and integrating into some other terrain generation systems that can take advantage of having so many textures available and essentially paint the terrain for you. I also have some other tools that didn’t make the initial release, which allow you to map a color image to texture clusters as a quick pass over the terrain. Some landscape tools will also output a guide image that you can use for this. But for now, I thought it best to get this out and get some feedback from users before I get too far into any of these things…

This looks fantastic.

How hard is this shader to edit?

I have some very specific requirements that I will need to modify your shader to meet:

I currently have my own smooth voxel solution and I have a need to bury the lighting data in the Color.a. I use this data as ambient lighting multiplyer (so underground where there is no light it is 0, above ground it is 1), when rendering my voxel tris I set it in the Color.a. I also need triplanar mapping (I am not setting UVs), AO, metallic, roughness, emission and height. Currently for my triplanar splat shader I have a Texture Scale component that I need to set on a texture by texture basis. The voxelized aspect of this means that in terms of a splat shader I assume I would use Vertex Color rgb to define the current texture index?

I am currently using a solution where I runtime generate a material based on the 3 verts of a given tri and I am getting anywhere between 8-20 drawcalls per chunk (yes ouch), if I can convert this shader to my needs I drop to one draw call per chunk (16x128x16 voxels), this would be a ridiculously huge improvement. I really hope I can use your product, at the very least I definitely need to start looking at texture arrays.

Your asset starts to become more and more interesting. :slight_smile:

  1. Got it.
  2. A video tutorial with a simple plat plane, with enough vertices will really help to understand the workflow, features and the end result you get.
  3. Im not sure I followed this. An .fbx file its not good enough, I suppose. I have to read the docs.
  4. Sounds good.
    Integration with the Amplify Shader Editor sounds like a really good idea!
    Not to mention the image color used as a guidance for the texture clusters. It means I can use 6 sand textures in a texture cluster to map/paint them on a yellow beach area in the UV mapped image color on the mesh?

I don’t think it will be too hard for you- the single layer shader already supports triplanar for the “UV Challenged” among us, as well as a full PBR stack. I may extend the multi-layer shader to support triplanar if there’s enough demand. Each texture can already be scaled individually as I have a system for per-texture properties. So the shader is relatively close to what you want. Right now it uses the color.rgb for special weighting values - basically, each triangle in your model needs to have exactly 1 red, blue, and green colored vertex (ie: no two reds and a blue). That’s what the mesh preprocessor does, but if your constructing your own meshes it should be pretty easy to do that on the fly. color.a is the texture choice for the first layer of splat maps, though it’s trivial to move that to some other channel if you prefer to use color.a for something else.

Is one chunk one voxel, or a 16x128x16 block of voxels? Either way, you should be able to generate your mesh and setup the vertices for whatever texture you want on each vertex and draw the whole thing in one draw call.

An FBX file is fine- you’d just convert it using the tools provided.

You can do that right now- what I’m talking about is using an image to, say, paint the entire terrain at once. So you put yellow in your image, and it finds your six sand textures and randomizes them across the yellow area of the mesh. green = grass, etc.

Nice!. You really have to make a videotut about this feature. You sample a color/pixel in a certain area from the image color using a brush and a tolerance/sensitivity, or you define a color in the color picker? The first option looks more powerful, if you ask me.
Thanks!

No, in the current implementation (which is still being worked on) you either define a color → texture cluster mapping yourself, or it scans through all the textures in the array and averages the color of each one to produce that mapping for you. Then you give it a guide image and it goes through each vert, looks up the color on the guide image, and finds the color closest to this in the configuration and applies a texture from that texture cluster to the vertex.

The real thing I want to explore is gradients for the 2 layer shader; basically, find the two closest texture clusters for each vertex and blend between them based on perceptual color distance.

Interesting, curious to see how it works in practice. Maybe having more than one method it doesn’t hurt, I mean implementing the perceptual method next to the existent one.
Few more questions:

  1. Would it be possible to export a baked texture based on the UV layout of the mesh for all channels (diffuse, normal, etc.)? If yes, which would be the maximum size?
  2. Does the painted vertex need to be visible on the screen? Or it`s a 3D brush and if placed in the volume space of the brush, the vertex, visible or not, gets to be painted,
  3. The final result of the painted process are the vertices being colored. I suppose the textures need to be present in the assets folder. How strict this is? I mean, is it possible to move them in a different location after the painting is done?
  1. I don’t have any plans for baking out textures; it would be pretty easy to do for something like a terrain, but once you get into UVs that potentially overlap it gets complex. I usually use Simplygon for those types of tasks.
  2. No, the brush is a spherical volume.
  3. It’s just an asset in unity, so you can move it around as usual. Unity doesn’t care where things are located; it gives every object a GUID, so the file path is irrelevant.