Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity Braintrust help! Best way to make rim glow on object

Discussion in 'General Discussion' started by CoCoNutti, Mar 20, 2020.

  1. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513
    hi,

    Scouring the internets last two days trying to figure out the best way to go about this.

    I have 80 (3D) objects on the screen that all share one material. I need to be have some of these objects have a glowing rim, and others not. So far, all I can see are material shader solutions, but this doesn't work when they all share the same material.

    So what are some other solutions that could work? I thought 2D sprite on top, but that could look awful? Not sure as I haven't tested.

    Appreciate the help in brainstorming this.
    Thanks
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Yes, a sprite on top would look awful.

    What you'd likely need to do is to utilize MaterialPropertBlock and specific material with the glow that can be turned off.
    https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html
    This way objects would use the same material, but you'd be able to override specific properties per object.
     
    CoCoNutti likes this.
  3. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513

    OK, thanks will look into this.
     
  4. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554