Announcement

Collapse
No announcement yet.

Object / Mesh Outline Effect working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Object / Mesh Outline Effect working

    Hey all!

    I was experimenting again to see if an object outline effect (think Left 4 Dead) could actually be done in the UDK. This time I got it working so I decided to share it.


    The technique involves using 2 meshes. One uses the usual solid material with lighting or whatever else you want on it. The second mesh uses a translucent material with depth based edge detection. Here's the material:
    [SHOT]http://farm8.staticflickr.com/7031/6483365243_b2438950ba_b.jpg[/SHOT]
    Not so easy to fit the whole material on one screenshot.
    The stuff connected to Emissive is just to make the highlight color pulse. 'Normalize' is switched on on the SceneDepth and PixelDepth nodes. 'Screen Align' is switched on on the ScreenPos node. The 'Width' parameter controls the outline thickness, the 'Depth' param controls the depth threshold of the edge detection. Setting 'Depth' lower avoids outlines disappearing when your mesh is near other geometry, but causes smaller features to also get outlines.
    This material uses 4 depth samples to check depth differences. More could be added to improve quality, but at the cost of more instructions.

    Hope someone finds it useful, have fun.

    #2
    Really cool mate, thanks for sharing

    Comment


      #3
      Yes!

      I managed to get it working in game to highlight nearby items.
      It was great fun and actually quite easy!

      [SHOT]http://farm8.staticflickr.com/7030/6530835481_1d06c6d23b_b.jpg[/SHOT][SHOT]http://farm8.staticflickr.com/7145/6530835493_92ff9aa19b_b.jpg[/SHOT]
      [SHOT]http://farm8.staticflickr.com/7159/6530835491_650d1f5772_b.jpg[/SHOT]

      Basically, I used the Touched() and Untouched() events of the pickupfactory to fire highlight and unhighlight functions. The highlight function makes a duplicate of the pickup's meshcomponent and applies a materialinstance using the material I made before.

      Comment


        #4
        Hi DarkCarnivour, thank you for the post! I've been testing this material and it "almost" works for me. My project is a top-down - isometric game (Diablo-like), so the outline will only be more or less working when I zoom in the camera and center the object in it. The parts of the object that are farther than the camera are never outlined though. Do you have any suggestion/idea on how to get outlines in objects with a ISO camera? it's really driving me mad!! Thanks!

        Comment


          #5
          thank you for the informative post, how would one actually go about duplicating a meshcomponent, I have been unable to find any documentation talking about that. Any help would be appreciated!

          Comment


            #6
            Awesome

            Comment


              #7
              Does anyone know about this? How is the meshcomponent duplicated to work for animating actors?

              Comment


                #8
                Is there any chance to apply this technique to a skeletal mesh? Because The only other way I know to get a similar effect, is to use a post processing effect, but this would apply it to the whole level and I only want the characters outlined.

                Comment


                  #9
                  I'd never even have thought of that, so nice work there. I won't be using it but your modifcation opens the mind to the diversity offered by UDK in my own work, thanks!

                  And I played a lot of L4dead, tanks for the memory

                  Comment

                  Working...
                  X