Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

ZzZzZ UVPaint ( skinned mesh Decal+Texturing System) ZzZz

Discussion in 'Assets and Asset Store' started by iRobi, May 1, 2016.

  1. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    677
    Not sure, projects converted to 5.5.0b10 don't think I can roll them back.
     
  2. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Ok, i will fix it as fast as i can! Thanks for the patient
     
    Griffo likes this.
  3. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Good day! I fixed issue, i can send you the Fix, if you do not want to wait
     
  4. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    677
    Great news, yes please, send me the fix ..

    Thank you.
     
  5. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Done, please check your e-mail:)
     
  6. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    677
    Thank you, got it, and now it's working ..
     
    iRobi likes this.
  7. Siccity

    Siccity

    Joined:
    Dec 7, 2013
    Posts:
    205
    Hey iRobi! Back again with more favors to ask :]
    The shader parameter works great!
    However..
    UVPaint doesn't paint on pixels that have 0 alpha, but i need it for my 'overlay' shader, which has a 100% transparent texture to paint on.
    Is this something you could add as an UVPaintOption?

    Thank you
     
  8. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Hi)
    Did you try to work with mixed alpha textures? Or you used only full transparent Textures?
     
  9. Siccity

    Siccity

    Joined:
    Dec 7, 2013
    Posts:
    205
    Well the full scenario is that my artist made some rigged monsters which have a mirrored UV. If i paint on the UV, it will paint on both sides. I thought of a solution for this problem; unwrap the monster again differently on another 'overlay' UV layer, meant for UVPaint only. I wrote a shader for it and it works perfectly except that the 'overlay' has to start out completely clean (full transparent) but then UVPaint doesn't want to paint on it.
     
  10. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Which UV chanel used?
    Can you send to me part of your project? I will try to fix it
     
  11. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    404
    I'm looking to purchase this for my project....got a few questions. I'm new to Unity....

    1. Since UV bakes into the unwrap texture....does this mean that if I have 2 characters using same mesh and materials...they both will get decals at same time? ( i don't want this)

    2. I'm making a VR game and resources are at a premium...do you have any data on performance ?

    3. I pool my dead characters by disabling their game objects when they die and reuse them by enabling. Can I remove the blood decals on inactive game objects ?
     
  12. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Hi!
    UVPaint has some options, which provide you choose Material mode. At standart, UVPaint does not create decals on all at once Shared Materials. Dont worry.
    UVPaint bakes decals, which means does not load the processor, only at creating. For Example, my VGA 650 Ti provide 60 fps at calling UVPaint.Create() every frame. (1920x1080 size monitor max 60 fps)
    Yes, of course, but this is not necessary, because it changes only a given texture at Shader Property.
    Your welcome)
    I will glad to ask on your questions!
     
  13. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    384
    Hello. I want to draw decals in alpha, occlusion, and normal channels. How can I do this?
     
  14. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Hi! Just write before UVPaint.Create():
    UVPaint. ShaderPropertyName ("_BumpMap").
     
    id0 likes this.
  15. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    404
    Ok, I just purchased UVPaint.

    im having an issue getting raycast to work with it. I made a quick video showing the issue.

     
  16. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Hi! Thank you very much for the detailed description of the problem! UVPaint does not support repeat UV like an ground on your video, just Unwrapped, please see at Color Play demo, which show the right UV of Environment and Characters.
    About hair, i suggest to add to hair gameobject Ignore UVPaint component, this must help.
    Sorry for the inconvenience!
    I will glad to ask for your questions!
     
  17. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    404
    Thanks, I understand about the environment. I'm not looking to paint that.

    My main issue is that the Raycast won't paint the characters. They can be painted using a collision, but the raycast won't work as I showed in the video. Why is that?
     
  18. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Oh, yes, i missed that. Please, change hit.point (Second Parameter of the UVPaint.Create) to Initiator of the Ray, i think this is transform.position in your code
     
  19. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    404
    Like this?

    UVPaint.Create(hit.transform.root.gameObject, transform.position, hit.transform.rotation, bloodDecal, UVPaint.DecalColor(color), UVPaint.DecalSize(Random.Range(1f, 3f)));

    That doesn't seem to work either :(.
     
  20. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    404
    Its weird, because I see the "Restore Container" script being put onto the character...so the character is clearly being hit with the raycast with UVPaint.
     
  21. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    use Ray rotation (seems transform.rotation) instead hit.transform.rotation.
    1 parameter - is gameObject who must receive decals
    2 parameter - is position of the Decal Projection. Like Direction light.
    3 parameter - is rotation of the Decal Projection. Like Direction light.
    4 parameter - is texture of the Decal
     
    julianr likes this.
  22. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    1 (2).jpg 2 (2).jpg
     
    julianr likes this.
  23. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    404
    Got ya...I'm trying that now...thanks for the help!
     
  24. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    404
    I FINALLY got it working. That worked! Thanks A LOT for the help!
     
    julianr likes this.
  25. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    387


    Hey @iRobi great plugin here's the results
     
  26. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Glad to help)
    Cool project, I will subscribe to the news!
     
    punk likes this.
  27. boyspanic

    boyspanic

    Joined:
    Nov 17, 2016
    Posts:
    10
    Many asset developers are offering a YouTube video of how to build a basic demo screen. :)
    But I could not find a Youtube video for UVpaint.
    So I bought UVpaint, but I can not use it.
    I am sad and painful now!(I don't know c #.....)

    Could you please show me how to configure a basic scene as a YouTube video?
    Please Help me!
     
  28. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Oh) You are welcome! Hmm, integration of UVPaint is not so hard, just call UVPaint.Create(TargetGameobject, SpotPosition, SpotRotation,TextureDecal);
     
  29. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    I can record Video, but needs at least a little bit code)
     
  30. paulbettner

    paulbettner

    Joined:
    Jan 13, 2014
    Posts:
    9
    Has anyone asked about the streaks that happen with the example scene? There seem to be clamping artifacts or something strange like that.
     

    Attached Files:

  31. boyspanic

    boyspanic

    Joined:
    Nov 17, 2016
    Posts:
    10
    Oh! Thank you! You are my best developer!
    Have a good day and thanks for everything!
     
  32. Siccity

    Siccity

    Joined:
    Dec 7, 2013
    Posts:
    205
    Ah sorry i haven't responded yet. I sent you a link to a part of my project on contact@irobi.uz.
    It contains 1 enemy mesh with a mirrored primary UV and a secondary UV that is setup for UVPaint.

    It has 2 issues:
    1. UVPaint does not paint on secondary UV channel
    2. UVPaint does not paint on invisible (100% transparent) textures
    Thank you :)
     
  33. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    412
    Just wondering if anyone has been able to get UVPaint to work with Normal Maps on the Standard Shader since the Standard Shader is what you are most commonly going to use on Skinned Meshes. None of the demos use the Standard Shader so I have no idea if this is even possible.

    Here is the code I'm using:
    Code (CSharp):
    1. UVPaint.ShaderPropertyName("_MainTex");
    2. UVPaint.Create(rootObj, contact.point, decalRot, decalTexture, UVPaint.DecalColor(decalColor), UVPaint.DecalSize(decalSize), UVPaint.isTwoSided(false));
    3. UVPaint.ShaderPropertyName("_BumpMap");
    4. UVPaint.Create(rootObj, contact.point, decalRot, decalTextureNRM, UVPaint.DecalColor(decalColor), UVPaint.DecalSize(decalSize), UVPaint.isTwoSided(false));
    The normal map is being applied but it looks like it's simply being overlaid on top of the Main Texture. It severely dulls the color of the main texture, does not appear to provide any kind of normal/bump effect and I'm not even sure it is aligned correctly with the Main Texture even though I am using the same size and rotation for both textures.

    I have found that it does a better job if you have the Normal Map Wrap mode set to Clamp instead of Repeat but other than that it does not look to me like it is being used as a Normal Map.

    Thanks
    Allan
     
  34. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Hi! Try to disable mipmaps at Decal Textures
    Ok)) Today it will be done!
    Oh, no, can you send me link in p.m? Because contact@irobi.uz has some problem.
    Hi! Do you use Normal Map Decals?
    Please assign at least empty texture to Normal in Standart shader, because it precompiled shader
     
  35. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    412
    Um yes I'm trying to use Normal Maps with my Decals. I'm not exactly sure what you are asking. Your question isn't very clear.

    Let me try to clarify for you. I am using the Standard Shader with my game characters. I use Substance Painter to create the textures for the characters. This is a very typical setup. Each of the character materials uses the Standard Shader in rendering mode Opaque with 4 textures applied to the shader; Albedo, Metallic, Normal Map and Occlusion. These are the textures you create when you use Substance Painter or if you purchase just about any character model on the Asset store that uses the Standard Shader.

    The Normal Map slots on my material Standard Shader are already populated with Normal map textures. So I don't understand what you mean when you say assign an empty texture to Normal in Standard Shader. That makes no sense. I already have a normal map texture in that slot because my characters all use Normal Maps.

    I'm using a Main Texture and a Normal Map texture and following your instructions on how to use both of them together. (See the code I posted above.)

    Here is my very typical use of Standard Shader for my characters:
     

    Attached Files:

  36. boyspanic

    boyspanic

    Joined:
    Nov 17, 2016
    Posts:
    10
    I still don't know how to use UVpaint...T_T

    Here is my plan.

    1. Object A and Object B are Crash.
    2. A crash mark spawned on object A
    3. Wait for 1 second...
    4. The crash mark of object A is fadeout 'disappear'

    Video Tutorial Please...
     
  37. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    yes yes, today it will be done!
    Evetything is right!
    And... Please, show me, which Texture Decal you use for Normal Maps!
     
  38. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    412
    iRobi,

    Thanks for responding so quickly. I think I got it working after recreating my normal map several times and messing with decal size. I'm using the Filter/Generate Normal Map feature in Photoshop CC to create my normal maps for decals. I wish it had more of a Bump effect but at least it looks aligned correctly and the coloration is good when using the Main Texture and the Normal Map together.

    Here are some screen shots of my player character. The first shot is MainTex only. The second shot is Main Tax plus Normal Map.
    SlashOnPlayerMainTex.PNG SlashOnPlayerMainTexWNrmMap.PNG

    And here are the Textures I created.
    SlashMainTex.PNG SlashNRM.PNG

    Here is the decal with Main Tex and Normal Map viewed on some primitives (not using UVPaint).
    SlashOnPrimitives.PNG

    PS: Sorry but I posted incorrect information in this post. I wasn't actually applying a Normal Map when I ran this test to grab the screen shots. I was applying a null Texture2D. I forgot to assign the Normal map to my sword collider prop.
     
    Last edited: Nov 19, 2016
  39. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    I glad to see that all works! I look forward to create video tutorial by your post.
    If you have any questions, i will glad to ask!)
     
  40. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    412
    My mistake. When I set that up for a test so I could screen grab pictures, I failed to assign a Normal Map texture to my sword Collider Prop. So I was applying a Main Texture and then an empty Texture2D to the Normal Map. Sorry about that.

    It worked because I wasn't actually applying a Normal Map using UVPaint. I was applying an empty/null Texture2D instead of a Normal Map.

    Here are pictures when I apply the Normal Map:
    The first pic is Main Texture Only. The second pic is a Main Texture and then a Normal Map.
    SlashOnPlayerMainTex.PNG SlashOnPlayerMainTexWNrmMap.PNG

    In the second picture where I apply both a Main Texture and a Normal Map, it looks like the Normal Map is not being applied correctly. It looks like it's being applied over the entire model instead of aligned correctly with the Main Texture Decal. It looks like the two textures are not lining up correctly with each other because you can see the entire model is discolored by the Normal Map texture and it even darkens the tone of the Main Texture Decal like it's being applied on top.

    As far as I can tell, UVPaint does not work with Standard Shader using Normal Maps. Since my normal maps seem to work on a regular primitive model, I assume they should work on a Skinned Mesh character but it looks like UVPaint is doing something wrong with them.

    Let me know what you find when you start testing this for a video tutorial.

    Here is the code I am using to paint my textures:
    Code (CSharp):
    1.   UVPaint.ShaderPropertyName("_MainTex");
    2. UVPaint.Create(rootObj, contact.point, decalRot, decalTexture, UVPaint.DecalColor(decalColor), UVPaint.DecalSize(decalSize), UVPaint.isTwoSided(false));
    3. UVPaint.ShaderPropertyName("_BumpMap");
    4. UVPaint.Create(rootObj, contact.point, decalRot, decalTextureNRM, UVPaint.DecalColor(decalColor), UVPaint.DecalSize(decalSize), UVPaint.isTwoSided(false));
    Thanks
    Allan
     
    Last edited: Nov 19, 2016
  41. boyspanic

    boyspanic

    Joined:
    Nov 17, 2016
    Posts:
    10
    I'm still waiting...
     
  42. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Im so sorry for delay! Now i keep making video, almost done:)
    I made some tests, and yes, you right, there is some problems with Bump map. I will fix it as fast as i can!
     
  43. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    73
    I have a character that I'm projecting a decal onto.
    I seem to have the correct Spot position and the correct Spot Rotation because the decals do appear.
    However the material changes white more and more after each hit. It's also place streaks on the materials. Like so...

    My 2D texture is clamped. 128x128
    Layers 29,30,31 are not being used.
    The Spot point is .15 away from the target.
    The Spot rotation seems to be in the right direction, see attached image.
    The character is using the standard Unity shader.
    Unity 5.4.1


    No idea why this is so hard to get working.
     

    Attached Files:

    • SC8.jpg
      SC8.jpg
      File size:
      102.2 KB
      Views:
      526
    Last edited: Nov 25, 2016
  44. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Hi! Try please turn off mip maps. It may help
     
  45. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    73
    I forgot to mention that I did that already. I copied all the setting for the splash texture provided in the demo.

    Okay I finally figured this out.
    The decal in question cannot have any pixels on it's border.
    In other words make sure the border for your decal is fully transparent.
    YOU really need to document this stuff. You'll not only save yourself tons of time and therefore money , you'll be doing the same for everyone else.
    I spent over 18 hours on this one tiny little problem and that sir is b.s.
     
    Last edited: Nov 26, 2016
  46. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    My mistake sir! In next update, i will fix transparent borders of the decals.
    Done)
     
  47. boyspanic

    boyspanic

    Joined:
    Nov 17, 2016
    Posts:
    10
    Thank you!!!!
    I could understand a little about raycast-decal!!!!! :)
    Finally I can use the UVPaint in my game!!!!!

    and...Can you tell me 'how to get the raycast-vector3 of the mouse clicked position'?
     
  48. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    412
    Just a heads up but UVPaint is incompatible/broken with Unity's current release, version. 5.5. Trying any of the demos scenes just results in Pink being splattered on the models.

    I imported UVPaint into a new Unity 5.5 project and your shaders are incompatible. I'm using a desktop PC with Windows 10 and a common NVidea GPU. It looks like your shaders need to be updated. They don't even compile.

    Here is the warning message on your shaders:
    Shader warning in '': Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)

    This applies to the 3 shaders you have in your plugins folder as part of the pack material.

    You also have several warnings in your demo scripts because you are using outdated particleEmitter commands.

    Allan
     
  49. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    677
    Hi,

    Take a look at post #147
     
    iRobi likes this.
  50. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    412
    Griffo,

    Thanks.

    I guess I'm confused. If iRobi had the fix for this back in early November, why didn't the fix it show up in version 1.5e that was submitted to the Asset Store on November 30th?

    I guess we'll need to hear from the author.

    Allan
     
    Griffo likes this.
unityunity