Search Unity

ZzZzZ UVPaint ( skinned mesh Decal+Texturing System) ZzZz

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

  1. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    OKOK so its like adding a new property to the shader what will do the trick.

    In the case that decal texture is not applied with the modified shader it will look the same as now? Because the models will also be used online and at this moment I don´t know if I will be able to transfer the decal texture data

    One last question.

    I see the car example, this is totally mind blowing. The thing is, how is that texture saved?
    It does create a new texture file that needs to be applied to the shader in runtime? In that case, the texture can be opened in photoshop for fine tuning?
     
  2. Tomza

    Tomza

    Joined:
    Aug 27, 2013
    Posts:
    596
    But how to save your work to be permanent? For example, I applied some decals on an object and I serialize the object and restart the application. Now, all changes are lost. How to make them permanent? When i open the application all decals should be there, on the object.
     
  3. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Yes that would be great so the players can generate their own skins and have them available in next session. I was expecting to save these as NPOT and be able to load them, eagerly waiting for devs answer on this XD
     
  4. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Hey guys! There are two ways to save your painted result:
    UVPaint.FIX(Renderer REN,string PathToSaveImage); -this fuction save all changed texture at custom path.
    And the second way is:

    Code (CSharp):
    1. static public Texture your_Texture;
    2.  
    3. void AfterPaint()
    4. {
    5.     your_Texture = material.mainTexture;
    6. }
    7.  
    8. void OnLoadNewScene()
    9. {
    10. material.mainTexture = your_Texture;
    11. }
     
  5. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I also noticed looking at videos demo images... That your decals are allways monochrome. Isnt it poasible to project decals like a grafitti? rgb colored decals?
     
  6. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Sure! You can use any textures for decals)
     
  7. Tomza

    Tomza

    Joined:
    Aug 27, 2013
    Posts:
    596
    I use the code for the button:
    Code (csharp):
    1.  
    2. public void OnSaveDecal(){
    3.            UVPaint.FIX(paintTarget.GetComponent<Renderer>(), Application.persistentDataPath);
    4.        }
    5.  
    When I restart the app, NO DECALS! What's wrong?

    The png file is saved in the folder, but how to apply it again automatically. Or just I need to use IO and searching the file manually?

    I did that. But now the problem is that I have no influence on the saved texture name. I can save only one texture. What if I want to save more than one texture? Texture0, Texture1, Texture2, etc.? How to save the texture with my own name?
     
    Last edited: May 7, 2017
    TooManySugar likes this.
  8. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Awesome then. Gonna buy likely. Looks like we all have same doubts. Me also would like to have control over texture name because now I load the skins by texture name. VEHICLENAME_skin_0 ...1... 2 etc....
     
  9. McShooterz

    McShooterz

    Joined:
    May 11, 2014
    Posts:
    1


    Code (CSharp):
    1. UVPaint.Create(hit.collider.gameObject, hit.point + hit.normal * 0.5f, Quaternion.LookRotation(-hit.normal), TargetHitTexture, UVPaint.DecalSize(0.03f));
    I am working on a shooting range system that uses cloth physics for the paper targets. The problem comes when I ray cast to the target in a spot forward of the mesh collider. I included an image showing an area in the bottom left of the target that is in front of the collider and is not receiving bullet holes.

    Edit: I just had to move the spot position further from the target, and now it seems to work.
     
    Last edited: May 8, 2017
  10. Aleksei-Kolotilov

    Aleksei-Kolotilov

    Joined:
    Jun 3, 2015
    Posts:
    17
    Strips on the texture. What could be the problem?
     
    Last edited: May 9, 2017
  11. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Can anyone confirm if it is possible to save texture with custom name? or prefix or similar?
    Is it possible to paint a vehicle that has multiple elements with the same brush like paint bonet and chassis each having different material?
     
    Last edited: May 9, 2017
  12. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Guys, there is a solution(not tested):
    Texture2D bla = (renderer.mainTexture as Texture2D)
    bla.EncodeToJpg(path+"fileName.jpg")
    Cool, but please, can you tell me, your quad, have Unwrapped UV?
     
  13. Aleksei-Kolotilov

    Aleksei-Kolotilov

    Joined:
    Jun 3, 2015
    Posts:
    17
     
    TooManySugar likes this.
  14. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    This happens because UVPaint use Depth Map, and z-fight appear. Tell me, which version of unity are you use
     
  15. Aleksei-Kolotilov

    Aleksei-Kolotilov

    Joined:
    Jun 3, 2015
    Posts:
    17
    Unity 5.6.0f3
     
  16. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Ok, now try to find PaintPC.shader and
    Change:
    float Depth = sampleShadowmap( i.sh.xy, 1-i.dpth*0.995 ); //to 0.991
    it must help
     
  17. Tomza

    Tomza

    Joined:
    Aug 27, 2013
    Posts:
    596
    In my case the code should look in this way:

    Texture2D bla = (paintTarget.GetComponent<Renderer>().material.mainTexture as Texture2D);
    bla.EncodeToJPG();

    There is no the path plus the file name in side the EncodeToJPG(), so where should I insert the path?
     
  18. Aleksei-Kolotilov

    Aleksei-Kolotilov

    Joined:
    Jun 3, 2015
    Posts:
    17
    If the distance to the subject is greater than 1 meter, then all is well. If more, then strip.
     
    Last edited: May 11, 2017
  19. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I recently got the asset.
    It imports and sample scene runs fine in 4.7.2 but the zombie project is a separate package and when I try to import in a clean project I get this error:
    upload_2017-5-12_4-5-20.png

    Console shows this:
    Error while importing package: Couldn't replace asset C:/Program Files (x86)/Unity4.7/Editor/Data/UnityExtensions/Unity/GUISystem/4.7.2/UnityEngine.UI.dll
    Failed to move asset from Temp/Export Package/ec63683a16409584f91837d740e6d867/f5f67c52d1564df4a8936ccd202a3bd8/asset to C:/Program Files (x86)/Unity4.7/Editor/Data/UnityExtensions/Unity/GUISystem/4.7.2/UnityEngine.UI.dll

    Please help.
     
  20. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Ok looks like you placed this by mistake o_O
    upload_2017-5-12_4-9-14.png
     
  21. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    The issues instead of being distance related looks more like is related to the material is has projected on because the blood on the floor just by the green surface has no stripes.
     
  22. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    The zombie project almost works perfect, please polish the package.
    The garage car paint works perfect but it seems it can not bake texture. And then when I launch the race I get:

    RenderTexture warning: Destroying active render texture. Switching to main context.

    MissingReferenceException: The object of type 'RenderTexture' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    CarController.Start () (at Assets/iRobi/ZombieRace/Game/Scripts/CarController.cs:52)

    Please import it in 4.7.2 and see it by yourself, sure its a silly thing because the painting works amazingly. Also when it returns from the race it is covered in blood so it is like 99% working!

    EDIT: Strange and good, I did again test and paint--> Bake--->Start and its
     
    Last edited: May 12, 2017
  23. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I could not find the ui in the garage and finally found the script that generates it at runtime, that is a bit strange TBH, further, is it using the legacy UI??? I can´t find the canvas anywhere. If so that is a bit disappointing.
    I know you plan not updating more for 4.x but PLEASE update to 4.6UI wich is compatible with 5.x UI prior to abandoning 4.x support.

    I think that it could be easy even for me, I'll try but I'm soo freaking busy, I see the buts "just" call functions, may be the palette part seems the trickiest part. Sure that for a pro like you this has to be a breeze to port to 4.6UI
     
    Last edited: May 12, 2017
  24. borderlineinteractive

    borderlineinteractive

    Joined:
    Sep 20, 2015
    Posts:
    14
    Hi,

    I can run the example scene (UV Paint Place) nicely in the editor, but I get many errors if I try to compile it in Xcode for iOS/iPhone. This is a short summary of the type of errors/warnings:

    /Users/user_id/unity/test_uv_paint/uv_paint_test/Classes/UI/SplashScreen.mm:355:10: 'wantsFullScreenLayout' is deprecated: first deprecated in iOS 7.0

    /Users/user_id/unity/test_uv_paint/uv_paint_test/Classes/Unity/CMVideoSampling.mm:4:10: Non-portable path to file '"GlesHelper.h"'; specified path differs in case from file name on disk

    /Users/user_id/unity/test_uv_paint/uv_paint_test/Libraries/libil2cpp/include/codegen/il2cpp-codegen.h:368:1: Control may reach end of non-void function

    /Users/user_id/unity/test_uv_paint/uv_paint_test/Classes/Native/Bulk_iRobi_0.cpp:1994:48: Cast from pointer to smaller type 'int32_t' (aka 'int') loses information

    /Users/user_id/unity/test_uv_paint/uv_paint_test/Classes/Native/Bulk_iRobi_0.cpp:2030:10: No viable conversion from returned value of type 'il2cpp_array_size_t' (aka 'int') to function return type 'UIntPtr_t'

    /Users/user_id/unity/test_uv_paint/uv_paint_test/Classes/Native/Bulk_iRobi_0.cpp:3063:142: Implicit conversion loses integer precision: 'intptr_t' (aka 'long') to 'int32_t' (aka 'int')

    Any ideas what might be wrong would be very helpful.

    System configuration:
    Unity 5.6.0f3
    Xcode 8.3.2
    Compiling for iOS

    Best wishes,

    Borderline Interactive
     
  25. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @iRobi

    Hi, why does my main texture darken slightly when a decal is added ?

    Thanks..
     
    Last edited: May 23, 2017
  26. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Hey gus, sorry for delay
     
  27. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    This demo are only to show, how UVPaint works, but i will try to polish this)
    Hi, might be dll is incompatible. I can send you rebuilded version for IOS
    It happens after update?
     
  28. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Yes, I'm using 1.7a
     
  29. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I downloaded 1.7a and son after it appears as there is an update an still says 1.7.a so may be there where some minor fixes done and versión number was kept.
     
  30. Homeak16

    Homeak16

    Joined:
    Feb 27, 2017
    Posts:
    19
    Hi everybody,
    can someone help me please.
    i'm trying to spawn a decal only over one mesh. I mean that if i spawn on border of one mesh, is behind is another, each mesh receive a part of decal, but i need that first receive all of it.
    Thank you.
     
  31. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Please, provide screenshots. And... If you can, part of your scene in .unitypackage
    Hi! Try please write this "UVPaint.IsTwoSided(True);" before calling UVPaint.Create();
    If i understand you right
     
  32. netincome2

    netincome2

    Joined:
    Nov 8, 2014
    Posts:
    14
  33. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    I have a character with 3 different LODs for the mesh.

    I noticed that UVPaint only writes to one of them. Is an option to have it write to all 3?
     
  34. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    Also, it seems that performance has taken a hit as of late.

    I'm already using "UVPaint.IsTwoSided(True)" (its done once and cached)

    Questions:
    1. Can UVPaint.IsTwoSided(True)" be called only in the Start Function...or should it be called everytime I call UVPaint.Create?
    2. Is there anything else I can do to increase performance?

    Here is my create call....
    UVPaint.Create(hit.transform.root.gameObject, transform.position, transform.rotation, bloodDecal, UVPaint.DecalColor(Color.red), UVPaint.DecalSize(Random.Range(minTextureSize, maxTextureSize)));
     
    Last edited: Jun 8, 2017
  35. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    I vote for the performance optimization. I tried UV-Paint, it paints well on any Skinned Mesh. It is just not cheap on cpu cost, and triggers GC calls if using often.
     
  36. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    Edit :)
     
    Last edited: Jun 14, 2017
  37. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    I think I've found the issue with performance in my game. Characters that use Unitys LOD system seem to be affected by performance issues as it runs much better when I use it on characters without LOD.

    Does UVPaint have to cycle thru the LOD's to find LOD0?

    If this is the case, is there a way for me to specify LOD0 in the options to keep performance up?
     
  38. Tomza

    Tomza

    Joined:
    Aug 27, 2013
    Posts:
    596
    I haven got your answer, so I copied my post:

    In my case the code should look in this way:

    Texture2D bla = (paintTarget.GetComponent<Renderer>().material.mainTexture as Texture2D);
    bla.EncodeToJPG();

    There is no the path plus the file name in side the EncodeToJPG(), so where should I insert the path?

    How to save many textures on disk with decals?
     
  39. Tomza

    Tomza

    Joined:
    Aug 27, 2013
    Posts:
    596
    I made a mesh in Blender for sculpting in Unity. I would like to use your Decal painting to it, but Unity is blocked up and I need to kill the Unity process. Other meshes work great. Could I send you the mesh for testing?
     
  40. ndc1992

    ndc1992

    Joined:
    Jan 18, 2017
    Posts:
    15
    hi iRobi ! How to work on mobile? I build apk to testeit and found it was not working. How do I set it.
     
  41. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    bla
    Yeap, it happens due to the difference Unity versions.
    Guys, after using UVPaint.Create(); you can manually set edtitable material to all LOD GO. Because UVPaint can not do it from box.
    We hard try to improove perfomance, but now without any success((
    Try to use:
    Texture2D bla = ...;
    System.IO.File.WriteAllBytes("C:/folder/image.hpg", bla.EncodeToJPG());
    Sure!
    Hmm, did you try to compile Demo scenes?
     
  42. ndc1992

    ndc1992

    Joined:
    Jan 18, 2017
    Posts:
    15
    upload_2017-6-14_18-13-5.png
    The model that is clicked may be missing the material.How to solve?I remember showing support for Andriod on the product description.
     
  43. devdreamstudio

    devdreamstudio

    Joined:
    Dec 13, 2016
    Posts:
    5
    Hello iRobi . I've seen the videos where you paint the BMW , i'm making a racing game with more than 20 different cars and a system to switch between the cars , and a simple texture changer !!!! , BUT i'm wondering if i can use this asset to make the player paint any car selected and the changes will remain , and also i'm wondering if it's compatible with my scripts , please help me i'm interested
     
  44. Tomza

    Tomza

    Joined:
    Aug 27, 2013
    Posts:
    596
    It seems your email on your website doesn't work. How can I contact you to send you the 3D model?
     
  45. iRobi

    iRobi

    Joined:
    May 1, 2016
    Posts:
    170
    Yes, all right. UVPaint is support Android. Can you record some video?
    Hi! Yeap, but your models must have Unwrapped UV's
    in p.m
     
  46. zeekindustries

    zeekindustries

    Joined:
    Jun 4, 2010
    Posts:
    19
    Hello iRobi!

    Just to let you know that I just got this system, working just great for the kind of game we are trying to do.
    I was testing with 5.6.0 but recently moved to 5.6.1 and when building I get 4 of this errors:

    Shader error in 'iRobi/PaintOneSide': invalid vs_3_0 output semantic 'half' at line 151 (on d3d9)

    Compiling Vertex program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA

    They appear on PaintOneSide (line 151) and RestorePC (Line 182)

    So far it hasn't shown any problem of sorts but I guess it may be something you want to look at. Cheers and thanks for this awesome system!
     
  47. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    Just got this asset. It's very easy to use.

    However, I'm getting really ugly seams when projecting. Is there a way to fix this?

     
  48. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    There seems to be some very visible artifacts when projecting.



    These don't appear if projecting double sided.
     
  49. ndc1992

    ndc1992

    Joined:
    Jan 18, 2017
    Posts:
    15
    I really don't know what happened.I don't know how to solve this problem.The PC side is normal but the target material is lost when the build Apk is then draw
     
    Last edited: Jun 21, 2017
  50. rathoddhaval

    rathoddhaval

    Joined:
    Mar 1, 2014
    Posts:
    2
    Hi iRobi when i try your ZombieRace demo it works perfectly in editor but when i try to run in android its not working. i m getting this error when i try to paint on car.

    DllNotFoundException: MonoPosixHelper
    at (wrapper managed-to-native) System.IO.Compression.DeflateStream.CreateZStream (System.IO.Compression.CompressionMode,bool,System.IO.Compression.DeflateStream/UnmanagedReadOrWrite,intptr) <0x0007c>
    at System.IO.Compression.DeflateStream..ctor (System.IO.Stream,System.IO.Compression.CompressionMode,bool,bool) <0x00187>
    at System.IO.Compression.DeflateStream..ctor (System.IO.Stream,System.IO.Compression.CompressionMode) <0x00037>
    at (wrapper remoting-invoke-with-check) System.IO.Compression.DeflateStream..ctor (System.IO.Stream,System.IO.Compression.CompressionMode) <0x00057>
    at (wrapper dynamic-method) A.c6bd45df5e2e09e5d32ff2032fa0b7126. (System.IO.Stream,System.IO.Compression.CompressionMode) <0x00057>
    at A.c6bd45df5e2e09e5d32ff2032fa0b7126.c101d5916ab26015c15e97c0e46f315bb (System.IO.Stream,System.IO.Compression.CompressionMode) <0x00033>
    at A.c45820792c0d1ea209380bc3ac17f81c7.cc984090c48a5d5abb52f8b8ce92003e7 (long,System.IO.Stream) <0x0046b>
    at A.c45820792c0d1ea209


    Its seems like error come when try to call this function
    UVPaint.Create(Obj,Brush.position,Brush.rotation,brush[BrushInt],UVPaint.DecalSize(3.3f*proj.orthographicSize),UVPaint.DecalColor(SetColor));