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

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:
    700
    @chaneya

    It was Version 1.5e I had the problem in ..
     
  2. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    Ok thanks. I guess it just took some time for the Asset store to post that version. Well hopefully I'll hear back from iRobi. I assume he is already planning an update to the Asset store with the required fix.

    Allan
     
  3. boyspanic

    boyspanic

    Joined:
    Nov 17, 2016
    Posts:
    10
    Today I upgraded to unity 5.5. Now I have the same PINK problem.
    I read #147 too. But I can't find any fix file.
    Where can I get the fix version?
     
  4. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    I have not done an update package, 30 november updated only meta data.
    Write me in p.m. please your e-mail, i will send the fix
     
  5. boyspanic

    boyspanic

    Joined:
    Nov 17, 2016
    Posts:
    10
    my email is *************@gmail.com
    Thank you! :)
     
    Last edited: Dec 3, 2016
  6. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Last edited: Dec 3, 2016
  7. boyspanic

    boyspanic

    Joined:
    Nov 17, 2016
    Posts:
    10
    It's Works perfectly!! Thanks for your support!!
    (Please remove my e-mail account on QUOTE:)
     
  8. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    iRobi,

    Thanks for the support. I got the fix and it works! :)

    Allan
     
  9. weaverfish

    weaverfish

    Joined:
    Dec 5, 2016
    Posts:
    11
    Hi iRobi

    Thanks for the great asset, really quick to get up and running and it works brilliantly most of the time. However I noticed some performance drops on complex models (for example, with multiple SkinnedMeshRenderers). Do you have any suggestions for maximising performance in UVPaint?

    Many thanks
     
  10. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    I'm glad to hear it) You always can leave review at Asset Store)
    Hi! Sure, for mobile games Texture must be less than 1024, and, I advice you to use minimal submeshes per GameObject (it will boost). Use rightly the Unwrapped Textures, which islands are not cover each other.
     
  11. Mr_Dss

    Mr_Dss

    Joined:
    Feb 3, 2016
    Posts:
    19
  12. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Hi!

    Great tool! I'm having some problems with the textures affected. Here is Before calling UVPAINT funcion:


    and after applying decal:


    Decal is correctly placed, but are some problems with the bump and metallic parameters as you can see.

    The code used is :
    Code (CSharp):
    1.         UVPaint.Normalized_DeepAlpha(1f);
    2.         UVPaint.ShaderPropertyName("_MainTex");
    3.         UVPaint.Create(target, transform.position, transform.rotation, Decal, UVPaint.DecalColor(Color.red), UVPaint.DecalSize(size));
    4.         UVPaint.ShaderPropertyName("_BumpMap");
    5.         UVPaint.Create(target, transform.position, transform.rotation, DecalBump, UVPaint.DecalColor(Color.red), UVPaint.DecalSize(size));
    I've tried the same character in a empty scene and it works fine. Dissabling post effects and reflections doesn't work. I know this has to be with something in the scene, but i can't find what is it... Any clue?

    Thanks!
     
  13. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Also, any way to mask the decal, so when you use BumpMap decal only affects the desired decal area?

    Thanks a lot!
     
  14. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Done!
    which layers are you use?
    Im so sorry, but masking is not supported by UVPaint yet(
     
  15. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Hi, Thanks for the reply.

    I don't know what layers are you refering to.. :(
     
  16. TopRamenGod

    TopRamenGod

    Joined:
    May 1, 2016
    Posts:
    3
  17. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Which method of applying decal are you use? Raycast or Collider contact?
    Done!
     
  18. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Since it is a cinematic, i just enable an object and in the OnEnable() call the UVPaint function. No layers, no colliders. Just a known target and the decal texture. As you can see in the pictures, the decal works fine. si placed where it should be, but it darkens all the textures affected. I can't reproduce the iissue in a blank scene, so i just ask you if you have any clue of what should be doing that... :)

    Thanks!
     
  19. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    It is so strange...
    Can you send me your scene?
     
  20. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Sorry mate, this scene is quite heavy. I can make a video showing all the stuff in there... But anyway, i can't reproduce that in a blank scene. I have no clue what is causing that, because i use the same prefab and light config and it works fine!

    Let me capture some video to show you!
     
  21. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Ok))
     
  22. boyspanic

    boyspanic

    Joined:
    Nov 17, 2016
    Posts:
    10
    Hi! I have another question.
    My character has a many body material parts.
    So...How can I apply decal to only the chest part(FWSMakaioTorso_1002)?
     

    Attached Files:

    • she.png
      she.png
      File size:
      100 KB
      Views:
      844
  23. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Hi! Now its possible to exclude only mesh gameObject, exclude materials not able yet. But you can store your original materials, and restore this after applying decals and destroy generated materials.
     
  24. boyspanic

    boyspanic

    Joined:
    Nov 17, 2016
    Posts:
    10
    Thanks for your quick support!
    But I have one more problems...

    This is the my character(8 shader)
    1.png

    But, when my character is decal applied, the shader multiplies.
    (I put my character in the example scene/ brush paint / and tested it)
    Is this normal?

    2.png
     
  25. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    It is normal, UVPaint create Instance of material, and works with this, but you can add this option before calling UVPaint.Create():
    UVPaint.EditAsSharedMaterial (true);
    After this, UVPaint will stop create Instances, but be careful, it will change original material!
     
  26. ndc1992

    ndc1992

    Joined:
    Jan 18, 2017
    Posts:
    15
    Hi !@iRobi I have some questions. I created a cube and Quad in unity,but its dont paint..then i use 3d software to create a cube and unwrap the uv after import..it can paint. why?
    In addition,I use the code to create a cube mesh,and it dont paint also.so,I want to know is what reason, or the use of the existing problems of is me?What's the solution?I hope it can finish painting on any model..
     
  27. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Hi! Thank you for reply. Did you try Demo Scenes?
     
  28. ndc1992

    ndc1992

    Joined:
    Jan 18, 2017
    Posts:
    15
    yes. I tried in the name of "Brush Paint" in the scene to create a cube ,but it dont paint..
     
  29. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Also, you must assign your GameObject in script
     
  30. ndc1992

    ndc1992

    Joined:
    Jan 18, 2017
    Posts:
    15
    yes..I have already assign the cube GameObject in script..I think I performed no problem..Don't you have encountered this problem?
     
  31. ndc1992

    ndc1992

    Joined:
    Jan 18, 2017
    Posts:
    15
    sorry..I find the problem.. Thank you for reply!
     
  32. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Sure! But can you please describe your solution?
     
  33. ShanabGames

    ShanabGames

    Joined:
    Oct 2, 2016
    Posts:
    1
    Hello, I'm having the pink problem, could you send me a fix to rawa@lambda-llc.com ?

    Regards.
     
  34. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Done! Check your e-mail please)
     
  35. ZorbaTHut

    ZorbaTHut

    Joined:
    Mar 19, 2014
    Posts:
    21
    I also need the fix - zorba@pavlovian.net . Can you just update it on the store? It's been months since you had the fix available.
     
  36. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    iRobi,

    I have an ongoing problem where UVPaint sometimes picks up textures from surrounding objects and applies those to the characters instead of using the list of damage textures I use for painting. I'm doing all of my painting during runtime between characters in combat. I have a list of damage textures that I am using for all characters but for some reason UVPaint is grabbing textures other than those and applying them. For instance, I have multiple characters in my scene that all use UVPaint to apply my damage textures during combat. Sometimes a character will be painted with another character's body mesh texture even though that texture is not one of my damage textures. At other times, a character will be painted with a texture pulled from a UGUI Canvas health bar texture that is childed to that same character but again the UGUI Canvas Health Bar texture has nothing to do with what I am painting.

    My guess is UVPaint has a problem with Statics and for some reason you are not distinguishing individual instances of UVPaint's use on multiple characters in the same scene. But of course I'm just guessing since I can't help debug your code because you're using a dll.

    Here is the code I use for UVPaint. It's nothing special.
    Code (CSharp):
    1.  int randIndex = Random.Range(0, decalTexturesList.Count);
    2.                         decalTexture = decalTexturesList[randIndex];
    3.                         decalRot = Random.rotation;
    4.                         float decalSize = Random.Range(.4f, .75f);
    5.                         UVPaint.ShaderPropertyName("_MainTex");
    6.                         UVPaint.Create(rootObj, contact.point, decalRot, decalTexture, UVPaint.DecalColor(decalColor), UVPaint.DecalSize(decalSize), UVPaint.isTwoSided(false));
     
  37. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    I think I found a big problem. Anything that I add to my characters during runtime that has a renderer gets a Restore Container added to the gameobject. In some cases in addition to a Restore Container, the object also gets a new Default Material Instance added that uses the default Unity Standard Shader. I have particle effects that I instantiate on my characters for blood splashes. None of them uses the Standard shader so why would UVPaint add a Standard Shader Material instance? And UVPaint appears to be altering and messing up particle effects that are on my character.

    Does this mean I have to an Ignore UVPaint component to every object in my game that may or may not be childed to my character hierarchy. This makes absolutely no sense.

    A better work flow would be have a component that you only add to those objects with renderers that you want involved in UVPaint.

    I just don't understand how UVPaint can be screwing with so much stuff on my characters when all it is supposed to do is alter the character Mesh Renderers. Why is it changing regular renderers?

    And of course the docs don't address anything about how UVPaint actually works.

    Allan
     
  38. YuYoshioka

    YuYoshioka

    Joined:
    Sep 7, 2016
    Posts:
    11
    Hi iRobi,
    I also have the "pink issue" with Unity 5.5.0p4.
    Could you send me (tmp1.abst@gmail.com) a fix?
    Thanks.
     
  39. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Done!
    Im so sorry! Can you send me a part of your scene? And ill try to fix all. Also i can send you source!
    Please contact me in p.m.
     
  40. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    iRobi,

    Thanks for responding. Unfortunately my project is too far along to be able to cut into pieces and attempt to package them into a scene but I'll see what I can do.

    Please understand I think UVPaint is great and there's nothing else like it on the Asset store as far as I know. I think it would help a lot if you could explain how UVPaint works in addition to how to use it.

    - How does UVPaint cycle through a character hierarchy and decide what to apply paint to when you call UVPaint.Create? How is this altered when objects are added to a character at runtime?

    - How does UVPaint decide what to apply as paint? Because my problem is UVPaint has a tendency to pick up textures and use them as paint from childed renderer objects that I add to the character during runtime on the same character I am painting with UVPaint.Create........unless I place an Ignore UV Paint component on those added objects.

    - How does UVPaint cycle through a character hierarchy and decide what to add a Restore Container component to when you call UVPaint.Create? And how is this altered if objects are added at runtime?

    - Does it apply paint to both Mesh Renderers and Skinned Mesh Renderers?

    - What does Ignore UV Paint component do exactly? From the docs you say, "If you want to protect a specific object from dealing of decals, just add Component Ignore UVPaint" Does Ignore UV Paint apply to both receiving paint as well as the texture to be used for painting?

    - Your Shooter demo scene still uses Legacy shaders. Do you plan to update your demos to use Unity's Standard shader and have you had a chance to work on applying Normal Maps with the Standard Shader?

    Thanks again. :)
     
  41. flippingkiwi

    flippingkiwi

    Joined:
    Jan 23, 2017
    Posts:
    7
  42. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Done)
    Check please p.m.)
    Please, in p.m.
     
  43. JUNGSEOWON

    JUNGSEOWON

    Joined:
    Feb 22, 2017
    Posts:
    1
    Hi!

    I also have the pink problem with Unity 5.5.0p3.
    Could you send me (jsw@studioandro.com) a fix?
     

    Attached Files:

  44. ZingFront

    ZingFront

    Joined:
    Aug 10, 2016
    Posts:
    4
    Hi,iRobi:
    can you email me the source code. my email is v@zxianstudio.com, many thanks!
     
  45. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Done)
    In p.m. please
     
  46. mojoceratops

    mojoceratops

    Joined:
    Feb 1, 2017
    Posts:
    3
    Hi iRobi, I'm also gettiong the pink-texture bug. Could you please send me the fix? My e-mail is sauriangame@gmail.com . Thank you!
     
  47. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    I just bought UVPaint and the ground just turns pink in the example Scene. Unity 5.5.0f3
    If you have a fix can you send to subspacegod@gmail.com?
     

    Attached Files:

  48. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Done)
     
  49. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    As I paint the sphere, the entire sphere starts to turn red and there is a band which cannot be painted.


    Code (CSharp):
    1. using iRobi;
    2. using iRobi;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5. using UnityEngine;
    6.  
    7. public class PaintFromMouse : MonoBehaviour {
    8.  
    9.     public Texture2D f1;
    10.     public Color color = new Color(1, 1, 1, 1);
    11.  
    12.     // Use this for initialization
    13.     void Start () {
    14.     }
    15.  
    16.     // Update is called once per frame
    17.     void Update () {
    18.         Vector3 worldPoint = GetComponent<Camera>().ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, GetComponent<Camera>().nearClipPlane));
    19.         RaycastHit hit;
    20.         Ray ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0f));
    21.      
    22.  
    23.         if (Input.GetMouseButtonDown(0))
    24.         {
    25.             if (Physics.Raycast(ray, out hit, Utility.GetPhysicsMaxRaycastDist()))
    26.             {
    27.                 UVPaint.NormalizedAlpha(1f);
    28.                 UVPaint.Normalized_DeepAlpha(1f);
    29.                 UVPaint.AngleInDegrees(Random.Range(0, 180f));
    30.                 UVPaint.DecalSize(Random.Range(1.5f, 3f));
    31.                 UVPaint.isTwoSided(false);
    32.                 UVPaint.Create(hit.collider.gameObject, hit.point + hit.normal, Quaternion.LookRotation(-hit.normal), f1, UVPaint.DecalColor(color));
    33.             }
    34.             else
    35.             {
    36.                 Debug.Log("Raycast failed");
    37.             }
    38.         }
    39.     }
    40. }
    41.  
    42.  
    Unity 5.5.0f3
    Sphere is a primitive sphere, 10x10x10
    Ground is a primitive plane
    Both with the standard shader
     

    Attached Files:

    Last edited: Mar 2, 2017
  50. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    My character has multiple SkinnedMeshRenderers. If I only call UVPaint.Create on the transform.root object, it either doesn't paint at all or corrupts one of the textures, turning it black.
    I had to write a function
    Code (CSharp):
    1. static public List<GameObject> GetRendererableGameObjectsFromRootRecursive(GameObject go)
    2.     {
    3.         SkinnedMeshRenderer[] l1 = go.transform.root.GetComponentsInChildren<SkinnedMeshRenderer>();
    4.         MeshRenderer[] l2 = go.transform.root.GetComponentsInChildren<MeshRenderer>();
    5.         List<GameObject> objects = new List<GameObject>();
    6.         foreach (SkinnedMeshRenderer r1 in l1)
    7.         {
    8.             objects.Add(r1.gameObject);
    9.         }
    10.         foreach (MeshRenderer r2 in l2)
    11.         {
    12.             objects.Add(r2.gameObject);
    13.         }
    14.         return objects;
    15.     }
    Then iterate through that list calling UVPaint.Create on all the objects to fix the problem.