Realtime splatting optimisation
Par Alewinn le samedi 17 octobre 2009, - Technique - Lien permanent
This process shows How to use RGB information from an image to blend several textures together to textures big objects, like terrains, by example. We added the possibility to paint and/or calculate ambiant occlusion, Shadows, and the possibility to paint light effects directely on the model.

Theory :
Realtime rendering performances are conditioned by the textures memory footprint and the number of parallel operation performed by the graphic card. If the textures memory footprint of a scene (textures of the landscapes, characters or objects) is small enought, these data fits all in the graphical card memory, this way the realtime rendering is sufficiently fast. However, if the textures footprint of the scene goes over the graphical card capacity, textures must go from the central memory of the computer to the graphical card. This can slow down the rendering.
The number of materials and shaders used in the scene increases the processing of the scene ; lighting processing must be done for every material, according of its properties (Specularity, Alpha transparancy, Shadows, normal map, or any special process like CG shaders programmed in the graphic card...). So it's better to use a limited number of materials to avoid framerate drops.
To ease the processing and the memory footprint we can share the same textures and materials on nodal materials. We can share some processing across materials too, without losing visual quality too much. We will use for that the hability of blender to make a data specific for an object., or to genericise data across multiple objects.
This way we will create a generic process that allow us to :
- Alpha blend colors of textures (Splatting)
- Memorise ambiant occlusion
- paint light effects (glow)
![]() |
Establishing the process :
1- Unwrap UV :
To work correctly this process need abject with an Unwraped uv. Unwraped uv from an orthogonal view works perfectly as it have been thought for terrains shading (Select the object and edit it "TAB" , "7" to go in top view, menu "Mesh > UV Unwrap > Project from view (Bounds)" ). But this process can work with uv unwraped in another way, as simply we didn't tryed.
2- Textures and materials creation
A collection of 3 textures plus one "simple" (non-nodal) material are use in this example. It is absolutly possible to use 4 materials, or 4 textures, or 2 materials and 2 textures, and so on... Changes to that will have to be only in the "Texture Pack" node (see later).
Genericising non-nodal materials into a group in an other file can be a good advise, as we've done in the realtime multi-texturing method. This way materials are easily re-usable in a complex scene.
In this sample we will use these textures and material :
![]() |
![]() |
![]() |
![]() |
3- Establishing the nodes :
Give a nodal material to the object or the terrain. Then go to the node editor.
We are going to use default blender nodes to create a set of "evolved" nodes (we call evolved nodes some blender nodes that have been grouped together !) that we will connect together to generate the model shading. This shading wil be easily re-used by other models, sharing some ressources and having other specific data.
Before we begin to build the nodes, just a little precision on the ressources and data sharing inside a .Blend file. There is sometimes a little number into a button at the right side of the name of data ressources (materials, textures, nodes, etc...) into the Blender UI. These numbers showing the number of objects/entities that are sharing this data.
This numbers are like this :
![]() |
When a data is shared across several objects (there is a number >1 at the side of the name) we say that thiis data (ressource) is generic. In contrast when ther is no number, or if the number is "1" in the button, the data is unique, or specific.
![]() |
Generic data (shared across 12 objects) |
or ![]() |
Specific data |
By default blender create generic data when we duplicate an object, or when we use grouped objects. This default value can be changed in the option pannel of blender.
Well.. Err.. So what ? Would you say...
Concretely, when we modifie a generic data (...shared across multiple objects) then we modify it for ALL THE OBJECTS USING IT. Genericising a data can be see as a pooling of system ressources, as the data is in one and only place in memory.
But if we need variations of a generic data for an object without changing the other, then we need to change the data to a specific one ; select the object and click on the button with the number inside.
Pooling our generic data for fast processing is a way to minimising memory footprint.
Now that we know the difference between a generic data and a specific data, it's time to build our nodes. It will at the end look like this :
![]() |
Each of these nodes are in fact node groups using masks to paint things on the model.
The generic node "Texture Pack" encloses 4 nodes (textures or materials or both) that will serve to alpha blend textures together.
![]() |
It's possible to use materials instead of textures nodes. That said, realtime rendering performances with multiple lights might be low with a big number of objects...
The next node group "Splat and shadows method" is the more complex because it contains two methods ; one for splatting, and the other for shadows :
![]() |
The two masks (Splat Mask and ambiance occlusion Mask) are directly used in blender to:
- Texture paint (Splat Mask) to paint textures on the object ; Black and RGB channels will designate a texture or a material
- Ambiant occlusion Backing and shadow backing (Shadow and ambiant occlusion). Theorically it may take 2 successives backings on the same texture (one for shadow and the other for AO) or compositing the final texture with two bakes inside Gimp or Photoshop (I didn't have time to try, but it should work).
Then here is the "Lighting method" node, very simple :
![]() |
Then the last big piece, the node that enable glow, splatting and shadow fusion, and ennable us to give a light diretion and intensity (Light direction node) :
![]() |
It's enought for the nodes ! Yes!
Utilisation :
Now we just have to ... use this as a tool !
It's in fact extremely simple : you must get one of the three masks (Splat, shadow or glow) directely in the image editor and then paint directelu on the object in the "texture paint" mode.
- "Tab" to get the object in edition mode
- "a" to select all the geometry of the object
- In the "image editor" window, select the working mask (Splat, shadow or glow)
- Go to texture paint mode
- Get out of the edition mode and paint directely on the model
For this example, we generated the following masks :
![]() |
Splat Mask |
![]() |
Shadow Mask |
![]() |
Glow Mask |
Final object :
![]() |
|
====> Blend File : Splatting.rar <====
|







or 








