Search Unity

Creative [RELEASED] PaintZ - Splatoon like paint system

Discussion in 'Tools In Progress' started by bocs, Oct 8, 2017.

  1. ChainsawFilms

    ChainsawFilms

    Joined:
    May 28, 2016
    Posts:
    18
    Very pleased to see the URP update, great work!

    Anyone using this in XR will need to add the following line to CreateCamera() in PaintTarget.cs

    renderCamera.stereoTargetEye = StereoTargetEyeMask.None;

    Else the camera being created is stereo and you'll have Matrix errors with camera.Render() calls.
     
  2. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Thanks, I'll make sure that is put into the next update.
     
  3. ColeChittim

    ColeChittim

    Joined:
    Aug 11, 2011
    Posts:
    59
    Hey @bocs
    Was wondering if there is any way to alter the alpha of the paint splats? The alpha value on the shader seems to be in respect to the whole object and changing the alpha on splat colors seems to have no effect. I'm using the new URP shaders if that affects anything.
    Thanks
     
  4. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Use Shadergraph, and you can make any variation you can think of.

    I'm not going to just give the shader, but show you how...like the old saying teach a man to fish.

    The idea is very simple, just lerp between painted and not painted.

    Step 1 - Create a copy of PaintStandard and rename so we are modifying a copy.
    *VERY IMPORTANT - always start the name with "Paint"
    Step 2 - Create Material, change to our New Shadergraph
    Step 3 - Add new property to our shader, and set default to 1
    Step 4 - Add lerp node
    Step 5 - Connect Original Texture, Paint, and Alpha to lerp node
    Step 6 - Connect Lerp output to Albedo, and save

     
  5. ColeChittim

    ColeChittim

    Joined:
    Aug 11, 2011
    Posts:
    59
    Thanks so much for the quick response!
    This is perfect, Thanks!
     
  6. robertpridestar

    robertpridestar

    Joined:
    Feb 19, 2019
    Posts:
    1
    Hello I just saw your asset and wondered if it can work for mobile, yet when i downloaded it saw that all the materials are created with the standard material from the paint to the custom paint shader. How can I convert it to a mobile version with using standard shaders?
     
  7. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Mobile and URP shaders are included in the paid version.
     
  8. CGDever

    CGDever

    Joined:
    Dec 17, 2014
    Posts:
    156
    Hi! I'm very interested in: does it work with statically batched objects? I saw your videos, but it doesn't work in your demo. Does it work in the paid Paintz???
     
  9. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    I'll have to do some testing, nobody has reported any issues before.
     
  10. CGDever

    CGDever

    Joined:
    Dec 17, 2014
    Posts:
    156
    Thank you!
    It perfectly works with dynamic objects! ;D
     
  11. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Think I need more info...What is not working?
    I enabled static/dynamic batching, set all objects as static..
    Hitting 2000+ fps in editor...

     
  12. CGDever

    CGDever

    Joined:
    Dec 17, 2014
    Posts:
    156
    Sorry for long reply!
    I recorded a video.
    At the end of the video i showing my statically batched scene and how it looks in a frame debugger after painting
     
  13. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Ok, I see...this is what I think is happening.

    When you first paint an object, a new texture is created and a new material instance is created.
    This will break batching since the objects are now using different materials.

    The only fix I see is to merge your objects into a single mesh.
    Which is a good idea anyway, for example...
    say you have 50 small rocks in the scene.
    much better to combine them, and put 1 paint target on it instead of 50 and hope it batches.
     
  14. hromoyDron

    hromoyDron

    Joined:
    Jan 24, 2013
    Posts:
    90
    Hello!
    I try to use you asset with obi. But I cant find “PaintManager” which need for first step.
    Where is it?


    Updated:
    Sorry, just find it in separate package in Paintz/Extensions folder
     
    Last edited: Jun 24, 2020
  15. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    You have to import the "Paintz\Extensions\Obi.unitypackage" folder.
    *This is not included in the free version.

    This is included as a package because without Obi installed it would cause errors.
     
    hromoyDron likes this.
  16. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Customer Request added for next version: Baked Paint

    Quick video of baking paint....
    *Simply select object, click "Setup for bake"
    Enter Playmode...and Paint
    *Baked textures can be auto updated or manual updated

     
  17. LeoRiveron

    LeoRiveron

    Joined:
    Jul 31, 2020
    Posts:
    1
    Hey, I'm new to this functionality, and Obi fluids, and I just wanted to be sure that this requires the Obi package. My team bought this not knowing, and before we buy the Obi Fluids package, just wanted to double check that it is required. Kinda wish it said this on the main page or somewhere to make sure customers are factoring in both costs. Thanks! :)
     
  18. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    it says "Obi Fluid Support/Extenstion"...obviously we can't include another paid asset.
    It is NOT requried. buy Obi Fluid if you need the fluid simulation, and we provide a way to paint it.
     
  19. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    It includes transparent versions.



     
  20. sythe

    sythe

    Joined:
    Sep 15, 2012
    Posts:
    3
    Does this work in HDRP?
     
  21. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Not out of the box, nobody has ever requested HDRP support...only URP.

    I did a quick test, and took the URP shader graph and replaced the output with HDRP.
    It worked, but would require alot more polish to release.

    upload_2020-11-1_8-40-43.png
     
  22. Kellyrayj

    Kellyrayj

    Joined:
    Aug 29, 2011
    Posts:
    936
    @bocs Hi there! I was curious if Paintz worked well in WebGL?
     
  23. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
  24. Kellyrayj

    Kellyrayj

    Joined:
    Aug 29, 2011
    Posts:
    936
    Thanks for the reply! Sorry I missed it in the post!

    The demo works as expected in Firefox. But doesn't load in my chrome and only gives me the blue channel in Safari. And it doesn't paint like it did in Firefox, it only turns the whole material to the paint color.
     
  25. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Sounds like your on a mac? Not sure but working on windows.

    Left: Chrome
    Right: Firefox


    Screenshot 2021-01-09 120732.png
     
  26. mrwhip

    mrwhip

    Joined:
    Jan 30, 2020
    Posts:
    8
    @bocs Quick question, can Paintz's splattered textures be changed in runtime? i.e. if I have an image texture I want to place on the splat, can I have an image be on the surface of a splat (and alpha'ed as the splat is alpha'ed) Or are they only flat colors with the edges normal mapped? Is there a UV that is accessible from the runtime splats? If so how does that work across objects?

    Also separate question, can the depth be modified both higher/thicker and negative depth too?

    And how is performance on mobile/VR for URP? Any gotchas?

    I'm also assuming your test scene script in the demo first post here is included?

    thanks!
     
  27. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Paintz uses a Sign Distance Field as the splat brush/texture. This is why a hard limit on colors, 1 per channel (RGBA)
    The reason for SDF is so you get smooth round at any resolution texture. If you need Image splats a decal system would be more suited.
    It uses and requires Lightmap UV's.

    Performance is good, it is just another texture mixed after painted. Memory would be the biggest concern for mobile.

    Yes, the scene and script is included.
     
    mrwhip likes this.
  28. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    If anyone needs an update to use Obi Fluid 6, just contact me.
    *The current version included was for Obi Fluid 5
     
  29. christospac

    christospac

    Joined:
    Mar 14, 2020
    Posts:
    1
    hi, trying to make a game using this asset, that includes invisible items. Could you please give me a hint on how to make the invisible wall you are having on your video?
     
  30. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Just use Paint Only or Paint Only Double Sided as the Material shader

    upload_2021-11-6_16-28-31.png
     
  31. lyg2260123

    lyg2260123

    Joined:
    Jun 22, 2017
    Posts:
    4
    hi,bocs。today,i buy the assets from unity store,and want to use obiPaint。I follow the manual,but got a error。can you tell me,some reasons about it。thank you。(In urp,unity version 2020.3.18)
     

    Attached Files:

  32. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    The asset store version contains support for an older version of Obi, if you can send an email to support@bocs.site, I'll send you the update for the latest version of Obi.

    EDIT:
    I posted the update below, contact me if you have any issues.
     
    Last edited: Nov 20, 2021
  33. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    I'll post the Obi Fluid 6 update here, it will be included in a future update.

    *Note I haven't checked if Obi Fluid shaders have been updated for URP, that is on them...this fixes the code errors only so it works with Obi Fluid 6
     

    Attached Files:

  34. lyg2260123

    lyg2260123

    Joined:
    Jun 22, 2017
    Posts:
    4
    thanks
     
  35. oziko

    oziko

    Joined:
    Aug 31, 2019
    Posts:
    3
    I have an issue on iOS build. When i test my game on Unity splats are not pixelized but somehow there is an issue with iPhones, all splats and textures are pixelized and i got really low fps. How can i opitimize / fix it?
     
  36. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    First report of this issue I've seen, need more info:

    1. What iPhone and ios version?
    2. Unity version?
    3. Rendering pipeline standard or URP?
    4. have you tried the mobile shaders?
     
  37. oziko

    oziko

    Joined:
    Aug 31, 2019
    Posts:
    3
    1. iPhone 11
    2. 2019.4.24f1
    3. Standard pipeline
    4. Oh, i haven't tried mobile shaders, i will change all paint shaders to mobile versions. I'll post the results. Is there anything else can I do?
     
  38. oziko

    oziko

    Joined:
    Aug 31, 2019
    Posts:
    3
    After changing mobile shaders, game performance getting better. But build suddenly crashed on iOS, when i played my game about 5-7 min, then crash happened and it always happens. :/ Is this cause of PaintZ scripts or shaders?
     
  39. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
  40. toyhunter

    toyhunter

    Joined:
    Mar 5, 2018
    Posts:
    76
    Am going to buy it such a wonderful asset. Would it be applicable to custom shader like toon shader? How about Skin Mesh? Thanks a lot!
     
  41. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    You would have to modify the shaders to add a Toon effect, or use a Fullscreen shader.
    Skinmesh is not supported, this was designed for mostly static objects.
     
  42. ayildiiz

    ayildiiz

    Joined:
    Feb 19, 2021
    Posts:
    5
    Hello to everyone,
    What I want to ask is if I paint more than one spot, will it cause performance problems?
     
  43. Gab629

    Gab629

    Joined:
    May 31, 2020
    Posts:
    3
    Hey, I'm a student and I'm learning unity right now. I got this issue by importing the PaintZ asset on my project. It seems to have no texture at all, I'm currently using the Universal Render pipeline (I don't even know what it actually is but I guess it's linked to the paint z asset). Also it is for a VR project. Someone could help me with that please ?

    Capture d’écran 2022-04-26 143113.png
     
  44. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    @ayildiiz No, it's painted to a texture so after it's painted it has zero performance cost

    @Gab629 I see you are using the free version, the paid version contains URP shaders.


    Anyone using for VR, please contact support for a fix. (Please say if your using the Free or Paid version)
     
    Last edited: Apr 30, 2022
  45. ayildiiz

    ayildiiz

    Joined:
    Feb 19, 2021
    Posts:
    5
    @bocs hello, one more questions. Will more than four colors be activated in the scene after getting the full version?
    For now, we can only display four colors at the same time. These are blue yellow red green
     
  46. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    4 colors per object, each object can have different colors.
    Tech explanation: Each of the 4 channels (RGBA) stores a signed distance field value, this allows smooth edges even with lower texture sizes. 4 channels allow 4 colors.
     
  47. ayildiiz

    ayildiiz

    Joined:
    Feb 19, 2021
    Posts:
    5
    I do not fully understand. Isn't there a way for me to show six different colors on a scene at once?
     
  48. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    The limit is 4 colors per object (they can be any colors), you can use a different material on each object to get more colors, but again a single object is limited to 4. This is not decal system, or painting textures, it's basically painting signed distance fields to a texture converted to colors.

    if you don't understand the technicals, just understand 4 colors is a limit per object using this technique.

    More colors per object would require a complete recoding, which I would like to do but it is in the "planning" stage and would be a new asset.

    anyway, quick example:
    upload_2022-5-5_20-25-45.png
     
  49. ColeChittim

    ColeChittim

    Joined:
    Aug 11, 2011
    Posts:
    59
    I've been using the asset in my game for a while now and wanna say thanks as its worked great for me!
    Currently working on porting it to other platforms and have encountered a weird issue on Android as well as Xbox that creates weird artifacting on Paint surfaces. This doesn't happen on Standalone PC builds to my knowledge and there is no errors logged. Currently running on Unity 2021.3.1 (LTS) with URP (12.1.6)
    Let me know if there is other info that I could provide that could help fix this bug.
    (I've attached a screenshot of the bugged visuals)
     

    Attached Files:

  50. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Some mobile devices don't clear the texture on creation.
    Open PaintTarget.cs and add "ClearPaint()" at the end of the SetupPaint function.

    upload_2022-5-10_19-55-4.png

    That should fix the problem.
     
    ColeChittim likes this.