x

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"

[4.13] Scenecapture2D, SceneDepth capture not working as expected

Hi!

I'm trying to use the new 4.13 features for capturing scene depth to a render target from an ortographic scenecapture2d.

However, I'm currently having these issues which leave me unable to proceed:

1) The Setting "Capture Source" in 4.13 has an option for capturing "SceneDepth in R" However, there are no settings for the depth scale of the capture. The default settings give me a very narrow depth so I only see what's immediately in front of the camera.

I found a workaround for this though: By instead capturing "Final Color (LDR) in RGB" and using a post process material with a "SceneTexture:SceneDepth" node, I can then divide by 10000 before outputting to emissive which gives me the intended result!

This though, leads into another issue:

2) The Blueprint Node "Capture Scene" does not seem to work with the "Final Color (LDR) in RGB" setting on the SceneCapture2D.

It works fine if the scene capture is set to any of the other modes (Scenecolor, normal, scenedepth), but Final Color just gives a black result. Worth mentioning is that it works fine if I check the "Capture Every Frame" Box, but I can't do that for performance reasons.

Any help would be super appreciated, thanks!

Product Version: UE 4.13
Tags:
more ▼

asked Oct 06 '16 at 01:20 PM in Rendering

avatar image

LudvigLoven
1 1 2 2

avatar image AndrewHurley Oct 06 '16 at 05:37 PM

Hey LudvigLoven,

So I am a bit confused by your post, and maybe you can clarify what you expect to be the end result?

Just for my own sanity, I read over the documentation where we announced the release of Orthographic projection for SceneCapture2D actors, and did not see where we specifically said we support Scene Depth for Orthographic projections.

I believe the reason for this is that Orthographic cameras are by definition a flat projection with no depth. This is why you are getting a single output of 1.0 when using the scene depth option on an Orthographic scene capture. I don't expect scene depth to be supported as there is not way to capture depth with an Orthographic camera.

Let me know if this makes sense or if you have further questions.

Cheers,

Andrew Hurley

avatar image LudvigLoven Oct 07 '16 at 01:57 PM

Hey, Capturing depth with ortographic projection works in 4.13, there just seems to be some bugs with it.

alt text

These are the settings I'm talking about. I'm capturing an SM_Chair from above for illustration.

SceneColor (HDR) Gives this result:

alt text

SceneDepth in R gives this result (Note that's it's not just 0 or 1, but it's capturing just the top of the chair):

alt text

FinalColor (LDR) With a post process material that divides scene depth by 100:

alt text

Same as above but with "Capture Every Frame" Unchecked and the "Capture Scene" blueprint node used in the construction script: alt text

So an update on my first post: What seems to be happening is that the post process material is ignored when Capture Every Frame is unchecked. Why is this?

Also, why is not the depth Scale of the SceneDepth in R capture adjustable, for capturing objects at different scales?

If either of these two issues are solved, I can do what I want! :)

help_1.png (29.7 kB)
help_2.png (44.1 kB)
help_3.png (5.3 kB)
help_4.png (12.3 kB)
help_5.png (80.3 kB)
avatar image AndrewHurley Oct 10 '16 at 05:14 PM

So I am still unable to replicate the issue on my end. All I am getting is a white output using the same settings you are providing screenshots. So in order to confirm what you are reporting, I need to see a screenshot of any blueprint logic you are using to capture the SceneDepth in R output for the Orthographic camera (if any).

I can get all the same results in your other screenshots using the default settings as expected, but I am unable to reproduce the SceneDepth portion of your issue. After I can reproduce your issue, I will be able to more accurately answer your other questions.

Thank you,

Andrew Hurley

avatar image LudvigLoven Oct 10 '16 at 09:25 PM

The SceneDepth in R capture isn't using any blueprint logic, it's just a standard SceneCapture2D, rotated to look downward.

Sorry, maybe I should have been more clear on this, but to get the result in the SceneDepth in R screenshot you will need to align the scenecapture (Z-Value) to the top of the chair.

Try keeping the render target open for viewing and move the SceneCapture2D up and down through the chair mesh, it will then show sections of the mesh due to the limited capture depth.

Here's a screenshot with everything, other than that just a standard blank project with starter content. Hope it helps you! :) alt text

help6.png (844.1 kB)
avatar image LudvigLoven Oct 20 '16 at 11:35 PM

Alright, looks like we'll just have to wait until this is fixed then, as doing a 2048x2048 capture 70 times each frame is not an option. We currently have another script outside of UE4 for the heightmap generation which achieves the same thing, but it takes over 3 hours to run so that's something we would like to get rid of.

Anyways, thank you for your help Andrew!

avatar image iLegacy Oct 13 '17 at 09:43 AM

I've wondered as well why my height data is just glowing white. I'm using SceneCapture2D in Orthogonal view. I was also asking myself, which distance it captures and how I can "clip" the distance and "move" the max. white-point to this specific point (note: the distance-property does nothing in orthogonal mode).

Below you can see how I've done it and it seems very exact.

alt text

untitled.png (45.4 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hey LudvigLoven,

Thanks for the clear and precise repro steps. I was able to confirm what you are reporting and have gone ahead and entered a bug report for the issue. You can track the issue following the link below on our public issues tracker.

UE-37350

Once the issue has been addressed by our engineers either myself or another staff member will return with an update.

Let me know if you have further questions or need additional assistance.

Cheers,

Andrew Hurley

more ▼

answered Oct 14 '16 at 06:20 PM

avatar image LudvigLoven Oct 16 '16 at 11:58 AM

Hi Andrew! Thank you for reporting this, let's hope for a quick resolution. :)

That takes care of issue 1 in my OP, however issue 2 still remains.

First, a better illustration of Issue 1. In this pic I have Switched the Capture mode to Final Color LDR and instead added a post process material that outputs SceneDepth. I've discovered that dividing the result by a value of 3 gives the same output as capturing SceneDepth in R!! This is the parameter I would like to adjust, but it seems to be hard coded to 3 in the preset for some reason. alt text Next, I've changed the divisor in the post process material to 100, which gives you enough depth to capture the chairs and table! It seems reasonable that the SceneDepth in R preset uses a similar method to capture depth, and for the UE4 devs it should just be a matter of adding this parameter to the SceneCapture 2D. alt text

Now on to the actual issue:

When capturing manually from blueprint, post process materials are ignored!

I've added blueprint logic to the scenecapture to capture once upon construction, and unticked both boxes for automatic capturing. Now, as soon as I check the "Capture Every Frame" box, the post process material is applied correctly and the result is as in the above picture. But with manual capturing I'm just getting the Final Color LDR result without post processing (Also it's in Black And white here since I'm viewing the render target with desaturation) alt text

Really frustrating, as we seem to be so close to getting this working otherwise. What we actually want to use this for is automatic heightmap modification (and generation of foliage masks) for a ~1000km² landscape divided into 70 or so different levels, which is why It's not possible to capture every frame. Unfortunately, I can't show anything from the real project for contract reasons.

help7.png (730.6 kB)
help8.png (744.6 kB)
help9.png (976.0 kB)
avatar image iLegacy Oct 12 '17 at 05:44 PM

With the post-process work-around it works for me when I multiply my scene-depth in the post-process-material with at least 0.001. If you only multiply with 0.01 the values get so bright, that the resulting picture looks just white :D

avatar image AndrewHurley Oct 17 '16 at 09:03 PM

This could be a tonemapper render order issue. There is a setting within your Post Process Material so you can designate the order in which the blendable is rendered.

I would take a look at these properties and mess around with those to see if you can get it to work correctly.

https://docs.unrealengine.com/latest/INT/Engine/Rendering/PostProcessEffects/PostProcessMaterials/#replacingthetonemapper

Let me know if you have more questions.

Cheers,

Andrew Hurley

avatar image LudvigLoven Oct 18 '16 at 12:57 PM

No, I don't think that's the issue at all. I've tried changing the blendable order but it makes no difference.

And why would it? There should not be a difference in how the post process material is applied when you're capturing single frames via blueprint vs capturing every frame.

I think this needs another bug report.

Edit: To clarify. 1) The rest of the post process settings (White balance, Color Grading) are applied correctly, but the blendables are not.

2) Even if I do the simplest post process material possible, IE a constant input of 0 or 1 it is not being applied.

avatar image AndrewHurley Oct 19 '16 at 09:30 PM

So I did some more digging and found that what you are reporting is a known issue. You can track it by following the link below.

UE-28468

As a workaround for now you can use the setup I created below, or the one that is working for you.

SceneCapture2D - Component

alt text

This is going to be the current solution you will probably need to use until either bug gets fixed.

Thank you,

Andrew Hurley

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

So still nothing on either of these issues? We have managed to create a workaround for our implementation, where we create a C++ plugin to export the render targets to disk as PNG files during runtime, and then we import them back manually into the editor. It sort of works, but it's... less than elegant.

more ▼

answered Sep 26 '17 at 03:28 PM

avatar image

LudvigLoven
1 1 2 2

avatar image LudvigLoven May 16 '18 at 02:52 PM

Still not giving up on this!

(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