VPaint: Advanced Vertex Painting [Released]


Announcing the release of VPaint: Advanced Vertex Painting for Unity3d! VPaint is a mesh painting tool that will help give an extra bang to your 3d models. Applying local variation to your object, like color modulation, detail texture, or flowing maps, is quick, easy, and nondestructive.

VPaint includes:

- Fast, robust painting tools
- Photoshop-style layers and blend modes
- Adjust and preview layers individually
- Nondestructive - VPaint retains original mesh instances
- Automatic blending between objects
- Import lightmaps and texture into vertex colors
- Create color sets to animate or swap sets during runtime
- Shader library to allow you to utilize vertex colors for your project
- Comes with a demo scene that shows off different uses of VPaint
- Per-vertex ambient occlusion baking
- PDF Manual describing the usage of the above features

Unity supports vertex colors on meshes, but there are no built-in tools to access or modify them. Vertex colors are a great way to get more out of rendering your objects by adding per-object diversity in color and texture. Shader technology like texture blending, flow maps, vertex-based transparency, and much more all use vertex colors as their underlying technology. Now, with VPaint, you can easily manage the vertex colors of any mesh - without losing its original reference!

VPaint has been battle tested with our internal title and polished for broad use. It has a slick interface and a large set of layer adjustments, blending, and import tools. VPaint is fully functional in both the free and pro version, and it is supported for Unity 3.5 and 4.x.

Layers, Blend Modes, and Painting

Directional Object Blending

Texture Blending

Layer Adjustments

Clean, User-friendly interface

Previewing Color Channels

Per-Vertex Ambient Occlusion

VPaint v1.4 is available now on the asset store for $40

Manual.pdf

NEW: Introduction to VPaint and Ambient Occlusion baking:

VPaint will continue to be supported, please post any feedback you have here!

2 Likes

Cool man!

@imaginaryhuman thanks!

The video above isn’t the best demonstration of the tool, so here’s a little gif quickly running through some of the features.

Layers, Blend Modes, and Painting

1 Like

Another gif showing how easy it is to blend objects together with the click of a button.

Directional Object Blending

nice! how does this handle performance wise?

and how many textures can be blended at one time?

VPaint has been heavily optimized, so painting in the editor super smooth. With a high number of objects in one group VPaint can start to slow down, but your objects can be very easily be broken into groups to alleviate this. For a benchmark, modest rig was able to paint on a group with about 1,200 objects before it started to slow down. This might vary based on the vert count of the objects, but in general performance was a huge factor when developing this.

As for runtime performance, after the initial load time the vertex colors have little to no impact. Loading the colors does take a moment, as it needs to instance all your mesh data, but paint groups a setting for when to apply the vertex colors so that it can be done at the most convenient time.

awesome! is there a number of textures for blending limit?

Presumably 3 or 4 since vertex colors only have RGBA components?

They mentioned it worked like photoshop layers though. So hopefully it is a large number? I thought you could have more than 4 on PC and that only mobile was limited to 4? -I am thinking of terrain painting though, but still.

Like imaginaryhuman said, it only supports a max of 4 texture blends (or less, depending on the complexity of the shaders you’re using). That might be a point of confusion, but let me clarify: it works like photoshop layers, but with vertices rather than pixels. This doesn’t mean you can layer textures on your models like in photoshop - standard shader restrictions still apply - but rather that you can manage and modify your vertex colors in a more user friendly way. In the end, your final vertex colors are still output to just RGBA channels.

Here’s a gif showing what I mean. Notice in the upper left corner, the channel masks are swapped from RG to BA when painting the second texture.

Texture Blending

Ah, ok. So can you paint regular vertex colors on top of those 3-4 textures? Or do those count as textures themselves?

It really depends on the shader you’re using. The end result of this tool is filling up your mesh’s vertex color channels, which will have a different result depending on which shader is applied to the object. For example, VPaint includes a VertexColor-Unlit shader which just straight up renders your vertex colors on the object, or there is a VertexColor-Diffuse which will multiply your vertex colors by the diffuse texture. The blend shaders included use the individual channels as the “blend value”, which means that those channels are no longer useful for rendering colors.

There are probably some creative solutions out there for ways to paint both detail colors as well as blending textures, but that’s all up to the author of the shader.

Like Beck said, you’ll max out on 4 blends based on vertex colors(this is a universal limitation, nothing to do with the tool) but there’s no reason you couldn’t have a shader that also blended multiple textures per color using a texture map for the interpolation. So in the end you would only be able to paint 4 different types of materials but each material can consist of whatever you can fit into the shader.

You could also have a shader that for instance blended organic materials with vertex colors and had an extra slot for a texture that would blend in roads and things like that.

I think your tool is interesting but I notice that vertex colors are gauraud shaded, meaning linearly interpolated. I was wondering if there’d be a way to interpolate colors non-linearly so that the vertices have a more rounded coloring - right now the edges of triangles tend to look a bit angular because of this… would be cool to have a smoother looking gradient… but I gave this some thought and I don’t really see a way to do it because the fragment shader only ever knows about the interpolated color passed into it, and you’d have to pass per-vertex 3 sets of colors + some kind of uv coords in order to figure out how to blend them differently. Can be done but it wouldn’t be a vertex-color shader.

Yeah that is definitely one downside to vertex colors in general, or at least a limiting factor. Overall vertex colors work best when they meet a middle ground with texture samples. Just straight up vertex colors always have that jaggy polygonal feel, but textures can feel repeated when you’re limited on texture memory. So ultimately I think the best approach is to use textures for finer details and then vertex colors for broader variation, and not rely entirely on either technique.

As far as I know there’s no way to smooth out that linear interpolation, it’s not ideal when rendering mesh components directly but the reasoning behind it is what makes the vertex / fragment combo so potent.

Layer Adjustments

Here’s a list of adjustments that VPaint currently supports:

  • Hue Shift
  • Saturation
  • Brightness
  • Transparency
  • Contrast
  • Tint Color (with value masking)

The adjustment shown in the gif above is value masked tinting.

Looks interesting. Wondering if baking SSAO would be on the cards? Also perhaps some functions for baking colour could be accessed at runtime for those procedural folk?

Currently you can get AO baked into vertex colors by baking an AO-only lightmap to your objects and then importing them. I think AO baking is unfortunately Pro only though.
However, I’ve already got a solution in the works that will bake AO directly to the vertex colors, which will be available to free users and not require lightmap UVs. It will be included soon!

As for baking colors during runtime, I totally agree and this is in the works. Currently all of the baking functions aren’t accessible during runtime, but most of them don’t use any editor-specific functionality. This first release was largely to get the tool out there, and one of my main priorities for the next update is improving the code API. This includes improved runtime access to the blending functions, layer adjustments, texture importing, and paint group lerping. If there are any other specific features that would be useful to access during runtime, I’m all ears!

I think it’s shaping up to be something quite special, great work so far. When we need a vertex paint tool, this is the one we’ve decided to pick :slight_smile:

Thanks for the comments hippocoder.

One more bit of promo, here’s an image showing the UI of VPaint for any prospective buyers. VPaint’s interface has been polished to be consistent and easy to use, so you should never worry about finding the feature you’re looking for.