Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. 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. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    Oh that's fantastic Beck. thank you for taking the time to put this list together.

    satisfies my curiosity indeed :)

    Kind Regards
    MoHoe
     
  2. edufurla

    edufurla

    Joined:
    Mar 7, 2014
    Posts:
    19
    I just bought it and this asset is great. Make things a lot easier.
    I making some tests and I note the tile textures are pixelated in my Galaxy note 10.1 and S3 phone, but looks fine in Motorola Moto G.
    Which is the less expensive GPU shader I have to choose to work in a major number of mobile devices?
    There are any shader for mobile in VPaint?
    Thank you
    $Screenshot_2014-03-07-16-19-06.jpg
     
  3. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Hi edudeck16,
    I encountered this same problem with another user, here is the explanation/solution:

    The shaders in VPaint use low-precision when passing the UVs through the shader. Although this is more optimized, some GPUs handle precision differently and cause the problem you're seeing. Generally this never shows (even on those GPUs) but will begin to show its face when you have a texture tiling across a very large mesh. The solution is to change the precision of the UVs from "half" to "float".
    Here is an example of this change made to the blend shaders:
    Code (csharp):
    1.  
    2. // change:
    3. half2 uv_Texture1;
    4.  
    5. // to:
    6. float2 uv_Texture1;
    7.  
    Make this change for all UV channels in question.

    If the shader you're using looks a bit different, let me know which one you're using and I can show you the change specific to that shader.

    EDIT:
    To answer your other question, all the shaders have varying levels of complexity. Most of them will work just fine on modern mobile phones, although the normal mapped 3x+ blend shaders won't work on older devices. To keep your game optimized, pick a shader with the fewest features that fits your desired result - for example, don't use the blendx5 shader if you're only blending 3 textures.
     
    Last edited: Mar 7, 2014
  4. PolyToots

    PolyToots

    Joined:
    Mar 15, 2014
    Posts:
    20
    Hey, I'm having some difficulty understanding the baked AO. I have two objects in my example scene, a plane (ground) and a large tree.

    My tree object is not part of a VPaint group, nor does it have any vertex colour based shaders applied, but I'd still like to bake the AO that the tree would cast onto my ground plane (which is in a VPaint group).

    I tried adding a duplicate of the tree into the VPaint group, with the intention of deleting it after the bake, but it just doesn't seem to work at all, my ground plane is simply blanketed with a full white layer. (both the floor and tree objects were added to the AO object list). I guess my question is just, is this even possible? Or does the AO only calculate per-object?

    On top of that, I tried baking a lightmap instead, with a directional light in the scene, but my ground plane (Lit/Blend 2 Texture) was not receiving any shadows from my tree, the preview from the lightmap was just a plain grey fill.
     
  5. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318

    hey mate,
    not necessarily a vpaint thing, but I was struggling with this issue this weekend and I randomly stumbled across your solution here. I am having some problems with gpu precision as well, in particular on Tegra 4. It's the same problem, tiling textures across very large meshes will get extremely pixelated and blocky looking.

    I made some shaders with shaderforge that appear to be using full precision floats for everything already. For some reason tegra 4 is running into precision issues, but it works fine on my nexus 5.

    The only way I have successfully fixed the issue on a tegra 4 is to not tile a texture across anything larger than ~50m. Unfortunately, I want to use large terrain meshes and it's kind of ridiculous and inconvenient to break a large terrain mesh into a ton of 50m square chunks.

    Do you have any other ideas or tips for fixing these kind of issues? I apologize if this is offtopic, but it's been hard finding any good information on the subject.
     
  6. PolyToots

    PolyToots

    Joined:
    Mar 15, 2014
    Posts:
    20
    Me again!

    Is there a simple way to clone objects and not lose the VPaint info? I've got an asset that I intend to instance across my scene a great deal, I figured I could just VPaint it, and then clone, but it simply reverts the clone to an unmodified state. I've tried creating a prefab of the Vpaint model but I get the same issue. I've also played around a bit with merging vpaint groups and merging a cloned model into an existing group, I'll admit I don't know the functionality of these features 100%, but so far it seems like I have to manually Vpaint each object that I want to clone, which is definitely not going to happen.

    Edit
    Oh, while I'm here. Is there a bug with saving scenes? I've noticed since using VPaint that hitting Ctrl+S or going to File > Save Scene doesn't remove the little star (*) icon at the top (used to indicate whether a scene has been modified or not) and even after saving and trying to close unity, it asks me if I want to save the changes (which there are none)

    I've also had to force unity to close in the task manager A LOT since installing VPaint as it refuses to close and just freezes up when I attempt to exit unity.
     
    Last edited: Mar 17, 2014
  7. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    @GaryDave
    The AO bake does indeed work with multiple objects. One thing which might be happening is that your object doesn't have verts nearby the intersection points, so the AO doesn't have anywhere to bake to. To get object to object AO baking to work nicely, you want to line up your verts as well as possible. Not sure what could be happening with your lightbake though - I've checked on my end and I was able to bake shadows. Does the problem occur when using other shaders?
    As far as cloning objects without losing VPaint info, the best option is to use the clipboard manager (find it at the bottom of the VPaint window). You can copy and paste vertex colors from one object to another.
    The scene saving thing is _sort_ of a bug, but it's unfortunately not something that can be fixed - VPaint modifies your objects in order to display vertex colors, but these changes are reverted when the scene is saved in order keep your objects clean. This has the unfortunate side effect that unity thinks you've changed your scene when viewing vertex colors. I can't offer a solution, but I can assure you that it's harmless (although undoubtedly a bit annoying).
    I haven't had any issues with crashing on exit and you are the first to report an issue of that nature, but if you think that it's tied to VPaint then I'm definitely concerned - please let me know if you have more information about the problem.
    Hope that answers your questions :)

    @philwinkel
    Unfortunately the only real solution is to break up your meshes to reduce your tiling. GPUs aren't really set up to process UVs with extremely high values, so the precision loss is unavoidable.
    However, even without this problem I'd recommend breaking up your mesh. When your mesh is really large, the renderer can't effectively cull the off-camera pieces and so it's likely that you're rendering way more than you need to. If you break it up into chunks, the renderer can ignore objects which are out of view. Although this does probably add additional draw calls, it's likely cheaper to have a few more draw calls in order to skip rendering large chunks of geometry.
    50m does seem pretty small though. One question I have is at what scale you're building - by 50m do you mean 50 scene units? It would also be smart to open up the generated shader and see what precision type is used for storing texture coordinates. It might be a case that you have to manually increase the precision of the output shader :\ If this is the case, I'd recommend terfing the problem over to Acegikmo to see if he has some ideas.
     
  8. PolyToots

    PolyToots

    Joined:
    Mar 15, 2014
    Posts:
    20
    I hadn't tried other shaders, but I think the issue was to do with scene scale. I can't confirm that though as I gave up pretty rapidly. (it wasn't essential, I was just curious as to what sort of results it would yield).

    The clipboard manager advice worked like a treat, cheers for that. It can get pretty confusing when I'm dealing with 30+objects all called "Tree" but it's much better than the thought of re-painting them manually.

    Cheers muchos.
     
  9. Arcanebits

    Arcanebits

    Joined:
    Dec 18, 2013
    Posts:
    108
    Hi Beck I hope you can help me! I bought the tool wich I really think can help me a lot, but at the install it says ( see image ) $error.jpg

    Assets /VPain/Editor/Vpain.cs(697,35): Error CS1660 Cannot convert "lambda expression" to non-delegate type "action"

    Can we do something about it?
    My email is aldoalain @ gmail
     
  10. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Hi Arcanebits
    It appears that you have defined a class of your own named "Action" , which conflicts with the .NET class System.Action.
    You can solve this problem by adding the following line at the top of any offending scripts:
    Code (csharp):
    1.  
    2. using Action = System.Action;
    3.  
    However, I highly recommend that you choose a different name for your class. Although this should solve the problem in VPaint, it may not solve the problem as easily in other plugins you may purchase.
     
  11. Arcanebits

    Arcanebits

    Joined:
    Dec 18, 2013
    Posts:
    108
    Ohh Thanks! that will help! I just turned to create a new project to ONLY paint characters for games, that way it works flawlessy! then export etc

    One question i have followed the PDF to the word it seems that the program really want to paint, the little circle appears and I select color, the mesh is selected and viewable in the Maintenance, I have Mesh Renderer and Mesh Filter ( pointint to the mesh itself ) I guess everything is ok, even when I leftClick the mouse the pc "Thinks" I move the mouse, and when I Release mouse button nothing is painted... any help?

    Here are screenshot
    $errorinpaint.jpg
     
  12. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    It appears that you don't have a material assigned that uses vertex colors. VPaint applies its colors to the vertices of the mesh, and those colors will only appear if you assign a material which displays them. VPaint comes with a suite of shaders to do the job - check out the VPaint folder in the shader menu (where it says Diffuse at the bottom of the inspector). The shader that is closest to the one you have assigned is Vertex Color * Diffuse.
     
  13. Arcanebits

    Arcanebits

    Joined:
    Dec 18, 2013
    Posts:
    108
    Yeah! you where right, im on the manual and using your advices!

    One las thing, I now can paint, but the mesh itself seems to have a sort of clone, in white, not on every surface, maybe 50/50... so i can paint now but only the part that is not white...

    Sorry for being such a pain!

    Any Advice?

    Aldo
     
  14. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    That sounds like you've got multiple materials assigned to one object - in the Renderer component for your object, are two materials listed under the Materials field? If your object only has 1 sub-mesh (only one material was assigned to it in the 3d modeling program) then assigning multiple materials to it will cause the object to be rendered multiple times. This can cause a sort of half/half rendering thing as both materials are fighting to render on top.

    If that's not the issue, please post some more info or another screenshot in order to investigate further.
     
  15. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    I just got this asset and from the short test run I must say it's incredibly well done. Nicely organized editor, great shaders, conveniently stored results and all.

    I have some questions, though. First, is there any documentation available on the shaders, describing their intended use and proper texture setup? In particular, I'm interested in the Clamped Blending group of shaders.




    The basic idea behind each of them is understandable, the demo scene provides the examples of use and I was able to get assets using both up and running, but few things are unclear to me:

    • What is the purpose of having two height maps (from the alpha channels of diffuse textures) in the Clamped2xBlend_Normal shader? I imagine only one would be used, to mask out another (example: heightmap of a tile wall above), and examples of similar shaders elsewhere (e.g. in Blend Layer feature of CryENGINE) only ever used one height map too. If indeed only one is used, which of two is that?
    • What exactly is the intended order of use of the Clamped3xBlend_Normal diffuse slots? Considering that the height map slot hint mentions "T1 Height (R), T2 Height (G)", you'd think that "Texture 1" and "Texture 2" slots are intended to be used for overlays with heightmaps (like rubble or moss), and "Texture 3" slot is intended for an always-opaque background texture (e.g. concrete). Trying it out, I found it to be incorrect, with intended setup seemingly being "Texture 1" for opaque backgrounds, "Texture 2" for T1 Height and "Texture 3" for T2 Height. Am I correct in that and shader property hints are mistaken, or am I using the shader wrong?
    • Demo scene example of use of that shader adds to confusion by packing three height maps into the last slot texture instead of two, third being the sand dunes height map. What's the purpose of that?
    • I don't understand yet the intended relationships between particular vertex colors and results rendered by aforementioned Clamped2xBlend_Normal and Clamped3xBlend_Normal shaders. Red does something, blue does something different, alpha does something different, but I can't figure out the whole system yet. Can someone list the intended color use with some examples? Like the following:

      Clamped3xBlend_Normal
      • R controls the clamping level of the Texture 2, G controls clamping level of the Texture 3 overlay, B does nothing, A fades the clamping results into transparency if lower than 255. Examples:
      • 255,000,000,255 | Texture 2 is fully opaque and hiding the background Texture 1
      • 000,255,000,255 | Texture 3 is fully opaque and hiding the background Texture 1
      • 255,255,000,255 | Both overlays are is fully opaque and hiding the background Texture 1, visibility of one over another is determined by height comparison between the two
      • 255,000,000,000 | Alpha determines the smooth transparency of overlays, setting color to A: 0 renders them invisible
      • 000,255,000,000 | Same result, only the background Texture 1 is visible
      • 128,000,000,255 | R vertex color channel level determines the clamping level of the Texture 2, determining where sharp edge ends, - in that case only peaks from the height map channel R higher than 128 are left visible
      • 000,064,000,255 | G vertex color channel level determines the clamping level of the Texture 3, in this case leaving only 191+ peaks from the height map channel G visible.
      • 064,128,000,064 | Two overlays are displayed depending on the dominant depth if both are still opaque in one pixel after clamping to 191 and 128 respectively, or get to be displayed unaltered if only one type of overlay turns out to have sufficient height in a given point, or not displayed at all if height was not sufficient. All opaque parts are faded to 1/4 opacity from the vertex color channel A influence.
      • And so on - any example like this would be immensely useful and should probably be included in the documentation
    ________________________

    Second thing: I'd love to use consistent texture assets across the project so I would love to know if it's possible to either:

    • Modify the Clamped3xBlend_Normal to use height maps from diffuse alpha and separate specular maps instead of unwieldy layered height maps unique to each texture combination.
    • Modify both Clamped2xBlend_Normal and Clamped3xBlend_Normal to use separate external height maps.
    I understand that current design was probably decided on to save as much texture samplers as possible, though, so modifications like that will probably limit the possibility to cram additional effects like reflections into those shaders in the future. That's fair.

    ________________________

    And finally, third thing: the blended shader used for the terrain sample in the demo scene is completely black in the DX11 mode. Not sure what's causing it, to be honest. Thankfully, I haven't yet encountered an issue like that with any of the included base shaders, so it's isolated to the demo scene and probably isn't something that should be urgently fixed. But I'd like to know what I should avoid when writing my own derivative shaders to prevent an issue like that from popping up.

    Thanks in advance for any answers!
     
  16. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    Hey mate, just bought VPaint and it looks cool. I'm wondering if I can use it to blend Allegorithmic Substances together? When I go to Import Textures, it's a Texture2D field and those won't accept substance textures.

    From my understanding, you can drag Substance outputs into the "Texture" input slots, but not into "Texture2D" slots. And it appears the import texture window in VPaint is a Texture2D.

    Is there any chance you could look into implementing substances? I'm making a mobile game and all of my textures are substances, so I just kinda paid $40 for this and I can't do much with it unfortunately. here's some random substance file if you want to play around with it- View attachment $Sand01.zip

    also, from my experience.. there are one of two ways to implement substance procedural textures. Either using a Texture input (drag one of the outputs from the substance into this texture field), or a ProceduralMaterial input (drag the substance itself into the object picker field). I would recommend using the Texture input, because it gives you more control. For example, sometimes unity for whatever reason does not read the procedural outputs from your substances correctly. it will think the alpha channel of your diffuse is specular when it's really opacity, or whatever. So it would be really nice, and probably easier for you to implement, if you could change the Texture Import field in VPaint to accept a Texture instead of it's current Texture2D. I think you can cast a Texture2D to a Texture and they are very similar, so it would hopefully just be a bit of refactoring your code.

    edit - I was able to get VPaint working somewhat (I think) alongside Allegorithmic substances by just applying the substance outputs directly to the VPaint shader inputs..

    not sure if I can change or apply any settings in VPaint's Import Texture thing (like tiling, offset), since it requires a Texture2D which doesnt work with substances.
     
    Last edited: Apr 1, 2014
  17. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    @bac9-flcl
    Thanks :)
    Unfortunately there is not currently any documentation on the shaders in VPaint. Many of them are self explanatory, but you picked the most confusing one to dissect. I'd like to get a shader document going and I'll see what I can do for the next update - in the mean time, if you have any additional questions about the shaders feel free to ask them here.

    1. That was done to add some visual noise to the heightmap clamping. Originally these shaders were intended as examples of vertex color use, rather than meant to be used in production! Obviously that's no excuse for improper shaders and I'll make a note to fix these to be more consistent.

    2. You're correct, it appears the property hints were incorrectly labeled. Whoops! It should read "T2 Height (R), T3 Height (G)".
    3. The purpose of packing together was to keep the shader within the constraints of shader model 2. In retrospect, I probably should have just separated them for ease of use!

    4. Here's the setup for the Clamped3xBlend_Normal shader:
    R: Controls the intensity of Texture 2
    G: Controls the clamp value of Texture 2
    B: Controls the intensity of Texture 3
    A: Controls the clamp value of Texture 3

    So having a value of full-white should equally blend both textures together, fully obscuring the base texture. I fully agree that this needs some better documentation and examples, I've added this to the todo list!


    --
    Check your inbox for the shader variants you've requested :)
    --

    Unfortunately I don't have access right now to a DX11 rendering card, so I don't know if I can speak to the problem you saw with the demo scene. There is some tricky stuff in the demo scene that preserves the meshes to work in both 3.5 and 4.0+, so it may not be a shader issue at all. If you do end up encountering the problem, please let me know and I'll do my best to offer support.



    @philwinkel
    As your edit implies, the VPaint shaders themselves should work just fine with allegorithmic substances. I'm not doing anything tricky in that regard. Unfortunately the Texture Import window can't use the Texture object because the process requires that sampling pixels off the texture, which is unsupported by the generic Texture type. Don't substances eventually output a Texture2D?
    In any case, I'll look into adding a ProceduralMaterial input slot in order to support substances. Thanks for posting the example for me to test with.
     
  18. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    I'm not sure what the deal is with Texture vs Texture2D, all I know is Substances don't work in texture2D slots. Which really sucks, for stuff like Terrain textures, and other random important things tend to use Texture2D. It makes substance users like myself very sad. You can drag substance outputs to "Texture" slots, but NOT "Texture2D" slots.. for whatever reason. I've heard you can use a RenderTexture, and Texture2D.ReadPixels to somehow load substances into a Texture2D.. not entirely sure though.

    You can certainly "bake" the substances out as bitmaps (unity eventually does do that when they're loaded in your game), but unfortunately if you do bake them out as bitmaps in your build you lose a lot of the advantages of using them in the first place (namely file size, and the ability to make adjustments to procedural properties and stuff).

    ProceduralMaterial support would be great! Thanks for all your work on VPaint.
     
    Last edited: Apr 3, 2014
  19. Yan_CDRIN

    Yan_CDRIN

    Joined:
    Jan 8, 2014
    Posts:
    4
    Hi Beck,

    First of all, thanks for this great tool, it works great !

    I realized that with the Vpaint/Lit/Blend 2 textures (4 and 5 too) the color channel appears, but it doesn't with the Blend 3 textures. Is there a specific reason ?

    I got also mixed up with the Blend 4 textures, because somehow the Texture 2 (blue channel) and the texture 3 (green channel) are switched. A green vertex color would bring my blue channel texture, and a blue vertex color would bring the green channel texture. Is this a misunderstanding from myself or there really is an error ?
     
  20. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Hi Yan_CDRIN,
    Yes unfortunately the blend shaders had a bit of a mixup. I'm unsure how to proceed at this point, since there's now a lot of content created with the flipped setup and updating them to be correct might cause a lot of rework. At this point I can only recommend to work around the inconsistencies. If you'd like a copy of the shaders with fixed inputs, let me know and I'm happy to post them :)
     
  21. Yan_CDRIN

    Yan_CDRIN

    Joined:
    Jan 8, 2014
    Posts:
    4
    I'll get used to it :p. They are always in a RGBA order anyways XD

    Another question I had today while working, is there a shader that would mix the Lit/Blend and the Lit/Vertex Colors Diffuse ? The way I wanted to use it was to have some variations in color values to break the repetition of my grass texture, but still to be able to add for example a dirt trail. I guess at that point the best way to do it would be to use Lit/VertexColors Diffuse and to make another 3D model for the dirt trail and put it just a bit over the ground.

    Thanks for the quick reply, it makes things so much easier !
     
  22. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    There's a few options you have in that case, and it depends on what you want. Because there's only 4 channels at our disposal, we have to get clever:
    A) Use RGB color values, and the A channel to blend in a single texture
    B) Use RGB to blend in 3 textures, and the A channel to darken

    It sounds like you want the first option, so I went ahead and made the modification for you:
    View attachment $VertexColorsDiffuseLit_AlphaBlend.shader
     
  23. Yan_CDRIN

    Yan_CDRIN

    Joined:
    Jan 8, 2014
    Posts:
    4
    Exactly what I wanted, but maybe with more than two textures to blend ? I guess it is impossible to do, since there is the RGBA limitation...

    Would it be possible to have it Unlit too ?
     
  24. jgalvezpa

    jgalvezpa

    Joined:
    Dec 27, 2012
    Posts:
    36
  25. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
  26. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    •Per-vertex ambient occlusion baking is very interressing
    it's possible to combine this tecknique with one splat mat texture ?
    for mobile who is the best way ?
    at this time sorry but when i try import my vertex color from zbrush nothings happen
     
  27. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Scratch that it don't matter anymore.
    I have learned a great lesson though. The old fashioned way although not perfect - might just be the way. It only seems slow because of the thinking of that person - thus the time wasting.
     
    Last edited: Apr 23, 2014
  28. babisouk

    babisouk

    Joined:
    Jan 15, 2014
    Posts:
    1
    I want to start by saying you've done a great job on the tool!

    I was wondering, is there any way to use vpaint with a flowmap?
    That way you could have water currents on an object that has been vpainted.

    Thanks.
     
  29. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hiya,

    Quick question - we do our own batching as a build preprocessor. It scans the scene for meshes and batches them into cells, generating new meshes for the scene.

    Will Vpaint still work? basically if the mesh *currently* has vertex colours applied, then we can pull these colours off when we create new meshes before the game begins. Is this possible with VPaint?
     
  30. zzeettoo

    zzeettoo

    Joined:
    Apr 26, 2013
    Posts:
    23
    is there support for graphic tablets?
    So if i use a tablet for painting with vpaint, will it act as a mouse or will it support different pressures, etc..?
     
  31. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    @kilik128 Could you provide some more info about what you're trying to do? Also, I believe ZBrush uses .OBJ for export, and the standard OBJ format does not support vertex colors.

    @babisouk VPaint can definitely be used with a flow map, assuming the flow shader uses vertex colors to drive the flow. In the future I'd even like to add an actual tool for painting the flow that's more intuitive than painting the colors manually.

    @hippocoder Yup that should indeed work. You'll want to make sure that the vertex colors have been loaded when you create the batch. As a precaution, it may be worthwhile to call VPaintGroup.Apply on all instances in the scene before you perform the batch.

    @zzeettoo Unfortunately there is no pressure sensitivity support. Unity doesn't have a built-in API for it, and despite my digging I haven't been able to reach out to the Wacom drivers to read pressure sensitivity.

    One last thing, I'd like to apologize for the delay in finishing out the new update. The update is still coming but progress has been slowed due to other priorities. I'll keep you all posted when I have more info!
     
  32. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Just bought it.

    Some early thoughts: the demoscene example paints very slowly on all except 3-texture heightmap blend. The cursor jumps as if being paused in a very bad way.

    This is a pc that runs *everything* at 1400p at max settings (4770K OC to 4.6ghz,16gb ram, 1tb ssd, Overclocked 780 ti gpu) - so it's a surprise it is slow to the point of being unresponsive at all - leading me to believe there is some kind of artificial bug or slowdown somewhere - it doesn't happen with 3 texture heightmap blend example (2nd one).

    More info: the first example (rocks on sand) has the error: This VPaint Group contains errors! in the inspector. This is from a freshly loaded scene with the newest asset store install. What could be amiss?

    So I was wondering if you're aware of a rare bug or such?
     
  33. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Hey Hippocoder, thanks for the purchase.
    I haven't heard of anything like that happening, and I'm at a loss as to why it might happen to one object and not another. Does the problem persist if you apply the same shader to another object? Which version of Unity are you running? To support Unity 3.5 and 4.0+ in parallel, there is some trickery going on in the demo scene that wouldn't be present in other environments, so perhaps that is causing it. Any other info you can provide would be greatly appreciated.
     
  34. KrisHammes

    KrisHammes

    Joined:
    Jan 30, 2013
    Posts:
    86
    Hi there

    Just a quick question guys. I dont know if its been asked, there are quite a few pages here.

    Ive observed when i Add vpaint to an object, it seems to add collision?

    Am i going mad or is this a feature, is it possible to disable?
     
  35. Filto

    Filto

    Joined:
    Mar 15, 2009
    Posts:
    713
    Hi Beck

    Short question. What is the build size impact with using Vpaint? I assume that every layer and vpaint group will increase the size right?
    Working with mobile every kb counts so good to know the methods to keep thing down as much as possible.
     
  36. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    @KrisHammes,
    VPaint does create a temporary mesh collider on paintable objects while in the editor. This mesh collider is not added to the VPaint Object itself, however, so your object should not be modified. This mesh collider is not created during runtime unless IsDynamic is checked on the VPaintObject, IsDynamic is only necessary if you're using the advanced runtime API for things like AO baking or object blending.

    @Filto,
    The size is relatively small in most cases but it can get out of hand if you aren't aware of the implications. Meshes with a high number of vertices will obviously have a larger memory impact. Each layer in the group does increase the size, so if you're not using the layers during runtime it's a good idea to flatten your layers before release. Some developers use the build preprocessor to automatically flatten any VPaint Groups in a scene to avoid unnecessary data while still allowing you to keep your layers intact for the editor.
     
  37. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hi beck,

    "Can't remove MeshRenderer because VPaintObject (Script) depends on it"

    -- I basically only ever need to set vertex colours in editor as I clone my mesh from it when I batch it some 2k tiles. As part of this pre-build process (it happens before the game is built) I destroy meshes and generate my own. However, I keep the source gameObjects as these contain colliders. I do this to save on resources - I no longer have use for the original meshes. Is there a way to fix this?

    Regarding slow performance, I haven't found why yet but it may be garbage related, not sure.
     
  38. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    I think the best fix for your case would be to remove the VPaintObject before you remove the MeshRenderer. If you're not using VPaint to apply vertex colors during runtime, there's no need to have that object in the post-processed scene.
    If that's not an option, you can remove the [RequireComponent] attribute from VPaintObject - it's purely semantic and won't impact VPaint functionality in any way.

    As for the slow performance, this was only impacting the demo scene right? Just want to make sure the tool is useable for your actual workflow :)
     
  39. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's pretty slow on my own scene too, I'm fairly sure it's to do with my version of Unity (which is the Vita version) and will investigate once I get time to install the standard version - probably 4.5 final soon alongside it. I had to wait for the console version to not conflict with standalone versions.
     
  40. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Hm, alright. If you have any more information let me know, I'd like to get this resolved for you. PSVita version or not, I'd like VPaint to run smoothly :)
     
  41. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    Does vpaint still allow mipmapping to display? Havent noticed. Thanks
     
  42. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Alright here's some indepth info:


    Installing a fresh copy of Vpaint from asset store gives me an error in the demo scene:

    $8FHxTTu.png


    Painting (Unity pauses completely until I let go of mouse) - tolerable if I use the smallest possible brush radius:

    $nCl0x3V.png

    Gives a large spike and a large GC hit. It's as if it blows up with something recursive. Can take a few mins to recover if I held my mouse down.

    PC specs:

    I7 4770K @ 4.6ghz
    780 ti
    16gb ram
    1tb SSD

    Generally just mauls everything I throw at it, but this kills it stone dead :D
     

    Attached Files:

  43. sukibabee

    sukibabee

    Joined:
    Dec 19, 2013
    Posts:
    1
    This plugin is amazing! It's a steal. You should be glad I don't know where you live .. I wanna kiss you!

    I read through some of this thread and want to second a request from langem posted a while back re: per-vertex coloring. This is very much a missing feature for me. I'm painting 'low-poly-art-style' objects which lend themselves really well effects where strong contrast + sharp corners in areas are key (and to vertex AO as well). I do some of this with custom shaders, but would LOOVE to be able to paint this with your tool.

    I noticed the AO calculations produce per-vertex values .. (correcting or tweaking this begs per-vertex painting too):

    $Screen Shot 2014-05-11 at 4.34.29 PM.png

    Got two ideas for implementing this (both of which I'd like BTW):

    - have an option to isolate vertices by selecting them (which by itself is a generally useful feature forgetting per-vertex painting) ... with a suboption to isolate those vertices of polys that are fully selected ... i.e. you must select all 3 vertices of a poly for those vertices to be painted.

    - implement a per-poly paint mode where the center of the brush picks the poly, and affects only vertices of that poly within the radius of the brush .. kinda like how the 'quick selection' tool works in photoshop.

    On a different note, I notice that 1 CPU core is spinning close to 100% as long as the VPaint tab is open, even if it is in the 'disabled' state, and even if Unity isn't the currently active/selected application. I have to close the VPaint tab to stop this, and then open and redock again .. slightly inconvenient .. otherwise the laptop gets hot and fan going. I didn't see another post about this - wondering if anyone else sees this too. I'm on Mac platform - Unity v4.3.4.
     
    Last edited: May 12, 2014
  44. Eriks-indesign

    Eriks-indesign

    Joined:
    Aug 15, 2012
    Posts:
    50
    This asset is really awesome! but I was wondering if it was possible to make a shader that was "Unlit blend 2 textures lightmap supported" for my mobile game ;)
     
  45. beck

    beck

    Joined:
    Nov 23, 2010
    Posts:
    294
    Sorry for the late response guys, it's been pretty busy at Valkyrie.

    @hippocoder So I looked into the area where you're seeing performance slowdowns, and it's just the vertex color application in general that's going slow. Since you're the only once that's reported a slowdown of this magnitude, there must be something unique about your situation! Are you painting in an area with a high volume of vertices? Any chance you could try the same steps in a non-beta version of Unity? I don't have access to the Vita version, so it's a bit hard to debug that variable.

    @sukibabee Whoops! I would consider that AO effect you're seeing to be a bug. Each vertex does indeed do its own AO calculations, and split verts like that are producing different values. The method I'm using right now is to perform samples randomly, which is what is producing that result (each vert casts different random rays). Using a high number of samples should reduce the problem. However, I'd like to move over to a uniform model so that the samples are cast over a predictable area.

    As for the per-vert painting, I totally agree that it would be cool and additional requests for it bump it up higher on the priority list. I can't promise a timeframe for that one though, because it requires a fundamental change to how VPaint data is stored and I'm still trying to resolve the best approach to take for it. The second idea you posted falls under the same problem - I agree that sounds cool though, and I'll post more when I make progress on it.

    As for isolating vertices, that's high on my list and quite feasible. That's one of the big advantages that the vert coloring tools in Max/Maya and I'd like to change that :)

    The CPU drain you're seeing does seem off! I'm seeing it on my end as well and I'm looking into it for the next update.

    @Eriks.indesign Absolutely. I'm writing this post remotely and don't have access to the VPaint shaders to modify for you, so I will send you a PM in the morning with the modified shader.
     
  46. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Cleaning up leaked objects in scene since no game object, component or manager is referencing them
    InlineColorPicker has been leaked 1 times.

    Not sure why we keep getting this... Also noticed that sometimes vpaint will leave mesh colliders on objects, which we're having to clean up ourselves. We do have thousands of meshes in our scenes though, some scaled differently etc.
     
  47. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    If I am texturing two planes, that are next to eachother, with vpaint, do their uv maps need to fit within the outmost boundaries in order for the texture to tile across the two planes seamlessly? Thanks for this product beck!
     
  48. Yan_CDRIN

    Yan_CDRIN

    Joined:
    Jan 8, 2014
    Posts:
    4
    I just tried to use it, but it only shows the rgb painted on the model, not the two textures do not appear.
     
  49. MikeErty

    MikeErty

    Joined:
    Feb 24, 2013
    Posts:
    19
    I love your tool so far but i'm having an odd problem. This could be due to me being inexperienced with it though.
    I went through your pdf and video btw but still didn't see a way to fix this.

    I have an object - a bit of cliff.
    Top of the cliff needs gravel, sides need rock.
    I set up a vpaint object so i can start painting.
    My shader is a lit '4 blend textures' one with 4 textures assigned.
    Blue and Green slots are gravel and rock respectively.
    I isolate a channel to ONLY paint a green channel.
    I then use white to paint in the bits where I want the green channel to show.
    Then I switch to the blue channel and it too has white painted into it! This means it's impossible to paint purely gravel or rock (this happens if i isolate the blue channel and paint white too - it affects the green channel).
    The alpha and red channels work as expected though AND what's odd (and makes me think I'm being stupid) is that when I first used the tool I DID manage to paint purely rock on a part of the model!
    Have I knocked a button or something that I should be aware of? Does this sound familiar?

    EDIT: I've been working more with VPaint and noticed something else which may be linked?
    When I assign two textures in a lit 2 texture material one texture is in the red channel in the inspector, and the other is in the blue channel.
    However, when it comes to isolating channels to paint one texture or the other it seems to reassign them. I end up having to paint the GREEN channel in VPaint to get the texture that is stored in the BLUE channel in the material.

    Thanks!
     
    Last edited: May 30, 2014
  50. insiderrr

    insiderrr

    Joined:
    Feb 24, 2014
    Posts:
    50
    Hi, i'm now working with V paint and i have to say i love it. I only have 1 little issue with the tool, sometimes i can't activate Vpaint on a object, when i select the shader and add a vpaint group, it does not automatically open the program so i can't paint on the object.

    is there anyone who has the same problem ? sometimes it woks, but sometimes not, i can't figure out why this happens.