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"

Massive draw calls from nothing?

alt text

So my vr game has been having performance issues. today they got worse and i discovered that if you open a blank project, the draw frame is 16 ms(+-2). The gpu frame time is the same and the game frame time is 2ms. If you run the game in selected viewport, the draw frame time goes down to 0.05ms? what could be causing this?

edit: here is the profile

Product Version: UE 4.12
fuuuuuuuu.png (40.4 kB)
more ▼

asked Aug 06 '16 at 03:46 PM in VR

avatar image

5 2 4 7

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

2 answers: sort voted first

Hello, RedWolfy70,

If you see the draw calls and draw frame time while on editor, you are getting the results of everything that is being displayed, including gizmos, overlays, sprites, etc. Everything you see on editor is contributing to this result.

When you play in editor, the draw frame time goes down because you are no longer rendering those editor only elements. This is the result that will be closer to you playing your actual game in your device.

Remember also that if you change your view to see more or less of your scene, your draw calls will update accordingly, so it is a dynamic value that you have to keep track of at all times, sampling views that for example might reflect the max. number of objects your user will be able to see at a given point. Also take into consideration that using dynamic lightning will increase the number of draw calls that you make, so try to use static lightning whenever possible, on as many objects as you can.

As a tip on improving performance, I will asume that you are keeping track of your draw calls because you are developing for mobile as that's where they matter the most. In my experience, static batching is what helped me the most to optimize my game. Dynamic batching doesn't work well on mobile and if it did, I believe the CPU cost of doing it on runtime would offset the time gained by reducing draw calls anyway, so it is not the way to go. If you are doing, for example, foliage painting, you are probably getting this and you are not improving performance as much as you think; might actually be making it worse.

On the other hand, doing the batching by hand and not on runtime gave me all of the gains I was expecting. That means creating a new Static Mesh asset for the group of objects you want to group and render on one draw call. Luckily, you can do this easily within the editor.

In the editor preferences/Experimental, enable the Actor Merging tool. Now, on your Window menu, you will find this tool that will help you easily take actors that have been placed in your level and replace them with a new Static Mesh asset that will have them grouped. That is the way to go on effectively reducing draw calls on mobile. Deciding which objects to batch will be a matter of balance and case by case consideration.

All other optimization tips apply, like staying away from translucent materials to avoid overdraw, and (if on mobile) never doing UV's operations on the UV inputs of your texture but doing them on the Custom UV channel of the material instead (so, on your vertex shader instead of the pixel shader).

Hope this helps. All the best.

more ▼

answered Aug 07 '16 at 12:48 AM

avatar image

591 13 10 34

avatar image RedWolfy70 Aug 07 '16 at 09:44 AM

Hi, thanks for the response, unfortunately the issue is not to do with optimising the amount of draw calls, it is to do with the fact that a single draw call -"FdrawSceneCommand /self" is taking 20ms to complete every other frame

avatar image Diego_Visualma Aug 10 '16 at 04:16 AM

Sorry, RedWolf, yeah, I misunderstood you.

I have no idea what would be causing this, being in a clean project. I found past references to that same call being overly long, and they don't seem to have pinpointed a particular issue. I am sure you read those too: Some people getting it from media textures, some pointing to driver issues, random updates making it go away.

What I would do is try it on a different machine to confirm that it is not actually a driver issue as suggested, and also play around with the project settings? Maybe some experimental feature or VR specific setting is not working as expected, or some setting required for performant VR is turned off?

I hope you manage to fix it. All the best.

avatar image ExpMethodAS Nov 23 '16 at 02:15 AM

I posted this question regarding FDrawSceneCommand [here][1]

It's reproduceable in a blank project. [1]: https://answers.unrealengine.com/questions/439393/fdrawscenecommand-self-gameplaythread-stall.html

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

Optimization is definitely out of my comfort zone, but since you are working on VR I have to ask. Is your GPU up to par? We have no base comparison to a blank non-VR project so for all we know that number could be the standard for your machine. We also don't know your environment.

more ▼

answered Aug 10 '16 at 04:28 AM

avatar image

1.1k 31 8 40

(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