Search Unity

Assets [RELEASED] PaintZ - Splatoon like paint system

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

  1. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    Last edited: Sep 7, 2018
  2. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
  3. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    Fantastic. Your price is way too low, man!

    The first million-star reviews are hitting the asset store.

    This is the way to make Splatoon -like scenes in Unity, and many more uses too.
     
    Last edited: Sep 7, 2018
  4. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    THANKS....glad you like it


    Just an FYI to everyone...
    this has been tested with Unity 2018+
    BUT...only works with built-in render..so can't use the custom pipelines yet.
    I plan to add support sometime
     
  5. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    @Fattie
    Thanks for the review.

    I made a simple test...
    Plane is scaled 10 1 10


    I then tried 25x, 100x....
    can't seem to repro it not painting.

    as for the stretching...try a higher texture value here:


    remember, the bigger the object the paint needs more resolution
    100x is just too big even for 4096x4096, 25x looks ok.

    what version of unity, OS, and platform do you have selected?
    My test was 2018.1.9f2, Windows 10, Windows Build
     
  6. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    I tested a cube at 25,1,25 scale...
    is this the "stretching"? if so just need to increase Texture size.

    Left: Increased Right: Default 256

     
  7. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    I was playing around and created an overlay version...
    this means you can use custom shaders, or just a blank area.

    check it out..paint on a glass shader, or invisible wall.


    still have some work to do but i thought it was cool.
     
  8. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    Scaling issue:

    Here's a video:
    https://www.dropbox.com/s/6tg84ium9a6j0qe/paintz-scale-plane.webm?dl=0

    1. using Windows10 (highest nvidia etc)
    2. absolutely latest Unity (18.2.6 presently)
    3. create brand new totally empty project
    4. import, from asset store, current PaintZ asset
    5. click "Add .. 3D .. Plane"
    6. add
    PaintTarget
    ; choose
    Material

    7. put
    PaintExample
    quick test script on
    Camera


    Play and paint, using various scale on the Plane. it is only necessary to change the "x" scale.

    Notice when you get above about 10, it behaves strangely. How to understand this?
     
  9. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331

    Like I said, if you scale it up...you need to also increase the texture size.
    see in your video you have it set to 256x256
    you are trying to paint an object 10 times bigger, but with the same amount of "paint"

    Try 1024x1024...
    * or 2048x2048 or 4096x4096

     
  10. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    That makes perfect sense - good one. I'm sure that will help a lot of readers.

    Next question! I know how to paint on a surface, which, is textured using one of the supplied "Paint Materials" (white, orange, blue etc).

    screenshot.png

    Say I have a floor surface which is a conventional texture (i.e., it's an image of a floor).

    screenshot 1.png

    In fact, how do I paint on that? Can I create a "paintable texture", using, a PNG to begin with?

    (your "invisible texture" idea mentioned above could work, but surely a "png based paintable" texture is the way to go, no?)

    Thanks, PaintZ Pals! :)
     
  11. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    "Say I have a floor surface which is a conventional texture"
    just create a new Material
    change shader type to PaintStandard
    assign your textures like you would any Standard shader.

    I can make a quick video if this is not clear.


    "how many splats per second"

    all splats are queued, then later blit to the texture.
    this option is the one that effects performance.

    checked it will paint all queued that frame.
    unchecked it will paint 10 per frame until que is empty.


    "Does it matter how many splats in total exist"
    no, this is not a decal system.
    once painted, it's just part of a texture that is always displayed.
    0 splats, or 1 million...same performance
     
  12. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    Floor: fantastic info, I'm sure it will help many users. It's totally clear.

    Splats per second: AHHHHHH. Fantastic. Got it now. In fact I am limiting splats per frame to 2 or 3, so, fantastic.

    Undecal: AHHHHHHHHH. Totally fantastic. That is magic: got it now. Magnificent!

    {Thought: when you build a, say, racetrack (let's say 10km long), you always chop it in to sections (perhaps 100m each) so that it can occlude as the viewpoint spins around. (If you dynamically build a racetrack or similar, this is an important task - to dynamically chop it up for occlusion.) In fact, is this issue relevant to Splatz? Does it occlude, does it need to, or is it a non-issue?}
     
  13. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    It's just a shader, so it has nothing to do with occlusion or anything else.

    Tips:
    Use as small "Paint Texture" for each object that looks good to you.

    Don't put it on small objects, then spread them around (like rocks)
    Each object will create a new Texture, possible to run out of GPU memory.

    "Setup On Startup" will create the texture even if you haven't painted that object yet.
    suggest keeping this unchecked, so it will create the textures only when it gets painted the first time.
     
  14. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    What about drawing on Terrain?

    screenshot.png

    (that's an attempt using a dynamic decals library, which is hopeless unfortunately)

    Terrain shaders are very specific - I wonder if it's possible??
     
    Last edited: Sep 15, 2018
    sircybershark likes this.
  15. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    Submitted V1.5 to asset store

    Added New Shaders and API to raycast colors/channels

     
  16. SilverMalibu

    SilverMalibu

    Joined:
    Sep 7, 2014
    Posts:
    4
    Hi i sent you an email about splat rect issue.
     
  17. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    Got it and replied
    *keep in mind timezones for reply time, it was 3AM my time when you sent the message.
     
  18. Rumbleboxer

    Rumbleboxer

    Joined:
    Dec 26, 2012
    Posts:
    27
    Hey man, great asset. Interested to get but a few questions:

    Any idea when the new rp support might be ready?

    Also, is it possible to detect if a game object touched the exact paint color type?
     
  19. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    say @Rumbleboxer , what did you mean by "rp" rp support?

    Thanks! Yes, it's a fantastic asset.
     
  20. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    @Rumbleboxer
    I don't plan to support SRP until it comes out of preview.
    *Unless I can convert the shaders to Amplify shaders

    It has a special raycast function that will return the color


    @Fattie
    rp = Scriptable Rendering Pipeline


    @everyone
    I'm currently out of town for the holidays, limited support
    *will be back Jan 5, 2019
     
  21. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    I had a few customer support requests on how the score system worked.

    so I'll post this example that displays as % (includes code, prefab etc)




    I'll include this in the next update now that 2019.1 has been released to support LWRP
    *keep in mind LWRP will require an almost complete recode, so no ETA!
    *right now this asset is ONLY built-in render compatible
     

    Attached Files:

  22. Joorian

    Joorian

    Joined:
    Aug 31, 2015
    Posts:
    2
    Hello, my name is Julian and I am very interested in buying Paintz, but I wanted to make sure that your asset could do what I am hoping it could do before I buy.
    In a nutshell, I am hoping to use this asset to create a trail of paint that follows a paintbrush, in the same way that a paintbrush would leave a trail of paint in real life. I would want it to leave a trail of paint on a relatively low-poly surface. Can you attach this asset to an object so that wherever it goes, it leaves a trail of paint, or is is more geared towards creating "paint projectiles"?

    Thank you so much for your time and response!

    Best Regards,

    -Julian
     
  23. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    *I replied to your email, but I will post it here also.



    Check the demo, and click "Trails".

    http://bocs.site/demo/paintz1/






    "I would want it to leave a trail of paint on a relatively low-poly surface."

    This is texture based, so it doesn't care if the model is 10 polys or 10 million polys.
    You set a texture resolution per object that can be painted.

    *Keep in mind it's limited to 4 colors per object.
     
  24. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
  25. ben-rasooli

    ben-rasooli

    Joined:
    May 1, 2014
    Posts:
    25
    Can you please explain how I can get the Pain Only Double-Sided on an invisible object? I don't have your asset yet, but in your video, I can see painting on an invisible wall, but only single-sided. That's the only feature I need and I will buy this asset if it can do that.
     
  26. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    @ben-rasooli

    in the video I just used PaintOnly...if I would have used PaintOnlyDoubleSided it would be what you want.

    take a look at the sample scene from another angle which does use it:


    very simple to use, just change the material shader of the object you want painted.
     
    ben-rasooli likes this.
  27. unity_1a1bnV0E3dqrzQ

    unity_1a1bnV0E3dqrzQ

    Joined:
    Oct 17, 2018
    Posts:
    3
    Solved my problem, it was a shader inclusion problem.

    Thank you for this great asset!
     
    Last edited: Aug 21, 2019
  28. Dands_Salaun

    Dands_Salaun

    Joined:
    Aug 7, 2018
    Posts:
    1
    If I need more colors, how to do?
     
  29. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    331
    I get asked this alot....

    paint is stored as an 8-bit signed distance field in the Red, Green, Blue, and Alpha channels, so 1 channel per color.
    4 colors is a hard limit, all code and shaders would have to be redone.