Documentation - Editing Blendmap


What is a blendmap?  
A blendmap allows you to combine textures by overlapping them with a paint-able brush. This lets you create seamless environments where grass meets mud, or where gravel meets rock. Using this technique in a map can add a more natural feel to an environment. It can be used to add more variation to existing textures. The blendmap is stored within the map file itself. The following will explain how to add a blendmap to your map. Blendmap

Texture Layers

The first thing to do is create a layered texture. Within the editor, find the texture slot of a texture (can be viewed at the top left of the texture browser, starting with #) and apply this number to another texture using the vlayer command.

/vlayer 123


If done correctly, the texture preview should show the layered texture at the upper right corner of the thumbnail.

Advanced Method

You can also add texture layers manually with the texlayer attribute within a map configuration file:

setshader bumpspecmapworld
setshaderparam specscale 0.500000 0.500000 0.500000 0.000000
texture 0 "philipk/pk02/sand01_c.png"
texture n "philipk/pk02/sand01_n.png"
texture s "philipk/pk02/sand01_s.png"
texscale 0.5
texlayer 249


Now that we have a layered texture, we are ready to start painting. Enable the blendbrush by pressing [P]. You can press [P] several times for different methods of applying the brush, such as erasing the blendmap or merging the blendmap.

Brush modes:

Using the brush  
Now that we have a layered texture, we can draw with our brush onto the blendmap. Simply click on the texture with the brush painting mode activated. Choosing “blend mode: merge” will allow you to paint the layered texture on top of the base texture. Blendmap

To exit the blendmap painting mode, press P until you see “blend mode: off” in the console.

If you can’t see your blendbrush having any effect, try to first fix the existing blendmap by running either/showblendmap or /calclight.

Take note that when you modify cube geometry, the appearance of the blendmap will look broken. This can be easily fixed by re-running either of the above commands.

Clearing the blendmap

The blendmap can be removed/reset with:


Adding custom brushes

A blendbrush can easily be created with any greyscale image. The darker parts are drawn more densely than lighter parts.

Where do i place them?  
The default brushes are stored in data/blendbrush. To add custom brushes, you will want to add them to blendbrush/ in your user data directory. Blendmap

Dumping the blendmap

You can dump a greyscale image of the blendmap information to your user data. This can be used to quickly visualise which areas of your map have yet to be painted. The painted areas of the blendmap are represented by black pixels.


Additional tips