Texture and Splat Map painting in-game for Godot Engine (also World Vector3 to UV mapping).
- Tutorial and details: https://alfredbaudisch.com/blog/gamedev/godot-engine/godot-engine-in-game-splat-map-texture-painting-dirt-removal-effect/
- Play instructions: you can walk in the world with WASD and to paint click and drag with the left mouse button
GodotRuntimeTexturePainting.mp4
Resulted splat map from the video above:
- Actual painting something in game
- Terrain and mesh deformation
- Anything else you can imagine by blending textures. Because it's just a matter of interpolating the painted textures with anything else with shaders (sample shader included here).
- World Vector3 to UV mapping methods
- Any kind of brush
- Multiple brushes
- Multiple splat maps and multiple textures blended
- Mesh can be anywhere in the world and can be rotated
My other implementation uses Vertex Painting in order to get the alpha value of texture interpolations. It's simpler, but less flexible and can produce rough results:
- The World Vector3 to UV code is heavily adapted from this Godot 2 repository from 2017 by Daniel Byron. I also got the Barycentric calculation function from Arnklit’s Waterways Godot Plugin.
- Other than that, it's all implemented by me.
You can support the development of my open-source contributions and this project on Patreon, a PayPal donation or buy me a coffee with Ko-fi. Or of course, you can get my Godot UI Masterclass Course and learn how to make data-driven and responsive user interfaces with Godot from scratch (the final result is open-source).
- Mike King
For news and more code and art experiments and prototypes:
- Follow me on Twitter 🐦
- Subscribe to my YouTube channel 📺
- Subscribe to my RSS feed
- Bookmark my website
- Or check all of my links to find your preferrable channel