Aug
26
2013

Mesh Terrain Texturing/SplatMap Tool (wip)

mesh_splatmap_editor_plugin_unity_1

Small editor plugin for creating splatmap/splatmask for mesh based terrain. (not terrain object)

Current features:
– Create splatmap based on face angles (adjustable slope angles)
– Texture painting (paint to any layer R, G, B, A)
– Obstacle detection (if collider is founded on mesh, different material is splatted around it, with custom radius. See main image, different texture around objects)
– Custom shader (4 textures, splatmask RGBA)
– Splatmap can be any resolution (low resolution works quite nicely too, if blurred)
– Gaussion blur function (adjustable strength)
– Basic random instantiate to mesh surface (pick prefab, enter amount)
– Texture paint: with custom brush (any texture)
– Texture paint: Circle brush, size, strength (alpha)
– Live preview (lower resolution) when adjusting splatmask generation angles
– Esc key to stop painting mode
– Collision mask: Enable/Disable checking, Layer dropdown for collision objects layer selection
– Extras: Plain color shader (instead of textures)

CURRENT BUG / TODO LIST:
– Mask texture is not saved when texture painting on it
– Mask texture gets cleared from the shader if you enter Play mode (need to manually assign it to SplatMask – slot)
– Doesnt work with non-square mesh (Can be fixed with couple lines)
– Doesnt work with hills over 200m (Can be fixed with couple lines)
– Playmode clears values..
– Mousepanning gets stuck if in texture paint mode (have to press play/stop)
– Missing editor undo support
– Custom brush resize (currently texture size is used directly)
– Could have bake to vertex colors and vertex color mask shader
– If terrain is over 65k vertices and gets splitted, problems..
– Needs cancellable progress bars for various actions..
– Separate user texture painting/drawings texture (so it wont get cleared when splatmask is re-generated)
– Add normal maps support for shaders
More to be added..

TODO:
– User could select which layer is used for object collider checking
– Extra custom layer mask (so that user painted splats wont disappear if splatmap is regenerated)
– Realtime previews for adjusting mesh slope angles
– Gaussian blur for invidual channels?
– Could bake ambient occlusion also? Or some lighting stuff?
– Extra channels on shader? 4 materials is not enough?
– Needs some height adjustment also (mountain tops different material?)

If this works, will try to put it in store later.. Let me know if you have request/ideas for features.

See also Grass maker (wip)

 

Images, from work in progress:
mesh_splat_map_generator_unity_original_mesh

mesh_splat_map_generator_unity_wip1

mesh_splat_map_generator_unity_wip2

mesh_splat_map_generator_unity_shader_problem1

mesh_splat_map_generator_unity_shader_problem_fixed1

mesh_splat_map_generator_unity_automatic_obstacle_mask

mesh_splat_map_generator_unity_wip3_gaussian_blur

mesh_splat_map_generator_unity_wip3

— 2014 —

Current inspector features:
mesh_splatmap_tool_unity_2014_a

Testing shader with 4 textures 4 normals:
mesh_splatmap_tool_shader_normals_1


17 Comments + Add Comment

Leave a comment

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch Instagram

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.