Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Render only depth

Is it possible to make something rendering only into the depth? I tried disabling "render in main pass" but then it doesn't render depth either.

Product Version: UE 4.13
more ▼

asked Dec 14 '16 at 06:27 PM in Rendering

avatar image

13 2 5 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey Obscura90,

What you are looking for is Custom Depth, which is done through a custom depth buffer so you can write certain actors to only draw to that depth buffer. Below is a tutorial and examples of how to use custom depth written by our own Tom Looman.

Many uses of Custom Depth


Custom Depth


Let me know if you have additional questions.


Andrew Hurley

more ▼

answered Dec 14 '16 at 07:46 PM

avatar image Obscura90 Dec 14 '16 at 08:21 PM


Thanks, but unfortunately custom depth doesn't really help on what I would want to do, because its not a post process.

I would want to cull some translucent material parts, by putting an "invisible" object on top of it, that renders only depth, like in this video:


avatar image AndrewHurley Dec 14 '16 at 08:39 PM

The post processing is simply an overlay to draw the selected objects you have set to only render in custom depth. The functionality will be within the shader itself and within your blueprints.

Lit - Custom Depth alt text

Buffer Visualization - Custom Depth

alt text

As you can see, I have selected the object to only render in the custom depth buffer. The shadow persists just because I have not rebuilt my static lighting, but this is the only way I know of to render and object in the world only with depth. You could set it up via a SceneCapture 2D actor, but that only applies to the Render Target and not the physical geometry placed in the world.


Andrew Hurley

avatar image Obscura90 Dec 14 '16 at 09:17 PM

Thanks for taking your time, but custom depth is not what I'm looking for. As I mentioned above, I'm trying to use this invisible object, to "unrender" some parts of a translucent material. Imagine a boat on the water. You wouldn't want the water to appear inside the boat. In the video I was showing, he shows a technique that uses a mesh that renders only depth, and its placed on top of the boat. So when you look at the standard depth pass, you dont see inside the boat and the translucent water material also doesn't appear inside the boat. The game that was shown in the video didn't made with Unreal Engine, but I guess it would work the same, if I could somehow set it to render only depth...This is not for a project by the way, I'm just curious if this is possible to do in Unreal, or not.

avatar image Obscura90 Dec 14 '16 at 09:32 PM

Actually , yes. I could use this with the scene capture, and just use the render target as opacity in the material. But if there would be a way without scene capture, that would be nice.

avatar image AndrewHurley Dec 14 '16 at 09:34 PM

You can use an If node within your material to put checks in place to make sure it doesn't render when the water clips into the geometry. This or custom depth are the way you would go about doing this. I understand what you are trying to do, and perhaps you might be misunderstanding how custom depth is used within the engine. Either way, goodluck!

avatar image Obscura90 Dec 14 '16 at 10:13 PM

Now I see how could you use custom depth. I didn't know you can use the scene texture node in translucent materials. I thought its only for post process materials. Works like a charm,thanks again!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question