Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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:
    12,382
    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:
    12,382