Search Unity

Blending objects?

Discussion in 'General Discussion' started by Emperor, Mar 29, 2019.

  1. Emperor

    Emperor

    Joined:
    Feb 13, 2014
    Posts:
    41
  2. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    That is blending two materials together. What exactly would blending two objects together look like? Do you have an example?
     
  3. Emperor

    Emperor

    Joined:
    Feb 13, 2014
    Posts:
    41
    Yes material blending just like the examples from the microsplat module. I basically just want the material from one mesh to "creep" on the other one on contact so that it mimics the effects of it being burrowed in the other.

    The terrain for my project is a mesh and not a unity terrain so I can't use microsplat. I need something that does the same thing but for meshes.

    I also have another use case where I change the head of monsters. The skin of the body should "creep" on to the head. It's same principle as the image below but the terrain would be replaced by a creature body and the statue by a head in that case.

     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,634
  5. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    ah, gotcha. sorry, i was thinking something nonsensical.

    Vertex painting and/or height map painting are commonly used approaches that I know of.

    You'll need to be aware of the orientation of your UV shells across objects, as well as texel density, if it's not vertex painting. If it is vertex painting, your resolution is dependent on the vertex density.
     
  6. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    To do this kind of thing correctly you need to procedurally deform the object mesh against the ground target.

    Then have the shader(s) blend the materials.

    This is not a simple thing to do well, especially w/ arbitrary geometry. For arbitrary geometry, this would probably be easiest as merging the two meshes into one.
     
  7. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    i was gonna mention a need for something along those lines (though I was thinking just like a transitional "skirt"). Depending on how they are constructing the terrain it may not be feasible to combine prop objects with the terrain.

    But, TBH, the example image there doesn't look as good as it could. I don't think you should necessarily need to conform the objects with the terrain seamlessly. This isn't the way it exist in real life. I think a simpler and more elegant approach would be to use small scatter objects at the transition point. Like, chunky clumps of moss covered stones that have broken off from the statue; small vegetation, etc. This is not only easier to do, but will give a more detailed and realistic look without requiring any novelty solution. I think this is probably what most games do.
     
    frosted likes this.
  8. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    Agreed. The vast majority of the time this is the no brainer solution. Then you crank up AO a little extra to help hide the rest (this is like 99% why we use AO).

    And yeah, it's what tons of games end up doing in practice.
     
  9. Emperor

    Emperor

    Joined:
    Feb 13, 2014
    Posts:
    41
    I found this free tool that might do the trick. I'll try it tonight. Apparently, this asset can also do it. I'll look into that 2nd one if the first one can't do it.

    For sure that's a good idea. Mixing both ways would produce the best result I'd guess. For my 2nd use case where I swap the head of monsters, I was actually just putting a collar at the neck to hide the 2 mesh abrupt transition. But since they're supposed to be "wild", it didn't really match what I was going for. Only other option was to add hair and things like that but again it's changing the aesthetic I have in mind a bit too much. Anyways, hopefully the 2 assets I mentioned earlier can do it.