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"

ray traced distance field shadows in VR cause render thread to go up by 10ms on 4.15

I have encountered this issue in two separate projects and it is causing a lot of headache. I am having a hard time pinning down the cause so I cannot give an amazing guide to reproduce this. I have attached a project with a scene that demonstrates this however.

The Issue is that that the render thread will jump up to 14-20ms on a relatively simple scene when using ray traced distance field shadows on 4.15.

Toggling ray traced distance field shadows on and off will also toggle the extra 14-18ms on the CPU, while the GPU maintains 6ms shadows off vs 11ms shadows on - but the frame time will be around 20ms.

The attached project should demonstrate this. Add more occluders or shadow casting light sources to exaggerate the issue.

Windows 10, gtx 980, intel x99 platform

Screens from my profiling session are attached and the


PROJECT CAN BE FOUND HERE

Please note

The issue only appears when playing in VR, with a VIVE in my case the the setup in this project with the bunch of lights in one spot is a little ridiculous but I to reproduce it somehow. I have another real world project where the same thing happens with just one directional light and one sky light in a scene with like 50 static meshes and 20 rather simple skeletal meshes.


alt text

alt text

alt text

Product Version: UE 4.15
Tags:
more ▼

asked Apr 04 '17 at 12:04 AM in Bug Reports

avatar image

Pedram Navin
98 3 12 11

avatar image Pedram Navin Apr 04 '17 at 12:09 AM

On a side note, I was able to see the same behavior on another project when toggling ray traced distance field shadows, the same way as here BUT on yet another project the behavior happened when switching between MSAA and Temporal AA.

So this might not be 100% exclusive to ray traced soft shadows, but this was the only way i could reliably reproduce the issue.

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

1 answer: sort voted first

Can you post a 'stat dumpframe'? That will show a hierarchical timing view of the rendering thread.

Ray Traced Distance Field shadows aren't supposed to cost much on the Rendering Thread (the whole algorithm is on the GPU), but they do lock a vertex buffer to upload some data. There was an issue in the past where locking a vertex buffer was slow, as it would require flushing all pending RHI commands. That has been fixed, although I don't remember when.

As an aside, we unfortunately haven't really tested distance field features in VR, since our VR projects stick to almost completely static lighting for performance.

more ▼

answered Apr 05 '17 at 04:16 PM

avatar image

DanielW STAFF
1.9k 31 11 72

avatar image Pedram Navin Apr 05 '17 at 05:00 PM

Here is the dump https://pastebin.com/vfLVapLU

I definitely wasn't expecting the CPU to be an issue when first testing this in VR, but every time this or some variation of this issue comes up, FViewExtensionPreDrawCommand seems to take up all of the time. I was not able to find any documentation on it and was hoping you might know how it relates to the issue.

Thank you very much for looking into this.

In reply to the aside, the project am I working on, makes the trade-off of having realtime shadows in a limited capacity through this feature, and disregarding the issue at hand, they work beautifully.

avatar image DanielW STAFF Apr 05 '17 at 07:12 PM

Yep it's all in 20.659ms ( 1) - FViewExtensionPreDrawCommand

That's the Vive implementation callback. I'm afraid I don't know what happens in there, I'm not familiar with how the Vive integration works.

If I were investigating this, I'd do a sampling profile (either through Visual Studio or something like Very Sleepy CS) which would show all the callstacks (stat dumpframe only shows manually placed events which is why we can't see further detail).

avatar image Pedram Navin Apr 05 '17 at 07:37 PM

Got it! I will do further investigation on that.
Thanks so much, can't wait to get my hands on the upcoming improvements to SDF stuff in 4.16!

(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