Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

VPaint: Advanced Vertex Painting [Released]

Discussion in 'Assets and Asset Store' started by beck, Jul 27, 2013.

  1. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    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!
     
    Last edited: Mar 18, 2014
    thieum and Gozdek like this.
  2. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
  3. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    @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
     
    Last edited: Jul 31, 2013
    thieum likes this.
  4. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Another gif showing how easy it is to blend objects together with the click of a button.


    Directional Object Blending

     
    Last edited: Jul 31, 2013
  5. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    nice! how does this handle performance wise?

    and how many textures can be blended at one time?
     
    Last edited: Jul 31, 2013
  6. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    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.
     
  7. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    awesome! is there a number of textures for blending limit?
     
  8. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Presumably 3 or 4 since vertex colors only have RGBA components?
     
  9. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    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.
     
    Last edited: Jul 31, 2013
  10. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    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

     
    Last edited: Jul 31, 2013
  11. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    Ah, ok. So can you paint regular vertex colors on top of those 3-4 textures? Or do those count as textures themselves?
     
  12. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    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.
     
    Last edited: Jul 31, 2013
  13. JoakimW

    JoakimW

    Joined:
    Jul 31, 2013
    Posts:
    4
    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.
     
  14. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    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.
     
  15. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    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.
     
  16. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294

    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.
     
    Last edited: Aug 1, 2013
  17. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    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?
     
  18. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    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!
     
  19. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    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 :)
     
  20. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    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.

     
    Last edited: Aug 2, 2013
  21. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Sweet looking! Definitely top of my shopping list for sure!

    I have one suggestion:
    Instead of having to click the color setting to access the color palette itself, why not give user the direct access to the color palette itself right on the UI? Maybe put it just above the Saved Color Setting?
     
  22. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Yeah thats a good idea I am da bawss, I often get frustrated with Unity's builtin color picker myself. Though I'd have to write a custom picker (unity's picker is very non-extensible), it isn't too far fetched. VPaint already has some backend set up for this sort of thing, so I'll do my best to get something there for the next update.
     
  23. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    Finally a Vertex Painting tool with a proper feature set and nice GUI that isn't overpriced :) This is looking most excellent mate.
     
  24. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Thanks Thomas! I'm glad it looks like a proper feature set, that's what we are really after so if there is anything that seems like it is missing I'd be happy to hear about it.
     
  25. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Previewing Color Channels

    In VPaint you can easily preview the color channels of your mesh, either individually or combined as RGB. This is extremely helpful when painting on texture-blend shaders, where a stray bit of data in the wrong channel can produce some bad results.

    I've been getting a lot of questions about the shaders in VPaint, and I wanted to mention that every update will include additional vertex colored shaders to put on your models. One of the new shaders in the coming update is a 5-texture blend shader, using all 4 channels of the vertex colors on top of a base texture. Although you need to apply vertex colors to your model to blend textures, here is the shader as a freebie:

    Code (csharp):
    1.  
    2. Shader "VPaint/Lit/Blend 5 Textures" {
    3.     Properties {
    4.         _BaseTexture ("Base Texture", 2D) = "white" {}
    5.         _Texture1 ("Texture 1 (Red Channel)", 2D) = "white" {}
    6.         _Texture2 ("Texture 2 (Blue Channel)", 2D) = "white" {}
    7.         _Texture3 ("Texture 3 (Green Channel)", 2D) = "white" {}
    8.         _Texture4 ("Texture 4 (Alpha Channel)", 2D) = "white" {}
    9.     }
    10.     SubShader {
    11.         Tags { "RenderType"="Opaque" }
    12.         LOD 200
    13.        
    14.         CGPROGRAM
    15.         #pragma surface surf Lambert
    16.         #pragma exclude_renderers flash
    17.  
    18.         sampler2D _BaseTexture;
    19.         sampler2D _Texture1;
    20.         sampler2D _Texture2;
    21.         sampler2D _Texture3;
    22.         sampler2D _Texture4;
    23.  
    24.         struct Input {
    25.             half2 uv_BaseTexture;
    26.             half2 uv_Texture1;
    27.             half2 uv_Texture2;
    28.             half2 uv_Texture3;
    29.             half2 uv_Texture4;
    30.             float4 color : COLOR;
    31.         };
    32.  
    33.         void surf (Input IN, inout SurfaceOutput o) {
    34.             float4 color = IN.color;
    35.            
    36.             half4 t0 = tex2D (_BaseTexture, IN.uv_BaseTexture);
    37.             half4 t1 = tex2D (_Texture1, IN.uv_Texture1);
    38.             half4 t2 = tex2D (_Texture2, IN.uv_Texture2);
    39.             half4 t3 = tex2D (_Texture3, IN.uv_Texture3);
    40.             half4 t4 = tex2D (_Texture4, IN.uv_Texture4);
    41.            
    42.             half4 cum = t1 * color.r + t2 * color.g + t3 * color.b + t4 * color.a;
    43.             fixed fac = color.r + color.g + color.b + color.a;
    44.            
    45.             if(fac != 0) cum /= fac;
    46.             cum = lerp(t0, cum, fac);
    47.            
    48.             o.Albedo = cum.rgb;
    49.             o.Alpha = cum.a;
    50.         }
    51.         ENDCG
    52.     }
    53.     FallBack "Diffuse"
    54. }
    55.  
     
  26. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    Can you paint 4 diffuse+4bump? Can dynamic objects be painted(like a cube that moves around at runtime)?
     
  27. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Great questions bpears.

    Dynamic objects can indeed be painted. In fact, your paint data can even be saved to a prefab, allowing every instance of that object to inherit vertex colors. Of course, if you paint lighting on your objects, it might look strange if they start moving around. To somewhat solve that sort of problem, VPaint has functions that blend objects together. In this first release blending is editor-only, but it will be exposed to runtime in VPaint 1.1 (coming soon). That means that you can project vertex colors from the surrounding area onto a dynamic object after it's moved. We use this in our internal game for placeable buildings - when buildings are placed, portions of them are blended with the ground to ensure that they match their surrounding paint data.

    As for the 4 diffuse + 4bump, that is indeed possible. The shader was not included in VPaint 1.0 but will absolutely be available in 1.1. However, that seems to be a pretty important shader to several people, so I'll post that one here as well. Coming in VPaint 1.1 is also a 5 diffuse/bump/spec shader.

    Code (csharp):
    1.  
    2. Shader "VPaint/Lit/Blend 4 Bumped Textures" {
    3.     Properties {
    4.         _Color ("Base Color", Color) = (1,1,1,1)
    5.        
    6.         _Texture1 ("Texture 1 (RGB: Red Channel) (A: Spec)", 2D) = "white" {}
    7.         _Texture1Bump ("Texture 1 Bump", 2D) = "bump" {}
    8.        
    9.         _Texture2 ("Texture 2 (RGB: Blue Channel) (A: Spec)", 2D) = "white" {}
    10.         _Texture2Bump ("Texture 2 Bump", 2D) = "bump" {}
    11.        
    12.         _Texture3 ("Texture 3 (RGB: Green Channel) (A: Spec)", 2D) = "white" {}
    13.         _Texture3Bump ("Texture 3 Bump", 2D) = "bump" {}
    14.        
    15.         _Texture4 ("Texture 4 (RGB: Alpha Channel) (A: Spec)", 2D) = "white" {}
    16.         _Texture4Bump ("Texture 4 Bump", 2D) = "bump" {}
    17.     }
    18.     SubShader {
    19.         Tags { "RenderType"="Opaque" }
    20.         LOD 200
    21.        
    22.         CGPROGRAM
    23.         #pragma surface surf Lambert
    24.         #pragma target 3.0
    25.  
    26.         half4 _Color;
    27.         sampler2D _Texture1;
    28.         sampler2D _Texture1Bump;
    29.        
    30.         sampler2D _Texture2;
    31.         sampler2D _Texture2Bump;
    32.  
    33.         sampler2D _Texture3;
    34.         sampler2D _Texture3Bump;
    35.        
    36.         sampler2D _Texture4;
    37.         sampler2D _Texture4Bump;
    38.  
    39.         struct Input {
    40.             half2 uv_Texture1;         
    41.             half2 uv_Texture2;         
    42.             half2 uv_Texture3;         
    43.             half2 uv_Texture4;
    44.            
    45.             float4 color : COLOR;
    46.         };
    47.  
    48.         void surf (Input IN, inout SurfaceOutput o) {
    49.             float4 color = IN.color;
    50.            
    51.             half4 t1 = tex2D (_Texture1, IN.uv_Texture1);
    52.             half4 t2 = tex2D (_Texture2, IN.uv_Texture2);
    53.             half4 t3 = tex2D (_Texture3, IN.uv_Texture3);
    54.             half4 t4 = tex2D (_Texture4, IN.uv_Texture4);
    55.            
    56.             half4 t1b = tex2D (_Texture1Bump, IN.uv_Texture1);
    57.             half4 t2b = tex2D (_Texture2Bump, IN.uv_Texture2);
    58.             half4 t3b = tex2D (_Texture3Bump, IN.uv_Texture3);
    59.             half4 t4b = tex2D (_Texture4Bump, IN.uv_Texture4);
    60.            
    61.             half4 cum = t1 * color.r + t2 * color.g + t3 * color.b + t4 * color.a;
    62.             half4 nrm = t1b * color.r + t2b * color.g + t3b * color.b + t4b * color.a;
    63.             fixed fac = color.r + color.g + color.b + color.a;
    64.            
    65.             if(fac != 0)
    66.             {
    67.                 cum /= fac;
    68.                 nrm /= fac;
    69.             }
    70.             cum = lerp(_Color, cum, fac);
    71.            
    72.             o.Albedo = cum.rgb;
    73.             o.Specular = cum.a;
    74.             o.Normal = lerp(half3(0,0,1), UnpackNormal(nrm), fac);
    75.         }
    76.         ENDCG
    77.     }
    78.     FallBack "Diffuse"
    79. }
    80.  
    Here's an image of the shader in action:
     
    Last edited: Aug 12, 2013
  28. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    Wowza! That's awesome. Should be a perfect fit... I'll keep an eye out for your updated version! I hope saving the info to prefabs is integrated to interface, or documented well, this would be very helpful!
     
    Last edited: Aug 12, 2013
  29. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Well, saving the paint data to prefabs is as simple as including the VPaintGroup as part of your prefab. It's very similar to how the rest of the workflow works. However there's no explicit documentation about using VPaint with prefabs, so I'll take that as a request and see about writing something up for it in the near future.
     
  30. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    Oh, well cool, that's easy as it gets. Something else that would be cool, is a sort of decal vertex painting, using transparent decal textures to paint on objects that are already textured. Anyway, keep up the good work!
     
  31. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    I agree that decal painting would be pretty great, although I'm not sure if vertex colors are a very good way to do it - to paint decals I would wrap a mesh on the affected area, and give it a z bias to tell it to render on top.
    Unless of course you mean a transparent tiling texture that blends much like the above shaders, which would be a great use of vertex colors! A good example would be painting scratches or damage on interiors.
     
  32. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    Yes! I was thinking blending in dirt/grit/mold onto building walls.
     
  33. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    That's a pretty simple one, bpears, and I agree that it would be very useful. I'll include a few permutations of this in the next release.

    Here's another free shader in the same lineup, a 5 texture blend, with normal and spec. This one won't work on flash or some mobile devices, but it packs quite a punch! The shader starts with the base texture with empty vertex colors, and blends together the other 4 based on their respective vcolor channel.

    5 Texture Blend w/ Normal and Spec

    Code (csharp):
    1.  
    2. Shader "VPaint/Lit/Blend 5 Bumped Textures" {
    3.     Properties {
    4.         _BaseTexture ("Base Texture (RGB: Diffuse) (A: Spec)", 2D) = "white" {}
    5.         _BaseTextureBump ("Base Texture Bump", 2D) = "bump" {}
    6.        
    7.         _Texture1 ("Texture 1 (RGB: Red Channel) (A: Spec)", 2D) = "white" {}
    8.         _Texture1Bump ("Texture 1 Bump", 2D) = "bump" {}
    9.        
    10.         _Texture2 ("Texture 2 (RGB: Blue Channel) (A: Spec)", 2D) = "white" {}
    11.         _Texture2Bump ("Texture 2 Bump", 2D) = "bump" {}
    12.        
    13.         _Texture3 ("Texture 3 (RGB: Green Channel) (A: Spec)", 2D) = "white" {}
    14.         _Texture3Bump ("Texture 3 Bump", 2D) = "bump" {}
    15.        
    16.         _Texture4 ("Texture 4 (RGB: Alpha Channel) (A: Spec)", 2D) = "white" {}
    17.         _Texture4Bump ("Texture 4 Bump", 2D) = "bump" {}
    18.     }
    19.     SubShader {
    20.         Tags { "RenderType"="Opaque" }
    21.         LOD 200
    22.        
    23.         CGPROGRAM
    24.         #pragma surface surf Lambert
    25.         #pragma target 3.0
    26.  
    27.         sampler2D _BaseTexture;
    28.         sampler2D _BaseTextureBump;
    29.        
    30.         sampler2D _Texture1;
    31.         sampler2D _Texture1Bump;
    32.        
    33.         sampler2D _Texture2;
    34.         sampler2D _Texture2Bump;
    35.  
    36.         sampler2D _Texture3;
    37.         sampler2D _Texture3Bump;
    38.        
    39.         sampler2D _Texture4;
    40.         sampler2D _Texture4Bump;
    41.  
    42.         struct Input {
    43.             half2 uv_BaseTexture;
    44.             half2 uv_Texture1;         
    45.             half2 uv_Texture2;         
    46.             half2 uv_Texture3;         
    47.             half2 uv_Texture4;
    48.            
    49.             float4 color : COLOR;
    50.         };
    51.  
    52.         void surf (Input IN, inout SurfaceOutput o) {
    53.             float4 color = IN.color;
    54.            
    55.             half4 t0 = tex2D (_BaseTexture, IN.uv_BaseTexture);
    56.             half4 t0b = tex2D (_BaseTextureBump, IN.uv_BaseTexture);
    57.            
    58.             half4 t1 = tex2D (_Texture1, IN.uv_Texture1);
    59.             half4 t2 = tex2D (_Texture2, IN.uv_Texture2);
    60.             half4 t3 = tex2D (_Texture3, IN.uv_Texture3);
    61.             half4 t4 = tex2D (_Texture4, IN.uv_Texture4);
    62.            
    63.             half4 t1b = tex2D (_Texture1Bump, IN.uv_Texture1);
    64.             half4 t2b = tex2D (_Texture2Bump, IN.uv_Texture2);
    65.             half4 t3b = tex2D (_Texture3Bump, IN.uv_Texture3);
    66.             half4 t4b = tex2D (_Texture4Bump, IN.uv_Texture4);
    67.            
    68.             half4 cum = t1 * color.r + t2 * color.g + t3 * color.b + t4 * color.a;
    69.             half4 nrm = t1b * color.r + t2b * color.g + t3b * color.b + t4b * color.a;
    70.             fixed fac = color.r + color.g + color.b + color.a;
    71.            
    72.             if(fac != 0)
    73.             {
    74.                 cum /= fac;
    75.                 nrm /= fac;
    76.             }
    77.             cum = lerp(t0, cum, fac);
    78.            
    79.             o.Albedo = cum.rgb;
    80.             o.Specular = cum.a;
    81.             o.Normal = lerp(UnpackNormal(t0b), UnpackNormal(nrm), fac);
    82.         }
    83.         ENDCG
    84.     }
    85.     FallBack "Diffuse"
    86. }
    87.  
     
    Last edited: Aug 13, 2013
  34. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    '

    Awesome! Thanks. And just curious, what game did you design this tool for? I remember you mentioning it above somewhere... Maybe I'm imagining things.
     
  35. JoakimW

    JoakimW

    Joined:
    Jul 31, 2013
    Posts:
    4
    It's not quite official yet but we'll definitely post in the showcase forum when we can.
     
  36. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    Judging by this tool, I'm sure it will be something awesome.

    Is there a parameter for tiling size, for the textures used?
     
  37. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Almost all of the shaders included in the package maintain support for the built-in texture tiling. Some of the shaders have combined the tiling options, for example the 5-texture blend allows only one tiling option each texture rather than having separate options for the diffuse and normal maps.
     
  38. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    VPaint 1.1 is on its way through the submissions process. Here's a list of the changes made to this version:

    The biggest change in this version is an improved code API. Radial and Directional blending are now accessible during runtime, as well as Asyncronous versions so that you can do it properly during a loading screen. Additionally, color blending between VPaintGroups. Just call VPaintGroup.BlendTo(otherVPaintGroup, time) to blend between groups. There are some additional improvements to the API which is detailed out in the manual provided with the package.

    Also a big change was improvements to performance. It was already pretty fast, but it was starting to slow down when a paint group had several thousand objects. Now vertex painting is even faster! And in extreme cases, the Isolated Region feature allows your vertex painting to be constrained to one area, drastically reducing the number of calculations needing to be performed.

    Here's a little Webplayer Demo to show some of this stuff during runtime. Click around on the screen to apply damage onto the ground, and select Reset to fade back to the original setting. All of this is done with vertex colors and the VPaint API.
     
    Last edited: Aug 17, 2013
  39. JoakimW

    JoakimW

    Joined:
    Jul 31, 2013
    Posts:
    4
    We had to resubmit because for some reason Unity was no longer cool with us making our own Menu tab. It'll be nested under game object and hopefully approved sometime next week.
     
  40. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    This looks great ! It looks like the most complete vertex painter on the store and the price is right too. Congratulations ! Will most likely buy this soon. I am looking forward to being able to paint at run-time for some neat effects. :)

    Couple of questions before I buy:

    -Might sound like a silly question but let's say I have 10 identical models of a building on my map which are the same prefab (so 10 instances of the same prefab). If I paint one of the buildings, will the 9 others copies inherit the same vertex info ? If I want one of the same buildings but with different vertex coloring, I would just use another prefab and it would work I guess ? If you could explain a bit how it works, it would be great.

    - Can I copy vertex from one prefab to another prefab (that is the same model) ? Or is there an easy way to achieve that ? Say I would like to have two buildings (same 3D model) that have very similar vertex coloring but with minor differences. So I would paint the first one and then, I would not want to start again from scratch on the second one, so if I could copy what I had from the first one to the second one and continue painting from there.

    Will this demo also be included in the package ?
     
    Last edited: Aug 22, 2013
  41. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Thanks for the questions Alf203, I'll try to answer them as best I can.

    VPaint abstracts the storage of vertex colors from the actual models using a component called VPaintGroup. This stores all the vertex colors in VPaint, and it can live anywhere in the scene or on the prefab. You can have multiple VPaintGroups in the scene, as each group has a list of object targets, which lets you group your colors in any way you want. So, if you want your prefab to define vertex colors you simply keep the VPaintGroup inside your prefab, but if you want to have separate colors per instance in the scene you keep your VPaintGroup as a separate gameobject. You can even do both by having the VPaintGroup inside the prefab, and for any instance you want to override you can set the "Auto Apply Schedule" variable to "Never".

    Currently the best way to copy vertex colors from one object to another is using Radial Blending - but this is used for transferring between objects which don't have a the same vert count, and is rather slow. Unfortunately this is not currently as simple as it should be for objects which reference the same mesh. I agree that that is a great workflow to be able to follow, and I will put this on the priority list for the next update.


    It's not currently included in the package (I put it together rather quickly, so the code is a little sloppy). However, based on your interest I'll make a note to include it in the next update.
     
    Last edited: Aug 22, 2013
  42. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    Hi Beck,

    Thanks for the answers ! Sounds great :)

    Will grab this soon on the asset store.

    Regards,
    Alf203
     
  43. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    Hmmm, I could actually make very good use of this. I would rather have it not do it at runtime. So that I can take a hipoly model I've made, use the tool on it, then texture its low poly closely to it using this function. This tool just keeps sounding better and better, keep it up! I'm planning on buying it here in the next few months when I get to the right spot in my workflow. That's saying a lot since I pretty much never find anything worth buying. ;)
     
  44. langem

    langem

    Joined:
    Mar 18, 2013
    Posts:
    73
    Hi I just bought VPaint and it's pure awesome! Exactly what I was looking for! I was wondering, if it's possible to only draw on certain polygons to have sharp edges between colors (and no gradients -> similar to "all faces"-option in blender)

    Thanks,
    Matthias
     
    Last edited: Aug 24, 2013
  45. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    @bpears Glad to hear that you're interested! Let me know your thoughts when you get around to purchasing it :)

    @langem Thanks! I'm glad it worked out for your project. That's a good idea you have there, I will look into it's viability. The main thing missing from VPaint right now is that would make this possible is the ability to paint per-vertex rather than per-area. Currently you paint on the model, and if vertices are on top of each other there's no way you can give them different colors. I think it would be pretty useful to be able to modify vertex colors on a per-vertex level (maybe a feature similar to the "vertex face" setting in Maya) so I'll think about the best way to approach that and you might see it in an update the future

    I also wanted to post here to announce that VPaint 1.1 has passed certification and it's up on the asset store now! One minor change you should be aware of is that Unity asked me to move the VPaint menu out of the main top bar, so it now lives under GameObject/VPaint/.
     
  46. tbxturbo

    tbxturbo

    Joined:
    May 28, 2013
    Posts:
    6
    I have a couple of questions regarding the tool;

    1 It seems that if I update a mesh (move a vert)and re-export it won’t update models in the v-paint group. What is the best way solve this? Storing and importing vertex colours? I am a bit concerned that if we paint a whole scene and a model needs to get updated then we have to re-paint.

    2. I am using the clamped blending 2x normal shader. In my scene the object looks fine. When I create a build the object appears fully painted (texture 2 is fully exposed). It also appears that way in my scene after the build and then when I re-select the v-aint group it goes back to the way I painted it. I looked through the manual and I don’t think I’m missing anything…

    Thanks,
     
  47. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Hi tbxturbo,

    1. I believe the problem here is that when the vertex count of a model changes, it invalidates the vertex color data associated with it. I agree this is bad for the pipeline so I'm busy implementing a transfer window which will help you update invalidated vertex colors to a valid state. This will be available in the next update, but if you need it sooner send me a PM and I'll be happy to give you an advance copy when it is ready for use.

    There is also a problem present where reimporting a model with the same vert count will not update. This will also be fixed in the next version, but a workaround for this should be to save the scene and reload it. VPaint only instances meshes while editing, and cleans up when saving the scene - so the new reference should be brought in after a reload. In future versions, this will happen automatically when reimporting.

    2. You are probably encountering a bug that was in the initial release, where a mesh's original vertex colors would interfere with VPaint's layer system. Could you verify that you've updated to the latest version?
     
    Last edited: Aug 26, 2013
  48. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Just purchased this, looks great, but I can't get it to work. I've done this:
    1) Added VPaint Group to the object in the scene that I want to paint.
    2) Chosen VPaint/Lit/Blend2 Textures for the shader on that object
    3) Clicked "Paint" in VPaint popup box -- but there's no paintbrush when I mouseover or drag-mouse on the mesh. No errors, nothing.
    4) I tried adding that same object, and other objects, via the Add Object section of VPaint, but they never get added -- it still says "0 Objects" under Object Targets.

    Probably I'm missing something obvious?

    thanks
    Dave
     
  49. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Hi Gecko, could you check to make sure your objects have the VPaintObject component on them? You can add it from Component/VPaint/VPaintObject or by selecting "Add Colorer" from the dropdown in the Add Object section.
     
  50. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Thanks for the quick reply. The object did not have VPaintObject on it -- at what step should that happen? I've added it now, but still can't paint--no paintbrush cursor. And in the VPaint popup, under Object Targets, I still have "0 Objects" and "Add Colorer" is not an option in that pulldown menu.