Search Unity

Blend Machine - Blending tool using height maps and mesh contact!

Discussion in 'Shaders' started by Blobinet, Apr 3, 2018.

  1. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    Hello !
    I have finished my blending tool, capable of blending a large amount of PBR materials on a single mesh using height maps for better transitions (sand filling in the cracks of a cobblestone path for example).
    It is also capable of blending objects together based on proximity, designed to hide seams where meshes intersect.
    You can get it for free here !

    Please try it out and tell me what you think !



     
    Last edited: Apr 3, 2018
  2. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,372
    I'm surprised nobody talking about this, might want to create a new thread in MWU or WIP forum.
    I'll check it out :)
     
  3. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    I made another thread in MWU ! Please send any feedback you might have once you try it !
     
    Reanimate_L likes this.
  4. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,889
    looks nice but doesnt polybrush already do this for free in unity?

    EDIT: saw it also blends heightmaps which is cool
     
  5. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    Yes, it uses height maps for better blending + is has a contact blending shader which is designed to hide seams where meshes intersect !
     
    GameDevCouple_I likes this.
  6. tcourbet

    tcourbet

    Joined:
    Oct 5, 2017
    Posts:
    46
    It looks great, especially for a free asset! :)
    I haven't tried it yet (I will soon!) but I assume the Contact Blending is just between 2 meshes and won't work on terrains?
     
  7. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    229
    Awesome of you to release this for free. Obviously the functionality can be achieved with polybrush but just from the video I can see situations where this tool would be easier to use.
     
  8. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    There are two types of contact blending, one works between any two meshes (it needs a mesh collider for baking, haven't tried with a terrain collider yet), but the texture that appears at the intersection is defined on the material (it could be something completely different from the texture on the terrain if you wish !)
    As for the other type, it only works between a mesh and a floor using my blending shader, but allows for multiple textures to blend onto the object based on distance
     
  9. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    I don't think polybrush can do height blending out of the box can it ? I also believe it only supports 4 textures max per mesh ? My tool does height blending and has potentially no limit on the amount of (pbr!) materials usable per mesh (the limit would be GPU memory)
     
  10. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    229
    If you get fancy and use the new Shadergraph then it can be done, but certainly not as easily as this (plus that doesn't work with legacy pipeline like yours does).
     
  11. tcourbet

    tcourbet

    Joined:
    Oct 5, 2017
    Posts:
    46
    Thanks for the answer!
    Sorry if I'm misunderstanding, but I assumed that the transition texture would have to come from a mesh with a BlendMachineSurface material applied. In the case of a terrain, that would mean replacing the default terrain shader with a custom one, right? I don't think that would work to just swap it with a BlendMachineSurface?
    But I might be missing something! :confused:

    Edit: works really well between 2 meshes though!
     
  12. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,372
    @Blobinet Oh btw when i select a texture array asset your editor script that showed the content ,it make the editor to slow down, like a lot
     
  13. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    @tcourbet If you want to use it with a unity terrain, you can use the simple contact blending, but that means only one texture will be blended onto your object

    @Reanimate_L Are you using the latest version ? Initially I showed the textures, but that made the editor way too slow with large arrays/textures so I only show the paths to the original textures now, which should not lag (if it does, please tell me the texture count and dimensions, or even send me the array if you can)
     
  14. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,372
    Oh there's an update? i'll try the latest
     
  15. Milanis

    Milanis

    Joined:
    Apr 6, 2018
    Posts:
    52
    Holy cow! Blobinet! If this is becoming something strong like this: http://polycount.com/discussion/174377/witcher-3-blood-and-wine-architectural-material then you should think about releasing a pro package. Thank you for the free shader, you got money. <3

    Atm, we're looking for an solution like seen on the blood-and-wine architectural material, supporting these numbers of PBR with a lot of options for coloring, blending and adding additional dust/rust/dirt layers on top. I'm going to test your shader and will response with a little review after. Thank you, Sir.
     
  16. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    Please do ! And tell me if you have any suggestions !
     
  17. BKprod

    BKprod

    Joined:
    Sep 19, 2014
    Posts:
    14
    Hello Blobinet !

    I've just purchased your plugin. I have looked for something that blends multiple materials with height for years now.

    The thing is, everything works as intended except the painting part !
    I've done everything you show on the video, the array is built, textures are showing on my mesh, I can even fill texture or wetness. Only the painting part won't seems to work for me.

    Maybe I am missing something ?
    I'm using Unity 2018.1.0f2
     
  18. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    Hey, that's weird ! Can I get some more info ?
    Once you enable paint mode, do you have any errors ? Does the gizmo show up on the mesh but clicking does nothing ? Have you enabled the texture paint checkbox and set the intensity to more than 0 ?
    I have not tested my tool on your version of unity, but if you are using the legacy pipeline there should be no problems
     
  19. BKprod

    BKprod

    Joined:
    Sep 19, 2014
    Posts:
    14
    Yep exactly as you say, painting is enabled, the gizmo shows up, I haven't any errors in the console, but clicking does nothing. I'm not using HDRP or Lightweight.
    Curiously I also tested with 2017.4.2f2 and the same problem appears.
     
  20. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    Mhh, does this also happen in the demo scene ? What is your current build target ?
    If you can fill different textures onto your mesh my best guess would be an issue with the settings...
    I could take a look at it tomorrow if you can send me the files
     
  21. BKprod

    BKprod

    Joined:
    Sep 19, 2014
    Posts:
    14
    Well I was just testing that, and it works perfectly whith the demo package on any other new project.
    Same settings, same plugins, same Unity version... (it's a VR project with some plugins targetting Windows.)
    Very curious.

    I've done everything I could with various versions, the painting just won't work on this specific project.
    At least it works now. Thanks for the awesome plugin !
     
  22. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    Glad you managed to resolve it !
    (Might have been an issue with gamma/linear space ...)
     
  23. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    682
    It looks interesting!
    Any plan to release it on asset store?
     
  24. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    Eventually yes, I need to implement some improvements I've been thinking about and polish polish polish even more first
     
    sjm-tech likes this.
  25. danielrugu

    danielrugu

    Joined:
    Jul 24, 2016
    Posts:
    14
    This is one of the best finds in this forum. Great work
     
  26. Deleted User

    Deleted User

    Guest

  27. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    457
    Thank you for sharing this tool. I tried to use it in my project using unity 2018.3.0f2 PipeLine.
    I'm trying to blend house with ground. I't didn't work !!!
    First it doesn't work. It's give me pink material all the time !! I tried to update this mate to LRP but not updated !!?
    Second, I think what you showing in this video is old version. From first second till 1:03 all steps is good but the house is still pink !!
    Could help me with this issue ?
    Thank you.
     
  28. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    @Quast It only works with the legacy rendering pipeline for now. I will eventually port it to the HDRP
     
    Wietrzyk and Quast like this.
  29. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    457
    Great. I hope you will do that soon. Thank you.
     
  30. d12duke

    d12duke

    Joined:
    Mar 22, 2016
    Posts:
    37
    This is absolutely Phenomenal!!
     
  31. Jeremy-Borton

    Jeremy-Borton

    Joined:
    Oct 21, 2015
    Posts:
    52
    Thank you so much, this is amazing!!!
     
  32. Myging

    Myging

    Joined:
    Oct 23, 2014
    Posts:
    2
    When I apply the Contact Blending Baker Script, it sais that the "SourceMesh is not readable !" and the blend does not work at all. Nor does the painting.


    Update: Sourcemesh could be made readable in the import settings of the mesh by enabling Read/write. The issue is that the blend between two meshes does not work at all. There is a harsh line.
     
    Last edited: Jun 17, 2019
  33. andreiagmu

    andreiagmu

    Joined:
    Feb 20, 2014
    Posts:
    14
    I downloaded Blend Machine today, is there a version number anywhere? It would help to identify if some user is using an outdated version of the asset.

    In my tests, the BlendMachine Surface shader, the texture painter and the Advanced Contact Blending shader are working nicely! :)
    But the Simple Contact Blending shader doesn't seem to be working... :(

    I'm using Unity 2019.1.2f1. I tested the Simple Contact shader in the demo scene (using the included test objects), and in another scene where I created other objects and added the necessary components (following the pdf guide's instructions).
    In both cases, I click the Bake button and nothing seems to happen.
     
  34. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    I haven't updated it in almost a year, the last tested unity versions was 2018.x, but as long as you are using the legacy pipeline, it should work, as I don't remember seeing breaking changes since then.
     
  35. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    814

    It would be really nice if this were updated to work in HDRP/LWRP and on 2019.2+

    I've not seen a tool like this before. I'm pretty certain it'd be ridiculously popular! -- Are there still plans to update it?
     
  36. Blobinet

    Blobinet

    Joined:
    May 4, 2015
    Posts:
    18
    I do plan on updating it ! I was waiting on the HDRP to properly release before adapting it. I had no plans for LWRP initially since it was supposed to be for mobile platforms, but with the updated goals I intend to start working on a version soon actually :)
     
    Milanis likes this.
  37. Milanis

    Milanis

    Joined:
    Apr 6, 2018
    Posts:
    52
    This is awesome news! Thank you for doing this since we would really love to use it on our HDRP pipeline. You're awesome.