No announcement yet.

Custom Depth on Player Character? How?

  • Filter
  • Time
  • Show
Clear All
new posts

    Custom Depth on Player Character? How?

    I want to render Custom Depth (for outlines) on the Player's Character which spawns via a "PlayerStart" actor. I can only find the "Render Custom Depth" option as a checkbox on persistent objects already within the level ~ the player character does not fall into this category.

    I see other games, demos, and even bug reports highlighting the Player Character in Unreal.

    How is this done? Is there a checkbox I am missing inside the Character blueprint, or something?


    Edit #2: In this video by Tesla he demonstrates setting Render Custom Depth in a blueprint. He does it on a static mesh but you should be able to do it on any skeletal mesh the same way.

    Edit: I reread your question and I misunderstood it initially. He does say in C++ you can toggle Render Custom Depth but I'm not sure how to do it in a blueprint either, nor how you would change the outline color per actor.

    This question on the answer hub may have what you are looking for...


    You can use custom depth rendering to create outline effect as a post process.

    First you need to create a post process material that will compare backbuffer depth and custom depth. If difference is greater than a given threshold, then you should draw outline.

    A sample material can be found here: Just add it to blendables list in postprocess volume in your level.

    Now you can toggle outline in editor by checking "Render Custom Depth" option in actor properties.

    Unfortunately toggling outline in-game, requires a bit of coding in c++. Basically you need to use this for each primitive component in actor:

    comp->bRenderCustomDepth = true;


    ps. The material is just for test and doesn't always work as good as the one available in Editor.
    I downloaded the material and followed the steps. I increased SampleRangeX and SampleRangeY parameters to 3.0 to get a thicker outline. I also set edge threshold to 1.0 (lower values were causing faces to highlight when viewed at glancing angles).

    I'm not sure what changes you would do to this to provide things like different colors for different characters though.

    Last edited by tmek; 09-16-2015, 12:22 AM. Reason: added screenshot


      I actually watched that video you posted (along with every other video I could find on the subject), and for some reason I discounted it as not applicable to my needs. On second thought, I would expect that solution to probably work, and I should try it out.

      In the meantime, I hacked it together by placing the actors into the level, and then swapping them via a keyboard key/relocating the old actor outside the camera view.

      Attached Files


        the mesh inside the blueprint has the checkbox for "Render CustomDepth Pass" under the Rendering details tab once you expand the little arrow.