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"

CustomDepthTemporalAAJitter Does Not Work

Hi everyone,

I've noticed an inconsistency with the r.CustomDepthTemporalAAJitter command. When disabling this feature (through the project settings or setting the Cvar runtime), it does not work on all objects that are drawn into the Custom Depth buffer.

Static Meshes are excluded from this feature entirely and they still exhibit the effects of the TemporalAAJitter when they are drawn into this buffer. Ideally this feature should be consistent across all objects that are marked for rendering into Custom Depth.

I've prepared a Demo scene to display the jitter.


Steps to repro this issue:

1: Load up the Demo Scene and hit Play

2: Press the 1 Key to toggle the CustomDepth visualization

3: Press the 2 Key to toggle the CustomDepthTemporalAAJitter command

4: Press the 3 Key, which will reduce the Screen Percentage size which will exaggerate the Jitter effect

I suspect this may be related to the DrawLists defined by the Primitive Scene Proxy, I may be able to circumvent this issue by creating a new one and forcing it out of the Base Pass, but any other suggestions would be helpful.


Product Version: UE 4.16
more ▼

asked Jun 20 '17 at 02:06 PM in Bug Reports

avatar image

Alex Halchuk
16 3 3

avatar image the_batch Jan 04 '18 at 04:09 PM

I'm struggling with this same issue. I'm trying to make a simple, nice-looking post-process outline, and the Temporal AA is ruining the effect with its jittering.

As you said, Alex, changing the "Custom Depth with TemporalAA Jitter" setting in the project settings, or changing the r.CustomDepthTemporalAAJitter variable via the console, does not actually affect the custom depth pass. It continues to jitter away, and any post process materials that use the custom depth or custom stencil passes are negatively affected.

For my use case, many people have suggested setting the post process material to be applied before tonemapping. Doing so does reduce the apparent jittering, but this is a workaround and not a solution because it introduces other issues.

When scheduled before tonemapping, the jittering goes away because Temporal AA is later applied to the results of the outline post processing material. Unfortunately, this means other post processing effects (such as color correction) are also applied as well, which is not the ideal behavior in my case. Worst of all, when applied before tonemapping and before Temporal AA, the outline appears to fade in and out when the mouse is moved over and off objects quickly, because Temporal AA blends frames together over time.

Long story long, the ideal solution is for the material's input — the custom depth or stencil pass — to not have the jittering issue to begin with. That's what the r.CustomDepthTemporalAAJitter setting is supposed to do, but it doesn't work the way I need it to.

I'll try to send a note to Epic about this. Maybe it's something they can improve in an upcoming version of the engine.

In the mean time, Alex, did you ever find a solution to this issue? Does anyone else have any ideas?

avatar image Alex Halchuk Jan 05 '18 at 04:21 PM

I wasn't able to investigate this issue much further. If I recall, it was an issue that was specific to StaticMesh scene geometry, whereas skeletal meshes like characters seemed to behave correctly with this feature.

The only workaround I've found is to simply convert a static mesh into skeletal mesh like in the demo scene. It may work for things like pickups, but it isn't really suited to doing custom depth on environments.

I'll repost this to UDN and see if I can get some sort of response there.

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

1 answer: sort voted first

So there's a solution, and it's a one line fix provided you can recompile the Engine source.

In FPositionOnlyDepthDrawingPolicy::SetSharedState , you simply need to change View->ViewUniformBuffer to DrawRenderState.GetViewUniformBuffer()

After this change, the feature works exactly as it should for all primitives.

more ▼

answered Jan 14 '18 at 02:27 AM

avatar image

Alex Halchuk
16 3 3

avatar image the_batch Jan 23 '18 at 01:57 AM

Excellent! That did the trick alright. I appreciate your determination!

With that figured out, I guess I need to deal with softening my edge detection material to compensate for the aliasing that's now left in the Custom Depth pass. Ah, another day.

Alex, did you determine whether this one-line change represents a bug? Or maybe some kind of weird intentional behavior that Epic has chosen for the engine?

In any case, nice work and 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