Search Unity

VPaint: Advanced Vertex Painting [Released]

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

  1. Singtaa

    Singtaa

    Joined:
    Dec 14, 2010
    Posts:
    492
    Hi Beck, I just purchased VPaint. What is the workflow for baking the AO and re-using the mesh in another scene?

    I tried to save the AO'ed mesh into a prefab and use it that way, but the AO is gone when imported in another scene.

    Also I couldn't find a support email, is there one?
     
  2. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Hey Beck, is there an API call to collapse all VPaint layers into one layer that resembles the same look as seen when having the layer stack active?
    Or would I have to write that function myself (given that I'd be able to access each layer's color values)?
    'Cause I couldn't find this one documented in the manual... though I haven't looked into the actual mono solution.
     
  3. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Ahoy! I don't know if a lack of replies on this thread have been from frazzled burnout and a 'keep away!' mentality to approaching the thing which is something I know well but! I'm about to become a purchaser of this asset if I can get a tentative replay of 'yay' just so I know it has the feasibility of being updated in future even if not in the near future. Lack of thread replies do tend to indicate abandonment which wouldn't be an issue if Unity didn't update and render old features obsolete, and i wouldn't like to spend the money for it to have been squandered come Unity 5, so any chance of a 'yay'?
     
  4. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Hey everybody,
    This project is definitely not dead! I'm very sorry for the lack of replies lately, I'm fighting for some time to spend on VPaint to finish the update I promised you and offer the support you've been requesting. Currently our game at Valkyrie is in full production and I hope you can sympathize with the amount of time this requires. I'll be back on this thread in the next week or so to respond to individual posts (again, sorry for the delay!) but I wanted to assure you guys (at lazygunn's request) that VPaint will still be supported in the future and updates have been only delayed, not cancelled. And yeah, I'll be releasing an update for Unity 5 shortly after it comes out in order to fix any incompatibilities that may arise.
    I hope the tool is serving you all well despite the issues you've brought up. A number of people have requested more tutorial resources and I hope that I can provide that soon!

    If anyone is curious, the game we are working on at Valkyrie went public at E3 last month. We're very proud of it, and we use VPaint to paint the environments! Check it out at http://www.gunsupgame.com/

     
    HakJak likes this.
  5. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Game looks a blast! (hah)

    Grabbed myself a vpaint, cheers for the update post, was definitely hoping for it, good luck with your game
     
  6. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Do you happen to know if generating a secondary uvset destroys the vertex order of a given mesh?
    Because that's what we see over here - we have scenes with vpaint already applied. Then we checked the generate lightmap uv's button on some of those models we use in the scene. And now the vertex colors don't seem to match anymore.
    If you know of a fix/workaround pls let us know. Otherwise we need to take some time to find a solution to this problem ourselves.

    Edit:
    sorry for asking dumb questions... some quick testing shows that vpaint lists these meshes as errors in the object management section of vpaint. From there it is just a matter of some clicks to transfer the old vertex color over to the new mesh.
    What I wonder though is how vpaint stores the vertex colors. From my understanding you are storing an exact clone of the mesh (something like vertex buffer, vertex order, triangle list, position, color etc.) in that vpaint object component.
    And only by also storing the vertex position in that clone are you able to transfer colors from an old clone to a new (and probably broken) vertex ordered mesh? Some really clever stuff. Saves us so much time.
     
    Last edited: Aug 4, 2014
  7. Solus

    Solus

    Joined:
    Jun 27, 2012
    Posts:
    2
    I have a similar question as Marco but from the other end of the workflow. I have some meshes that already have vertex coloring applied to them and was wondering if you could shed light on how I could use VPaint without losing this data. Currently new vpaint objects default all vertices to black. Is there a way to import this information or prevent the overwrite of the current vertex colors?

    Even if you can point me in the direction of where something like that would go in your code base I'd be happy to take a crack at a workaround.
     
  8. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    The function you are looking for is called Import -> Base Layer in the Layers Hierarchy tab.
    Make sure your Vpaint Group actually contains the object before you try importing the original vertex colors. After importing you find a new layer at the top of the hierarchy which contains the data you are looking for.
     

    Attached Files:

  9. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Because I’ve missed quite a few, I’ll just go down the list of posts (even if some of the problems may be outdated)

    @hippocoder I know it’s been some time since this post, but just to let you know this issue has been solved for the next version.

    @bpears In response to tiling textures across two objects, the UVs do need to line up. There are some other methods you can take inside the shader to avoid this, such as doing a triplanar or orthogonal projection.

    @Yan_CDRIN In order to paint with multiple textures, assign one of the blend shaders provided with the package to your material.

    @MikeErty I think you’re encountering a bug that shipped with VPaint where the wrong channels were being used for the wrong textures. Sounds like you figured it out but let me know if you’re still having trouble.

    @insiderrr Make sure that you’re adding the objects to your VPaint group via the Object Maintenance window. Newly created objects aren’t added to a group automatically.

    @Creepgin The support email is listed at the bottom of the manual. There are two methods: First, you can create a prefab out of your object - VPaint data is included in the prefab and will carry over to any other instances of that prefab. The second option is to use the Export Mesh utility I created for this purpose. The tool isn’t yet included in VPaint but will be in a future version. The tool will export a given mesh instance to an asset file for use in your project. http://blog.becksebenius.com/?p=333

    @MarcoSperling For your first question, the function you’re looking for is Layers/CollapseAll or Layers/CreateMerged. The functions are identical except that CreateMerged creates a copy. The API method you’re looking for is LayerStack.CreateMergedLayer. This will return a merged layer based on all enabled layers in the layer stack (it does not automatically add it to the layerstack). If you want to selectively do this, you should disable any layers you don’t want to be included.

    For your second question, generating UV2s does change the vert order. Almost all welded verts on a mesh get split when this process gets run. I’m glad you found the transfer function though! In addition to 1 color buffer per layer, each object stores a single vertex buffer so that it can make the transfer when a mesh changes. This is invaluable when you want to start painting an environment before the artists have finished polishing the models.
     
  10. AlecMoody

    AlecMoody

    Joined:
    Feb 21, 2012
    Posts:
    24
    I am getting a errors from vpaint when I load my scenes or play them in the editor. I am using Vpaint 1.4 and the latest Unity Pro build. I attached a screenshot showing the error. In this scene I am not using vpaint for any of my objects.
     

    Attached Files:

  11. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Hi AlecMoody, it appears this is a problem with an API change in versions later than 4.3. I've attached a hotfix that solves this problem, import this package over the top of your existing VPaint install. Please back up your project before doing this just in case!
     

    Attached Files:

  12. LysolPionex

    LysolPionex

    Joined:
    Mar 22, 2013
    Posts:
    2
    This is probably a pretty generic question, but suppose I buy this addon. Would other members of my team need a license to view the results in Unity, or would they only need a license to use the tool itself?
     
  13. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Well, license management isn't something that will really affect the outcome. Once VPaint is in your Unity project, it will work for anyone who opens that project - both the visual result as well as the tool itself. If you want to move assets from a project which has VPaint to a project which does not have VPaint, there is a method to bake the VPaint data into a mesh asset so that VPaint is no longer required for vertex colors to be applied.
    As far as having a license for each user, the asset store states that each license is for just one seat. Unity does not seem to actually enforce that, though, and so once the package is loaded into the project all developers on the project have access to it. This is totally acceptable for small teams, although if you are loading VPaint into a project with a large team I do humbly ask that you buy a few extra copies to represent the expanded use. Use your best judgement :)
     
  14. Deleted User

    Deleted User

    Guest

    Quick question, when I delete a vpaint object script from an object it deletes the mesh filter automatically. I have a bunch of objects I tried to do blending with it but now i changed my mind and now would have to go one by one deleting the script and applying the filter again. Is there a better way I could do this?
     
  15. Mumasboy

    Mumasboy

    Joined:
    Feb 24, 2011
    Posts:
    15
    Really great tool. The only problem I'm having is when trying to import lightmaps when the project is in Android mode. Bakes take forever and then don't actually work - spits out a load of errors about texture compression formats (Android default is ETC which I guess is not supported yet). Even when I set the light light maps to uncompressed the vert bake comes out completely white. Its not a complete killer as the lighting can be done set to PC and then switch, but it is a bit of a pain as it takes ages to re-import everything with each switch.
     
  16. S-0-L-0

    S-0-L-0

    Joined:
    Nov 9, 2012
    Posts:
    163
    Can vertexpaint be used to make a texture-less terrain, or is the paint being saved as a texture?
     
  17. insiderrr

    insiderrr

    Joined:
    Feb 24, 2014
    Posts:
    50
    working with vpaint for a while now, everything works fine, great asset, only on1 thing is not working good.

    Whgen i add a mesh collider combined with vpaint, i will fall through the plane where i'm walking on. i have to remove it and reapply to make it work aggain.

    Anny idea what is happening here ?
     
  18. pea

    pea

    Joined:
    Oct 29, 2013
    Posts:
    98
    Would this be a method to slightly improve runtime performance as well? Just wondering how VPaint actually affects runtime performance, as I'm developing a mobile game with many dynamically instantiated objects.
     
  19. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Hey beck, are you going to update VPaint so it runs smoothly under Unity 5? With 1.4 I experienced some Errors after installation ... namely where there are references to renderer.lightmapTilingOffset.
    I just uncommented that part or replaced it with rubbish as it is not required for vertex painting... but I do not dare to try anything in regard to transferring lightmap color to vertex color now :D
     
  20. Gooseman_1977

    Gooseman_1977

    Joined:
    Aug 15, 2013
    Posts:
    89
    Picked up the plugin yesterday and took me a few minutes to figure out the workflow. Once i figured it out I was able to pump out some work in no time. It really is a wonderful plugin and fast on mobile too. I didn't notice ANY frame difference when using the included shaders (I'm using a 3 texture blended shader that allows me to make my roads look really distinct)

     
  21. Gooseman_1977

    Gooseman_1977

    Joined:
    Aug 15, 2013
    Posts:
    89
    Does anyone know if the 3 texture blend shader will work on older mobile devices? I only tested it on a Google Nexus 5..
     
  22. Gooseman_1977

    Gooseman_1977

    Joined:
    Aug 15, 2013
    Posts:
    89
    I posted a step by step tutorial on how to setup a 3 texture vertex blend and how to actually paint with it in VPaint.
     
  23. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Alright lets do this all at once!

    VPaint shouldn't destroy the mesh filter, but it does currently destroy the Mesh object that it creates (this will make the mesh field of the mesh filter be null). This is intended behaviour to make sure VPaint doesn't leak memory, but in your case I could see why this would be a problem.
    In order to make sure that the mesh stays around, VPaint needs to think it doesn't "own" the mesh. To do this, set the "originalMesh" variable on the VPaintObject equal to "_mesh". Ex.
    Code (csharp):
    1. vpaintObject.originalMesh = vpaintObject._mesh;

    Hm that is indeed a problem! I was able to reproduce the problem but it will take some work to fix this issue (hopefully in the next update).
    If you are using source control, one trick that I like to do is to have multiple project folders, each imported to a target platform. This doesn't solve the problem, but maybe it will help alleviate the re-import wait time!


    The paint is saved as vertex colors, so no texture is required to use it. For VPaint to be of any use you'll need to use a shader that uses vertex colors somehow.


    I believe you're encountering a bug that exists in the current version of VPaint. VPaint uses mesh colliders internally to support painting, and that can sometimes have conflicts with existing mesh colliders. The best recommendation I can offer currently is to keep your mesh collider on a sub-object.


    Indeed it does! Although VPaint is built to work without any editor-tricks, you can save some cycles (and memory) by removing the VPaint objects before making a build. In our project, we automate this using the [PostProcessScene] attribute and some other techniques. Of course, this only makes sense if you don't use the VPaint runtime API.


    Yes absolutely, however I don't currently have access to Unity 5 (I'm not a beta user). When 5 comes out, I'll be expediting a new version of VPaint to fix any compatability issues.


    @Gooseman_1977 [Response to multiple posts]
    I'm glad you like the tool, your roads look great and thank you very much for creating that tutorial! A lot of users have asked for more tutorials and I'm very apologetic that I haven't made time for that, so I'm glad that you're helping to fill the gap a little :)
    As for the 3-texture-blend, I believe it does! I don't have access to that shader at the moment, but the only incompatibility that may exist is the user of shader model 3. Check in the shader code if this line exists:
    Code (csharp):
    1. #pragma target 3.0
    If it doesn't, then you are in the clear!
     
  24. Gooseman_1977

    Gooseman_1977

    Joined:
    Aug 15, 2013
    Posts:
    89
  25. Paul-van-der-Laan

    Paul-van-der-Laan

    Joined:
    Oct 12, 2013
    Posts:
    60
    Hey Beck, just purchased Vpaint, mainly for the shaders as I'm trying to do a workflow where I paint the vertex colors in 3ds max instead of within Unity. The blend 4 textures is almost exactly what I need. The thing that I could use however, is to make 3 blends (so using 4 textures) by just using the RGB channels of the vertex color. Can you make such a shader?

    Edit: I got it working by using the blend 5 textures and not using a texture in the alpha slot. But I suppose it will be more efficient if the shader doesn't regard the alpha channel at all and only has 4 texture slots. So if you can help me with that, I would appreciate it :)
     
    Last edited: Oct 30, 2014
  26. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    Stupid question... there's a way to export the mesh with the vertex colors applied on a FBX file?

    Thanks
     
  27. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    @Paul van der Laan Hi, perhaps you've already solved the problem but I'll make an edited version of the shader for you in the morning when I have access :) You are right that eliminating the alpha channel will have a slight performance boost.

    @Kafar Not sure which direction you're asking for, so I'll address both. Unfortunately you cannot export a mesh directly to a .fbx file (Neither VPaint nor Unity yet support fbx exporting). However, you can export a mesh to a .asset file, which will allow the mesh to be used throughout the project (with vertex colors). As for importing vertex colors *from* an fbx file, selected Import/Base Layer in the Layers group to import the vertex colors supplied to the model importer as a VPaint layer. Hope that answers your question :)
     
  28. Paul-van-der-Laan

    Paul-van-der-Laan

    Joined:
    Oct 12, 2013
    Posts:
    60
    Hey Beck, did you make the edited shader without alpha channel yet? :)
     
  29. Zarian

    Zarian

    Joined:
    Nov 19, 2014
    Posts:
    1
    Hey, awesome tool. I have one issue though and I'm not sure how to fix it. For some reason the VPaint window wont show up. When I apply the scripts I get an error in the compiler. I'm unable to do anything. Any ideas of what's going on? I'm sure it's probably something wrong on my end, but I'm not sure how to fix it. Could really use the help.

    Thank you.
     
  30. Disastercake

    Disastercake

    Joined:
    Apr 7, 2012
    Posts:
    317
    I think this tool associates the vertex painting with the name of a mesh rather than it's metadata GUID. If I change the name of the file inside of the Unity editor, I lose all of the painting data. Just spent a couple hours on terrain and lost everything after I renamed the file to be more descriptive. =/

    Would be cool if this wouldn't happen.
     
  31. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    @Paul van der Laan Yes, sorry for the delay! It is attached.

    @Zarian could you post or PM me the error that you're receiving and which Unity version are you using? Certainly need some more information before I can offer any solutions.

    @Disastercake This is actually a Unity-wide problem. The metadata GUID only refers to the asset path, which for a model importer is a GameObject. Meshes at that path (there may be multiple as per Unity's import pipeline) are then referenced internally by name. Renaming a mesh is unfortunately a breaking change as per Unity's pipeline unless you maintain the original prefab reference to the model.
    However, VPaint actually has some tools that may be able to help you recover your paint data. If you reassign the mesh to the object, VPaint should automatically pick up the new mesh and then present an error in the Object Manager panel that allows you to transfer colors over to the new mesh.
    Sometimes this won't work if the object data has already been flushed somehow from the VPaint group, though, and if this is the case then you'll have to live with the lost work :\ One thing you can do to avoid this problem in the future is to break the instances of your meshes (again, via the object manager panel). However, this will disable your ability to update the mesh or to use the mesh in a prefab.
     

    Attached Files:

  32. Rave-TZ

    Rave-TZ

    Joined:
    Jul 21, 2013
    Posts:
    84
    Just grabbed the plugin. Its been very useful but the paint function has stopped working for some reason. I can still modify layer opacity but flood fill, paint, erase no longer work.

    Also, I got this package because I need to light scenes without the use of realtime lights. All packages I've found for baking vertex colors from lights require light maps as an in-between step. This is not possible in all scenarios especially when I'm consulting for other assets not built for a light map setup. Is there any way to bake / copy / apply vertex lighting from the editor window or during runtime? The vertices are being lit in preview when using light sources so it seems like a waste to not have access to the current vertex color in the editor.
     
  33. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    I'm thinking about buying this today but I need to ask if it is compatible with Unity 5... also can this tool be used with Shader Forge and other shaders or is it exclusive to your own VPaint Shaders?
     
  34. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    @Rave-TZ Uhoh, that's not good! Do you have any more info that I could work on for assistance? There are a few gotchas to look out for, such as trying to paint on a disabled layer, turning on the isolation bounds, or isolating only a certain set of objects. Also, try re-opening the VPaint window just to be sure.

    Unfortunately for the lighting transfer VPaint does require the lightmapping. I've looked into some ways of rendering the real-time lights to a rendertexture for use with transferring to VPaint but haven't yet finished the feature. It's already higher up on my priority list due to a number of requests for this type of feature.

    @Ascensi I don't yet have access to the Unity 5 beta, but once I do I'll be making a VPaint update ASAP to solve any incompatibility issues.
    Yes, it should work with any shader that supports vertex colors - including those built with shader forge :)
     
  35. munkyfunmatt

    munkyfunmatt

    Joined:
    Dec 8, 2014
    Posts:
    1
    This tool looks amazing, beck. I'd love to see a Unity 5 version in the future. :)
     
  36. TomRab

    TomRab

    Joined:
    Jul 12, 2012
    Posts:
    3
    Looking into buying this. Does this tool support skinned mesh renderers?

    To be precise, I'm wanting to vertex paint on a character.
     
    Last edited: Feb 2, 2015
  37. Ryukishi

    Ryukishi

    Joined:
    Jan 26, 2015
    Posts:
    8
    Hi, I'd like to use vpaint on a 2d terrain, I tried on planes but I think it's going to lag. I tried it on quad mesh but the paint is not applying. Have you a better idea on how to use vpaint on terrain for 2d games? Thanks
    EDIT: ok I found out the quad is too small and forgot the colors are applied to the vertex. :oops:
     
    Last edited: Feb 2, 2015
  38. pr1970

    pr1970

    Joined:
    Feb 12, 2015
    Posts:
    2
    Hi,
    I`ve recently bought vpaint and i`m trying to find out if its possible to have a cubemap assigned to the vpaint shaders.Reason is I`d like to have reflective tiles that have areas of dirt and I`d require a cubemap for that.

    Thanks
     
    Last edited: Feb 12, 2015
  39. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Hi beck,

    what would you recommend when you'd want to apply random vertex colors to certain meshes. Some kind of 3d perlin noise?
    Might be handy to make a scene look different every time it is loaded.
     
  40. cjrussel14

    cjrussel14

    Joined:
    Jun 20, 2014
    Posts:
    69
    hi,quick question, is vertex color expensive on IOS? thanks whoever answer it! :)
     
  41. David-Lindsay

    David-Lindsay

    Joined:
    May 20, 2009
    Posts:
    121
    Hey beck,

    Many of my meshes are vpainted. I want to upgrade to unity5, but I found that unity5 can't read the meshes vertex colors. Basically everything comes out as a color of (1,1,1,1). The way the vertex color info is saved or stored might be a problem cause unity 5 can't access them. Or maybe a different way of reading the colors in the VertInput of the shader... I really don't know. We really need a fix for this as soon as possible.

    Until then, I'll continue in unity 4.6
     
  42. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Is VPaint fully compatible with Unity 5 at the moment?
     
  43. David-Lindsay

    David-Lindsay

    Joined:
    May 20, 2009
    Posts:
    121
    It doesn't seem so. I have tried it and it only appears to work properly. But when you need to do something with your colors, unity5 can't use them, doesn't even know they are there.

    It would be good if beck came back and upgraded the tool, but it looks like he's gone to do his own game project now. If anyone can fix the tool and provide the new version, I will happily pay them! :)
     
  44. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Hey guys,
    I'm looking into the U5 fixes today, hopefully I can have it done by the end of the day and sent off to the asset store guys! Sorry for the delay.

    - Beck
     
    DMeville likes this.
  45. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    Unity 5 compatibility is the only thing that's holding my back from buying it although I am also targeting WebGL & using substances.
     
  46. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    @beck

    Great to hear, thanks!
     
  47. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,162
    I don't have a previous version to test on, but should vpaint be as slow when painting relatively low poly models as it is? I'm using it with a triplanar shader for my terrain doodads so everything matches up but it's all kinda wonky and super laggy. I have to basically just repeatedly click to do anything.
     
  48. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Hey folks, 1.41 has been released on the asset store. This version adds Unity 5 compatibility to VPaint 1.4, and will only be visible from the Unity 5 asset store.

    Although there are several features/fixes in my development branch for 1.5, I opted to hotfix 1.4 so that I can get it into your hands as soon as possible. I'll keep you all posted in progress on VPaint 1.5.
     
  49. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    That's awesome to hear, thanks!

    By the way, can you take a look at offering an option to "bake" the vertex color state from a VP group into a mesh? There are several .obj exporters on the wiki, so it's definitely doable (no need to offer an option to overwrite any exotic format, a simple lossless .obj export into a new file is absolutely okay). It will obviously remove flexibility VP groups offer, but it would be an extremely valuable option for situations where you need Meshes that work with vertex color driven shaders out of the box (for example, when you need to instantiate hundreds of modular pieces with VC-driven shaders during procedural level generation).
     
  50. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Hey bac9-flcl, there is a way to export the mesh to a .asset file, it's not included in VPaint yet but I've made it publicly available:

    https://gist.github.com/becksebenius/6958389

    This saves the selected mesh (including vertex colors) as a .asset file that can then be used directly from the project folder.

    Unfortunately .OBJ isn't an option because the standard OBJ format doesn't support vertex colors. I've messed around with doing a FBX exporter but it's a somewhat difficult format that I haven't gotten it right yet.