Scene depth post process Capture 2d / How?

Hi all,

For today’s dose of “go insane”, I’m trying to capture a 2d texture off a SceneCaptureComponent2D

I’m getting odd results after setting everything up correctly (as far as the correct parameters I need go).
here is a screenshot of the product.

  1. What is that? 2) WHY is that?

Aside from the obvious what/why

I’m obviously not going at this the right way, and I think the main issue is my post-process material.

I wish to retrieve the Depth data of a plane intersecting with the landscape.
Mostly interested in the spots that are parallel to one another.

In a material this can be approximated with the Distance to Nearest Surface parameter divided by a distance.
I’m wholly unsure on how to go and re-create that based on the Scene Texture.
As a result I have been bashing my head on it all day.
Any tips/advice on this material expression?
Any learned SceneTexture users to give some advice/tutorials on how these nodes are meant to be used?

So, I turned the scene capture component upside down and tried just getting a render of the landscape by isolating the landscape.
This works.
I then added a secondary mesh at the depth level I’m interested in - all in black.
Now the capture 2d result looks like this

This seems to be an LOD issue, but it also sports some plainly wrong sections where the plan appears over the landscape where it is not over the landscape and under the landscape where it is not under the landscape.

Changing the Capture Source is not really changing any of the results
The Device Depth in RGB result shows complete distortion

At this point there is no post-process material, or any particular setting except a disabling of all Bloom/Eye adaptation from the Scene Capture 2d, and having only Landscape and Static Meshes - along with Use Only Show List and the 2 items within an Array in BP.

I really don’t get it. Changing the LOD from Low/Med/High changes absolutely nothing.

I figured out that changing the LOD0 and Other LODs on the landscape actually removes the artifacts.
However, it doesn’t seem possible to access these values in blueprint through regular methods?

I’m exposing a variable with type landscape and picking the landscape with the eye dropper in the editor. However from this variable it appears no direct access to any of the landscape LOD Distribution options is available.
To expose it in blueprint, would I have to modify the engine landscape, or would a C++ blueprint function suffice to expose those variables? Road block after roadblock… XP

Updating this with the actual answer after these wasted days trying different things to find a proper solution.


For anyone interested, the best way to capture is to loop through the landscape tile by tile with Orthographic camera…
However I see little to no difference between looping though and just setting the capture to the size of the map.

What’s more you have to re-compose the composite image tile by title, and sort the landscape components by Base x Base Y in order to have a solid starting base. which literally took forever to set up properly and involved scripting a C++ custom class to sort the integer array as this is apparently not a function available in BP.

My original thinking was that the LODs would be forced to be higher.
They are, but they still aren’t LOD 0 with the orthographic camera.
What’s even more puzzling is that the material’s Depth of Filed nodes only render at landscape center. None of the other locations have the same look / feel.

1 Like