Category: API Reference


World Space UVs


On this page:


Introduction

World Space UV nodes allow you to share a single texture across you entire world with world-location based mapping for rendering your effects. They provide fast and seamless painting for landscapes, planar surfaces such as walls, floors, etc, but their use can also be extended to things like tagging certain actors or meshes in your world a certain way or even for post processing materials (like the fog-of-war system included with the sample project).

Compared to mesh-space painting, these do not require any special setup on your mesh and perform significantly faster. An advantage they have over local-space painting is the ability to share a single texture across all interested parties – be it meshes, landscape, post-processing materials or any other entity (eg: CPU driven code performing a texture lookup for simulation!).

It is worth noting that world-space UV is planar, meaning you will always lose control of one axis. You need to choose from the axes combinations of XY plane, XZ plane and YZ plane respectively and determine which plane is of most interest to you. For landscapes and most other usecases, XY is usually the right answer.


Initial Setup

World-Space painting requires you to setup your global bounds before you can start using it effectively.

Here’s how you can do that:

  1. Go to View Options, enable “Show Plugin Content” in your Content Browser.
  2. Open MPC_GlobalMeshPainting inside DonMeshPaintingContent/Materials
  3. Set the “World Min” and “World Max” vector parameters to the lower and upper bounds of your (paintable) world. This is significant, because your paint texture will be UV mapped along these bounds. The default values may not be suitable for your map so be sure to configure a suitable value for your world.
  4. If you aren’t sure how to work out the min and max values, just place a dummy sphere at your world’s extremities as a guiding point and use the sphere’s actor location (in the world outliner/details panel) to derive the min and max for your world.

Texture Resolution Setup

Because we’re sharing a single texture across a potentially large world, texture resolution quickly starts to become a factor in determining the visual fidelity of your effects. The default texture resolution used on the World Space render target is 4096×4096.

If you need to modify these, you will need to find the appropriate render target for your World Space node (see below). For example, if you’re using Don_World_Space_XY you’ll need to open the corresponding render target inside DonMeshPaintingContent/Textures/RenderTargets/WorldSpace/RT_Don_WorldSpaceXY_Layer0 and so on. Another technique for finding the right asset is to simply open your UV node (eg: Don_World_Space_XY) and click on the texture sampler inside. The default value for that is the asset whose texture resolution you’ll want to tweak.

Finally, let’s now move on to the nodes themselves:


Don World Space XY

This node facilitates painting along the global XY plane, making it ideal for landscapes, water planes, tagging actors, global effects (fog-of-war systems), etc. If you need additional layers for driving global effects that are independent of each other use the nodes suffixed _Layer1, _Layer2 etc.

For packing RGB channels with individual effects see the Packing RGB channel masks page.

The second set of nodes (Don_Landscape_Paint) are simply an alias for former, they’er functionally equivalent.

R – The red channel of this paint texture

G – The green channel of this paint texture

B – The blue channel of this paint texture

A – The alpha channel of this paint texture. This tells you which parts of the mesh have been painted and which parts haven’t. Gotcha: Because the default paint brush is an Alpha Composite brush, your alpha is inverted! This means the white parts have not been painted while the black parts have. Remember this while blending your effects.

RGBA – A float4 containing all the channels as a single output


Don World Space XZ

This node facilitates painting along the global XZ plane. One possible use for this is side-scrollers or 2D-ish games where the player’s viewport is cenetered around the XZ (/YZ) plane rather than the floor plane.

R – The red channel of this paint texture

G – The green channel of this paint texture

B – The blue channel of this paint texture

A – The alpha channel of this paint texture. This tells you which parts of the mesh have been painted and which parts haven’t. Gotcha: Because the default paint brush is an Alpha Composite brush, your alpha is inverted! This means the white parts have not been painted while the black parts have. Remember this while blending your effects.

XZ Masked Alpha – Similar to the alpha channel, but additionally masks out any pixels that are orthogonal to our plane of interest. This is very important for preventing artifacts from building up along the thickness of your planar mesh.

RGBA – A float4 containing all the channels as a single output

 


Don World Space YZ

This node facilitates painting along the global YZ plane. One possible use for this is side-scrollers or 2D-ish games where the player’s viewport is cenetered around the YZ (/XZ) plane rather than the floor plane.

R – The red channel of this paint texture

G – The green channel of this paint texture

B – The blue channel of this paint texture

A – The alpha channel of this paint texture. This tells you which parts of the mesh have been painted and which parts haven’t. Gotcha: Because the default paint brush is an Alpha Composite brush, your alpha is inverted! This means the white parts have not been painted while the black parts have. Remember this while blending your effects.

RGBA – A float4 containing all the channels as a single output


Local Space UVs


On this page:


Introduction

Local Space UV nodes provide rapid and seamless painting on planar surfaces such as walls, floors, etc. Their use can also be extended to planar effects on non-planar meshes, such as a character’s torso (along its YZ plane), etc. These should be your go-to nodes for creating holes in walls, excavating pits on floors, for graffiti on flat surfaces.

Compared to mesh-space painting, these do not require any special setup on your mesh and perform significantly faster. An advantage they have over world-space painting is better support for dynamic meshes; being local, local-space effects move along with the mesh, which is not true for world-space painting whose effects will need be manually relocated if a dynamic mesh moves.

Local Space painting occurs via location-based / planar mapping. The bounding box of your mesh is used to map the pixels of your mesh along any two axes from the lower extremity of the bounding box to its higher extremity. In other words, a pixel lying closest to a bounding box’s minima along the X axis will be assigned a value close to 0 (for U) while a pixel lying closest to its maxima will be assigned a value of 1. Thus, UVW is calculated in local space.

Because the mapping is planar, you will always lose control of one axis. You can only choose from UV, UW or VW, corresponding to the axes combinations of XY plane, XZ plane and YZ plane respectively. This is the main trade-off you make while choosing a local space node for your effect.

Now let’s take a look a closer look:


Don Local Space XY

This node facilitates painting along the local XY plane, making it ideal for floors and floor-like meshes (or effects).

Along with the regular RGBA information this node contains a special “XY masked alpha” which is used to prevent artifacts from accumulating along the omitted axis (Z in this case). The XY alpha mask is essential for things like painting graffiti because it ensures that your graffiti paint does not accumulate along the Z thickness of your mesh.

R – The red channel of this paint texture

G – The green channel of this paint texture

B – The blue channel of this paint texture

A – The alpha channel of this paint texture. This tells you which parts of the mesh have been painted and which parts haven’t. Gotcha: Because the default paint brush is an Alpha Composite brush, your alpha is inverted! This means the white parts have not been painted while the black parts have. Remember this while blending your effects.

XY Masked Alpha – Similar to the alpha channel, but additionally masks out any pixels that are orthogonal to our plane of interest. This is very important for preventing artifacts from building up along the thickness of your planar mesh.

RGBA – A float4 containing all the channels as a single output

For information on packing multiple effects into R/G/B channels see the Packing RGB channel masks article.


Don Local Space XZ

This node facilitates painting along the local XZ plane, making it ideal for walls and wall-like meshes (or effects). Some walls may be modeled along YZ (in which case you should use the Don Local Space YZ listed below).

Along with the regular RGBA information this node contains a special “XZ masked alpha” which is used to prevent artifacts from accumulating along the omitted axis (Y in this case). The XZ alpha mask is essential for things like painting graffiti on walls because it ensures that your graffiti paint does not accumulate along thickness of your wall.

R – The red channel of this paint texture

G – The green channel of this paint texture

B – The blue channel of this paint texture

A – The alpha channel of this paint texture. This tells you which parts of the mesh have been painted and which parts haven’t. Gotcha: Because the default paint brush is an Alpha Composite brush, your alpha is inverted! This means the white parts have not been painted while the black parts have. Remember this while blending your effects.

XZ Masked Alpha – Similar to the alpha channel, but additionally masks out any pixels that are orthogonal to our plane of interest. This is very important for preventing artifacts from building up along the thickness of your planar mesh.

RGBA – A float4 containing all the channels as a single output

 


Don Local Space YZ

This node facilitates painting along the local YZ plane, making it ideal for certain types of walls and wall-like meshes (or effects). Some walls may be modeled along XZ (in which case you should use the Don Local Space XZ node listed above).

Along with the regular RGBA information this node contains a special “YZ masked alpha” which is used to prevent artifacts from accumulating along the omitted axis (X in this case). The YZ alpha mask is essential for things like painting graffiti on walls because it ensures that your graffiti paint does not accumulate along thickness of your wall.

R – The red channel of this paint texture

G – The green channel of this paint texture

B – The blue channel of this paint texture

A – The alpha channel of this paint texture. This tells you which parts of the mesh have been painted and which parts haven’t. Gotcha: Because the default paint brush is an Alpha Composite brush, your alpha is inverted! This means the white parts have not been painted while the black parts have. Remember this while blending your effects.

YZ Masked Alpha – Similar to the alpha channel, but additionally masks out any pixels that are orthogonal to our plane of interest. This is very important for preventing artifacts from building up along the thickness of your planar mesh.

RGBA – A float4 containing all the channels as a single output


Gameplay & Collision


On this page:


1. Query Paint Collision

Use this node to quickly find out whether the pixels around a world location carry any collision tag of interest, for a given mesh. If a matching collision tag was found, this function returns true, otherwise it returns false.

This allows you to build gameplay systems that react to painted areas. Eg: Pixels carrying damage for A.I. (i.e. traps), behavior cues (eg: telling the A.I. to jump), Portals (for projectiles or characters to pass through), etc. Collision tags are created for pixels at the time of painting effects (see Paint Functions)

For complex gameplay scenarios such as evaluating multiple collision tags with filters/constraints, you should use Query Paint Collision Multi instead.

For Blueprint users:-

  • This node is available in the “Don Mesh Painter” category on your context menu.
  • Expand the dropdown at the bottom of the node to view all parameters

For C++ users:-

  • This function is available in UDonMeshPaintingHelper::QueryPaintCollision
  • #include “DonMeshPaintingHelper.h”

 

Param

Description

Type

Primitive Any primitive (mesh/landscape-component) for which paint collision is to be tested. Typically you will supply this via generic collision events without knowing the exact primitive yourself. UPrimitiveComponent*
Collision Tag The collision tag to look for. Remember to use exactly the same collision tag you passed into the system earlier in the Paint Stroke node!  FName
World Location The world location on this primitive where collision is to be tested.  FVector
Minimum Paint Blob Size This is the minimum blob/collision size this query needs to succeed. Eg: An A.I. may query for a Portal of a certain minimum size to ensure it can believably pass through.  float
 Collision Inflation Scale Scales the size of the painted collision used for evaluating this query. Typically the correct place to do this is while painting the stroke itself as you have more context of the overall effect there.  float
 Collision Inflation In Absolute Units Collision Safety Net. Inflates the painted collision in world-space units. Very useful for projectiles, etc that need additional margin for believable collision effects. float

 


2. Query Paint Collision Multi

Execute complex collision queries across multiple collision tags with support for filters, bucketing of duplicate collision tags by distance brackets and more. Returns true if any matching collision was found, along with the first collision query that successfully matched your collision criteria.

This allows you to orchestrate complex gameplay scenarios such as allowing A.I. to react differently to painted areas depending on their size/etc. The best example for this is the sample project’s “Character Interaction – Floor Pit” (Item 3 in Paint Collisions) where players are allowed to dig holes of different sizes on a wooden floor and the A.I. responds to small holes by jumping over them and to large holes by simply falling into the pit.

This is achieved by creating multiple queries for the same collision tag that each specify different minimum collision blob sizes that they’re interested in.

Here’s what the node looks like:

And here’s what the collision tag query structure looks like:

For Blueprint users:-

  • This node is available in the “Don Mesh Painter” category on your context menu.
  • Expand the dropdown at the bottom of the node to view all parameters

For C++ users:-

  • This function is available in UDonMeshPaintingHelper::PaintStrokeAtComponent
  • #include “DonMeshPaintingHelper.h”

 

Param

Description

Type

Primitive Any primitive (mesh/landscape-component) for which paint collision is to be tested. Typically you will supply this via generic collision events without knowing the exact primitive yourself.  UPrimitiveComponent*
Collision Tags List of Don Paint Collision Queries. Each query has configurable collision filters in it. You can create multiple queries for the same collision tag! The sample project uses this technique to make A.I bots jump across small-sized holes and fall into large-sized ones.
[Blueprint tip] drag a wire from this parameter, type “Make Array”, and then “Make DonPaintCollisionQuery” to rapidly setup your queries.
FDonPaintCollisionQuery
Out Collision Tag The first matching collision query that succeeded. Use this to drive gameplay decisions by testing which collision tag succeeded, and also which specific filters it passed with. FDonPaintCollisionQuery
World Location The world location on this primitive where collision is to be tested.  FVector

 


Text Functions


On this page:


1. Paint Text

Paint text from UMG/Slate onto a mesh or landscape using a Hit result as input. Use this to stamp text guided by collision impacts, player interaction, etc. If you already know exactly where to stamp the text beforehand (Eg: Shirt names/numbers) use Paint Text At Component instead.

Only materials which have a Don UV node for the specified paint layer are eligible to receive the effect. Conversely, if you have a master material which is setup to receive paint(/text), but want one of your child materials to be excluded, check out the Disabling Paint Layers On Material Instances page.

For Blueprint users:-

  • This node is available in the “Don Mesh Painter” category on your context menu.
  • Expand the dropdown at the bottom of the node to view all parameters

For C++ users:-

  • This function is available in UDonMeshPaintingHelper::PaintText
  • #include “DonMeshPaintingHelper.h”

 

Param

Description

Type

Hit Any Hit Result from collision impacts, mouse/cursor hits (projected to world) or any other source.  FHitResult
Text The text to paint. Can be obtained from UMG, Slate or even constructed inline in a Blueprint (LiteralText) or C++ (NSLOCTEXT),  FText
Style Use this to set your Font, Font Size and other text properties. FDonPaintableTextStyle
Color The color of your text. Typically you will just want to use this as a _mask_ and drive your actual text color inside the material.

Note:- Alpha channel does not contain any information/mask for text because of the way it is rendered.

 FLinearColor
Rotation The rotation of your text projection. If you’re using a Mesh UV workflow (characters/etc), then the UV Islands of your UV map will influence the actual rotation. int32
 Paint Layer The paint layer onto which text is to be projected. Each paint layer is a separate texture.

Typically each text needs a dedicated layer as text-material-render doesn’t support alphas.

 int32

 


 

2. Paint Text At Component

While Paint Text requires you to supply a Hit Result, there are times when you already know exactly what component/socket to target for stamping your text. Use Paint Text At Component for that.

Typical example is stamping shirt names or shirt numbers for characters; because the location of the shirt name/number is (typically) fixed, you can use this function and pass in a target socket directly.


For Blueprint users:-

  • This node is available in the “Don Mesh Painter” category on your context menu.
  • Expand the dropdown at the bottom of the node to view all parameters

For C++ users:-

  • This function is available in UDonMeshPaintingHelper::PaintTextAtComponent
  • #include “DonMeshPaintingHelper.h”

 

Param

Description

Type

Primitive Component The primitive onto which you desire to paint an effect. Typically a skeletal mesh or a static mesh.  UPrimitiveComponent*
Relative Location The _relative_ location on your mesh for this paint stroke. Ignored if SocketName is also set. Hint:- This is a relative space, not world space location. FVector
Text The text to paint. Can be obtained from UMG, Slate or even constructed inline in a Blueprint (LiteralText) or C++ (NSLOCTEXT),  FText
Style Use this to set your Font, Font Size and other text properties. FDonPaintableTextStyle
Socket Name Specify a socket instead of relative location. Convenient for targeting specific limbs or body parts directly.

Note:- Socket must be accurately placed at the desired part of your mesh for the effect to be rendered precisely.

FName
Color The color of your text. Typically you will just want to use this as a _mask_ and drive your actual text color inside the material.

Note:- Alpha channel does not contain any information/mask for text because of the way it is rendered.

 FLinearColor
Rotation The rotation of your text projection. If you’re using a Mesh UV workflow (characters/etc), then the UV Islands of your UV map will influence the actual rotation. int32
 Paint Layer The paint layer onto which text is to be projected. Each paint layer is a separate texture.

Typically each text needs a dedicated layer as text-material-render doesn’t support alphas.

 int32

Mesh Space UVs


On this page:


Introduction

Mesh-Space UV nodes allow full 3D painting by using the UV map(s) of your mesh to project your paint strokes onto a texture. Depending your usecase you may require a lightmap UV on UV1 (see Preparing your mesh for painting) or you may be able to leverage the “fast-path” via Collision UV support along UV0 (static meshes only).

In addition to the base layer, additional nodes suffixed _Layer1 and _Layer2 are available for orchestrating multiple effects that are independent of each other.

Let’s take a look at the available nodes:


Don Mesh Paint UV1

As UV1 in the name indicates, this node requires a lightmap UV on your mesh’s UV1 channel. Seamless painting is supported by this node (for procedural brushes, not for decals). Typically, skeletal meshes will exclusively use this node while static meshes have the option of using Don Mesh Paint UV0 as an optimization (see below).

The Layer1 and Layer2 variants of this node allow you to paint effects on separate layer channels that are fully independent of each other. Each layer will cost you a separate texture though.

R – The red channel of this paint texture

G – The green channel of this paint texture

B – The blue channel of this paint texture

A – The alpha channel of this paint texture. This tells you which parts of the mesh have been painted and which parts haven’t. Gotcha: Because the default paint brush is an Alpha Composite brush, your alpha is inverted! This means the white parts have not been painted while the black parts have. Remember this while blending your effects.

RGBA – A float4 containing all the channels as a single output

For information on packing multiple effects into R/G/B channels see the Packing RGB channel masks article.


Don Mesh Paint UV0

As indicated by UV0, this node uses the default UV channel of your mesh to drive painting. This node requires Collision UV support in your project to be enabled – i.e.  “Support UV From Hit Results” (under Project->Physics Settings) and also requires “Trace Complex” to be true (on your Linetrace/sweep).

While it does not support seamless painting or painting on skeletal meshes, it is a valuable part of your toolkit because the performance of this workflow is several times higher compared to a lightmap UV1 workflow, for meshes that need 3D paint projection. As always, for planar meshes or for effects that can be approximated along a plane, the world-space and local-space painting nodes should still be your first port of call.

R – The red channel of this paint texture

G – The green channel of this paint texture

B – The blue channel of this paint texture

A – The alpha channel of this paint texture. This tells you which parts of the mesh have been painted and which parts haven’t. Gotcha: Because the default paint brush is an Alpha Composite brush, your alpha is inverted! This means the white parts have not been painted while the black parts have. Remember this while blending your effects.

RGBA – A float4 containing all the channels as a single output

 


Paint Functions


On this page:


1. Paint Stroke

For most users, this is the only node you’ll ever need.

Simply pass in a HitResult from your gampeplay or player interaction and this will render an effect for your Hit Location.

To actually receive the effect inside your materials, you’ll need to use one of the material functions provided by the plugin (see Choosing the right UV workflow for your Mesh).

Depending on which material function you choose, your stroke may be rendered onto a single texture (shared world space painting) or onto a unique texture for each mesh in your actor (mesh space / local space painting).

For Blueprint users:-

  • This node is available in the “Don Mesh Painter” category on your context menu.
  • Expand the dropdown at the bottom of the node to view all parameters

For C++ users:-

  • This function is available in UDonMeshPaintingHelper::PaintStroke
  • #include “DonMeshPaintingHelper.h”

 

Param

Description

Type

Hit Any Hit Result from collision impacts, mouse/cursor hits (projected to world) or any other source.  FHitResult
Brush Size The radius of your paint stroke measured in World Space units.
The actual brush size rendered is UV Island dependent in some secnarios such as decal/text projection in a mesh-space UV workflow.
 float
Brush Color  The color of your brush stroke.  FLinearColor
Brush Decal Texture Optional Decal. The decal texture is expected to have the decal in RGB and the decal mask in its Alpha channel.

Both can be used inside your material for specific effects. 

 UTexture2D*
Paint Layer Paint Layers are used to drive multiple effects that are independent of each other. Each paint layer is a unique texture onto which a single effect may be painted as RGB with an Alpha mask (or even multiple effects with individual R, G, B channel masks). A primitive can accommodate multiple paint layers for each material that are all independent of each other.  int32
Collision Tag  Use this to encode your paint stroke with a special collision tag that you can read back later to drive gameplay decisions, custom collisions, etc
You will need to pass the same value back to the QueryPaintCollision (url) node to check whether a particular location has been painted/tagged.
FName
Brush Opacity  The opacity of your paint stroke  float
Brush Hardness The hardness of your paint stroke, 0 = Soft, 1 = Hard  float
Brush Decal Rotation The rotation of the decal projected onto your mesh. For Mesh UV workflows rotation of your UV Island may influence actual rotation.  int32
Brush Render Material Defaults to “M_PaintBrush_Regular” which is an AlphaComposite brush meaning the RGB contains your paint/decal while the Alpha accumulates your paint mask & opacity. If you’re looking to pack R, G, B channel mask effects, just set this to the “M_PaintBrush_Regular_Additive” material provided in this plugin’s Content folder.

Most users will not need to create their own render brush, but you can do so if desired.

 UMaterialInterface*
Allow Duplicate Strokes Important for Decals, Gameplay effects, etc! By default the plugin allows you to keep accumulating or overwriting paint strokes on a single region.  Sometimes, however it is desirable to prevent players from being able to repeat a stroke on a location that has already been painted. Set this to false to achieve that. Eg: Painted Gameplay Items (like traps), Portal effects (eg: Exploding floors that leave holes behind them), Character Decal Tattoos that should only appear once, etc.  bool
Collision Inflation Scale Scales the paint collision associated with this stroke. Useful for Masked materials where your material’s “Opacity Mask Clip” affects perceived collision. As many collidable effects like Portals tend to use soft brushes or low opacity clip masks (to allow for crater WPO effects, etc to be visible…), the size of the observed hole/collision perceived by the player is potentially _smaller_ the actual brush size (collision size) at which you painted the portal!  float

 


2. Paint Stroke At Component

While Paint Stroke requires you to supply a Hit Result, there are times when you already know exactly what component to target and just want to apply an effect at a pre-determined location. Use Paint Stroke At Component for that.

This is great for orchestrating effects; Eg: when a character walks over a Lava trap you can splash the character’s legs with Lava (the sample project has this very example in it!)

For Blueprint users:-

  • This node is available in the “Don Mesh Painter” category on your context menu.
  • Expand the dropdown at the bottom of the node to view all parameters

For C++ users:-

  • This function is available in UDonMeshPaintingHelper::PaintStrokeAtComponent
  • #include “DonMeshPaintingHelper.h”

 

Param

Description

Type

Primitive Component The primitive onto which you desire to paint an effect. Typically a skeletal mesh or a static mesh.

For direct landscape painting the “Paint World Direct” node is recommended for ease of use.

 UPrimitiveComponent*
Relative Location The _relative_ location on your mesh for this paint stroke. Ignored if SocketName is also set. Hint:- This is a relative space, not world space location. FVector
Socket Name Specify a socket instead of relative location. Convenient for targeting specific limbs or body parts directly.

Note:- Socket must be accurately placed at the desired part of your mesh for the effect to be rendered precisely.

FName
Brush Size The radius of your paint stroke measured in World Space units.
The actual brush size rendered is UV Island dependent in some secnarios such as decal/text projection in a mesh-space UV workflow.
 float
Brush Color  The color of your brush stroke.  FLinearColor
Brush Decal Texture Optional Decal. The decal texture is expected to have the decal in RGB and the decal mask in its Alpha channel.

Both can be used inside your material for specific effects.

 UTexture2D*
Paint Layer Paint Layers are used to drive multiple effects that are independent of each other. Each paint layer is a unique texture onto which a single effect may be painted as RGB with an Alpha mask (or even multiple effects with individual R, G, B channel masks). A primitive can accommodate multiple paint layers for each material that are all independent of each other.  int32
Collision Tag  Use this to encode your paint stroke with a special collision tag that you can read back later to drive gameplay decisions, custom collisions, etc
You will need to pass the same value back to the QueryPaintCollision (url) node to check whether a particular location has been painted/tagged.
FName
Brush Opacity  The opacity of your paint stroke  float
Brush Hardness The hardness of your paint stroke, 0 = Soft, 1 = Hard  float
Brush Decal Rotation The rotation of the decal projected onto your mesh. For Mesh UV workflows rotation of your UV Island may influence actual rotation.  int32
Brush Render Material Defaults to “M_PaintBrush_Regular” which is an AlphaComposite brush meaning the RGB contains your paint/decal while the Alpha accumulates your paint mask & opacity. If you’re looking to pack R, G, B channel mask effects, just set this to the “M_PaintBrush_Regular_Additive” material provided in this plugin’s Content folder.

Most users will not need to create their own render brush, but you can do so if desired.

 UMaterialInterface*
Allow Duplicate Strokes Important for Decals, Gameplay effects, etc! By default the plugin allows you to keep accumulating or overwriting paint strokes on a single region.  Sometimes, however it is desirable to prevent players from being able to repeat a stroke on a location that has already been painted. Set this to false to achieve that. Eg: Painted Gameplay Items (like traps), Portal effects (eg: Exploding floors that leave holes behind them), Character Decal Tattoos that should only appear once, etc.  bool
Collision Inflation Scale Scales the paint collision associated with this stroke. Useful for Masked materials where your material’s “Opacity Mask Clip” affects perceived collision. As many collidable effects like Portals tend to use soft brushes or low opacity clip masks (to allow for crater WPO effects, etc to be visible…), the size of the observed hole/collision perceived by the player is potentially _smaller_ the actual brush size (collision size) at which you painted the portal!  float
Draw Debug Location Useful for visualizing exactly where the system is attempting to add paint. Use this for debugging your socket / relative location accuracy.  bool

 

 


3. Paint World Direct

Context-free world-space painting along any two axes. This node paints a shared world-space texture along XY or XZ or YZ directly, without the need to specify an actor or primitive as a context.

Typically used for driving Global Effects like Fog-Of-War systems. Can also be used for direct landscape painting if you’re trying to orchestrate a predetermined effect and just need a quick way to paint a world-space aligned texture.

For Blueprint users:-

  • This node is available in the “Don Mesh Painter” category on your context menu.
  • Expand the dropdown at the bottom of the node to view all parameters

For C++ users:-

  • This function is available in UDonMeshPaintingHelper::PaintWorldDirect
  • #include “DonMeshPaintingHelper.h”

 

Param

Description

Type

World Location The world location onto which paint is to be accumulated (and potentially used by several interested actors/effect-systems/materials). FVector
World Axes WorldAxes – Choose from XY or XZ or YZ axes for accumulating paint. Because this is planar mapping, you only control two axes; Eg: Painting on XY you lose control over Z axis, i.e. world height.  EDonUvAxes
Brush Size The radius of your paint stroke measured in World Space units.
The actual brush size rendered is UV Island dependent in some secnarios such as decal/text projection in a mesh-space UV workflow.
 float
Brush Color  The color of your brush stroke.  FLinearColor
Brush Decal Texture Optional Decal. The decal texture is expected to have the decal in RGB and the decal mask in its Alpha channel.

Both can be used inside your material for specific effects.

 UTexture2D*
Paint Layer Paint Layers are used to drive multiple effects that are independent of each other. Each paint layer is a unique texture onto which a single effect may be painted as RGB with an Alpha mask (or even multiple effects with individual R, G, B channel masks). A primitive can accommodate multiple paint layers for each material that are all independent of each other.  int32
Collision Tag  Use this to encode your paint stroke with a special collision tag that you can read back later to drive gameplay decisions, custom collisions, etc
You will need to pass the same value back to the QueryPaintCollision (url) node to check whether a particular location has been painted/tagged.
FName
Brush Opacity  The opacity of your paint stroke  float
Brush Hardness The hardness of your paint stroke, 0 = Soft, 1 = Hard  float
Brush Decal Rotation The rotation of the decal projected onto your mesh. For Mesh UV workflows rotation of your UV Island may influence actual rotation.  int32
Brush Render Material Defaults to “M_PaintBrush_Regular” which is an AlphaComposite brush meaning the RGB contains your paint/decal while the Alpha accumulates your paint mask & opacity. If you’re looking to pack R, G, B channel mask effects, just set this to the “M_PaintBrush_Regular_Additive” material provided in this plugin’s Content folder.

Most users will not need to create their own render brush, but you can do so if desired.

 UMaterialInterface*
Allow Duplicate Strokes Important for Decals, Gameplay effects, etc! By default the plugin allows you to keep accumulating or overwriting paint strokes on a single region.  Sometimes, however it is desirable to prevent players from being able to repeat a stroke on a location that has already been painted. Set this to false to achieve that. Eg: Painted Gameplay Items (like traps), Portal effects (eg: Exploding floors that leave holes behind them), Character Decal Tattoos that should only appear once, etc.  bool
Collision Inflation Scale Scales the paint collision associated with this stroke. Useful for Masked materials where your material’s “Opacity Mask Clip” affects perceived collision. As many collidable effects like Portals tend to use soft brushes or low opacity clip masks (to allow for crater WPO effects, etc to be visible…), the size of the observed hole/collision perceived by the player is potentially _smaller_ the actual brush size (collision size) at which you painted the portal!  float
Perform Network Replication Special option to support things like FoW systems where each _local_ player needs a different/unique perspective and therefore, a non-replicating paint FX.  bool