Search Unity

Assets [WIP] Paint Splattering Shader

Discussion in 'Works In Progress - Archive' started by space928, May 20, 2018.

?

If this were on the asset store, how much would you pay for it?

  1. Nothing, I'm greedy

  2. 2$, I respect you spent time on this

  3. 5$, this is really cool and you deserve my money

  4. 10$, I love this and feel like being generous

  5. More?

Results are only viewable after voting.
  1. space928

    space928

    Joined:
    Jun 11, 2015
    Posts:
    21
    I've always loved the paint effect from portal 2 and wished that it could be used in Unity so I did so. Here's a screenshot of the portal 2 gels for reference:

    Notice the really nice splattery edge. So I've implemented most of this in Unity (from scratch of course) and I've even added a few improvements (along with the fact that my version using a PBR lighting model).
    Here is what my shader is looking like at the moment:

    The shader is designed to be extremely customisable, almost everything about the shader can be customised, from the textures of the ground to the way the paint splatters on the ground. Here is a view of the current shader properties:


    As you can see, there is a lot of potential for customisation. Defining where paint is on the object is very simple, all that is needed is a simple to make (and modify in real time) splat map which can be of a very low resolution as the shader automatically makes the edges splattery and well defined. Here is what the splat map looks like by itself without the shader:

    Finally, I'll leave you with a couple more screenshots and I'll open myself up to any questions or suggestions you might have.

     
    Last edited: May 21, 2018
    alexanderameye, QFSW, Mauri and 2 others like this.
  2. DrOcto

    DrOcto

    Joined:
    Sep 15, 2017
    Posts:
    79
    Like the look. How good is it on mobile?
     
  3. space928

    space928

    Joined:
    Jun 11, 2015
    Posts:
    21
    It should run absolutely fine, though I'm still working on getting the render texture implementation optimized. Otherwise the shader itself should run absolutely fine on mobile.
     
    Freznosis and DrOcto like this.
  4. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Looks neat. Going to watch this thread! :)
     
  5. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    Looks pretty authentic!
     
  6. space928

    space928

    Joined:
    Jun 11, 2015
    Posts:
    21
    Hi, just a quick update, I've been working hard and I've got the real time painting system to work:

    You'll notice that you can paint on any surface no matter the position and angle of the object (whether it be the same or a different material). The splatmap is now stored in 3 channels (red, green and blue), for each of the dimensions you can paint in (x, y and z, it sounds weird but trust me it works). As you can see, it runs really fast and that even when painting, there is no performance impact.
     
    DrOcto, Freznosis and QFSW like this.
  7. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    Awesome!
     
  8. DrOcto

    DrOcto

    Joined:
    Sep 15, 2017
    Posts:
    79
    So when is it done;) like to paint with it:D. Btw good job!
     
  9. space928

    space928

    Joined:
    Jun 11, 2015
    Posts:
    21
    Sad news, due to a major bug in the directx shader compiler I'm stumped and I don't know how to continue the project as it breaks a core feature of the shader (which hint hint might be getting rebranded soon if I can fix it). This has been super frustrating for me and even after talking with some smart people I know who have years of experience in programming, I can't fix it. If I am to continue this project I need your help to solve this problem, share this forum post which explains the problem in detail:
    https://forum.unity.com/threads/shader-compiler-missing-a-texture-sampler.538883/