Search Unity

Half-Life 2 Behind object outline

Discussion in 'General Discussion' started by _zeta, Sep 9, 2012.

  1. _zeta

    _zeta

    Joined:
    Dec 24, 2011
    Posts:
    99
    So yeah I have been wondering for while now about how to create that epic background outline like
    when you play L4D and your team mates are behind wall or something alike they lightout blue or other border around their character
    or in TF2 you get that same effect for MVM Robot holding bomb, this effect is used in valve games alot, I am wondering,
    how its achived, I had tryed placing 2 cams and 2 blocks,
    one on special layer and one of the cams in child of main cam but only renders special layer and dosent clear
    however main cam ignores special layer and does work like normal maincam... but that didnt do the trick :(
     
  2. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
  3. Morning

    Morning

    Joined:
    Feb 4, 2012
    Posts:
    1,141
    This one is nothing like what Valve has. This is just a fresnel, the one in L4D is a true outline on things. If you clip through the model it will even outline the parts you're clipping.
    I don't know how it's done but maybe you can render all objects to be outlined in a pass where black = no outline and then various colors for various things to outline. After that the post shader takes that pass and extrudes an outline along the flat colored objects. I'd love to try to implement that but my shader coding is very poor.
     
    Last edited: Sep 9, 2012
  4. UnknownProfile

    UnknownProfile

    Joined:
    Jan 17, 2009
    Posts:
    2,311
    Take a look at this from the wiki. This could give you a good base for what you want.