Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Mesh outline

Discussion in 'General Graphics' started by IIIZoom, Aug 28, 2023.

  1. IIIZoom

    IIIZoom

    Joined:
    Jun 26, 2018
    Posts:
    24
    hi, in games libe BlackDesert online when you customize the cahracter each part of the body is highlighted when you mouse over it, anyone knows how can you achieve this without splitting the character into multiple meshes

    for example when you mouse is over the head, only the head glows/outlined
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,029
    I'm pretty sure BDO does split the mesh. Theoretically, you could create a mask texture or use vertex colours to give each area a unique colour and then drive an highlight shader based on that, but then you'd also have to implement some custom collision testing as well.

    It would be easier from a workflow issue to just split the mesh and you're likely not going to see any real performance hit.
     
  3. IIIZoom

    IIIZoom

    Joined:
    Jun 26, 2018
    Posts:
    24
    im using UMA im not sure about how to do it, since they combine everything into a single mesh at the end
    also BDO does have glow for specific stuff like eye brows, is the mesh splitted into all these very tiny parts?
     
  4. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,496
    You don't. While you're customizing character, the mesh is split into parts.

    You could try some trickery to avoid that, but honestly there's simply no point.
     
  5. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,635
    Another thought: Use the bone weights to determine what a vertex belongs most likely to what bodypart.
     
  6. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,496
    Few problems here:

    You don't necessarily know which bone index is which bone. While SkinnedMeshRenderer has bindposes and bones[], a mesh may be actually split into parts affected by small number of bones. This has been used in the past when hardware could not support large number of bones.

    The information about bone indexes may not be even available in the shader:
    https://forum.unity.com/threads/acc...dices-from-within-shadergraph-in-urp.1412481/

    If you check examples, nothing ever touches bone weights or bone indexes:
    https://docs.unity3d.com/Manual/SL-ShaderSemantics.html