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"

How to reduce my draw calls greatly?

Hi there,

I'm currently building up a large construction project inside the engine, and I'm coming across issues with my draw calls. The models themselves come from Autodesk Inventor as individual pieces, I then created my game models bake etc. and into engine just fine, with all my LODs working fine the total rendering tris is always sub 100k, but as this is a huuuuge structure , there's over 16000 meshs!

I've broken down the structure into modular chunks, compiling section inside blueprints, then placing those around, but it still seems that even those models inside are still counting as 1 drawcalls? is there a method to combine all those meshes maybe to drastically reduce my calls!?

Any help would be greatly appreciated! I'll add some pics shortly too!

Product Version: Not Selected
Tags:
more ▼

asked May 22 '14 at 01:38 PM in Rendering

avatar image

Bailey
1 1 3 3

avatar image Bailey May 22 '14 at 01:45 PM

http://postimg.org/image/mjkdv1sa7/

http://postimg.org/image/nn4i70cxb/

http://postimg.org/image/y2fqd1gfj/

Pics are attached, those LODs are for the lowest level mind but I just made them all appear really close because of the fps atm!

avatar image Lovecraft_K ♦♦ STAFF May 22 '14 at 04:14 PM

Hi Bailey -

I want to understand exactly what your have; you have constructed modular pieces through a Blueprint, but each mesh is still separate? Also what do your materials look like, how many materials are on each mesh and how many textures in each material.

I think I can help you reduce but I want a complete picture of how you've constructed them before I answer.

Thanks

Eric Ketchum

avatar image Bailey May 22 '14 at 05:09 PM

In total there is 11 different meshes in the entire scene. They each have there own material (which is instanced from 1 master material). The master material only contains 3 texture maps, then differences in the instances are normal map changes.

The modular sections are compiled inside blueprints, 1 blueprint contains a variety of the 11 different meshes I mentioned above. Does that help?

avatar image Lovecraft_K ♦♦ STAFF May 22 '14 at 05:45 PM

Hi Bailey -

Yes that helps, can you also add a screenshot of the Primative and Texture Stats from the Statistics page (Window >> Statistics)

Eric Ketchum

avatar image Bailey May 23 '14 at 07:26 AM

Morning!

http://postimg.org/image/g0rtwndpb/

http://postimg.org/image/3nezpqo0v/

(Normal Maps are yet to be shrunk) But I don't think that's an issue currently!

Thanks for looking into this for me :)

avatar image Lovecraft_K ♦♦ STAFF May 25 '14 at 09:16 PM

Hey Bailey -

Have you tried instancing your static meshes in the blueprints? How are your components set up in Blueprint?

-Eric Ketchum

avatar image reefG ㇱ May 26 '14 at 03:05 PM

Hi Eric, Bailey,

I have been following this post with interest.

I too would like to know how to reduce draw calls, but primarily for Mobile.

Eric, I have implemented static mesh instancing as you describe and it works great for the desktop, but it doesn't work on mobile!

My question, and I hope I'm not hijacking this thread, is if we're to use constructor scripts for building levels with static meshes, that results in a lot of draw calls if targeting mobile. Which is kind of ironic, as mobile is way more sensitive to draw calls than desktop.

Thanks!

avatar image Lovecraft_K ♦♦ STAFF May 27 '14 at 01:51 PM

Hi reefG -

Mobile development is all about making smart decisions and cheating where ever possible. For Bailey's project above, if he were developing for mobile deployment. I would tell him to go back to the modeling program and combine some (read a lot) of those meshes into a single mesh, and probably in all honesty the whole structure should be a single mesh with LODs which could take it down to a single plane.

Constructor scripts are not the way to go in mobile unless you do a lot of work on developing LODs, and limiting the number of instances. It is truly about being smart with your game design and making something actual very small seem much larger than it actual is.

I don't want to hijack Bailey's question here so if you have a further question, feel free to post it in AnswerHub and I will keep an eye out for it.

Thanks

Eric Ketchum

avatar image Bailey May 27 '14 at 07:16 AM

hey guys, thanks for the replies, back in office today!

So you talk about instancing... yet I don't actually see the ability inside my editor to do so? What am I missing here!? I assume that just alt dragging is creating a copy. /headache!

Thanks again for helping :)

avatar image Bailey May 27 '14 at 07:52 AM

So 'Duplicate' actually means Instance it would seem, but without any actually indication / information about it! I'll rebuild the blueprints and retry.

avatar image Bailey May 27 '14 at 08:31 AM

Hmmm you can only duplicate inside the blueprint (Not Copy) so i would have originally did this, bringing in 1 of each component initially, and duplicating / placing it together within the blueprint.

avatar image reefG ㇱ May 27 '14 at 12:20 PM

Hi Bailey, you need to use something like this.

That script will place 1000 instances of the "bot" static mesh, in a single draw call.

Works perfectly for me on the desktop, but what I want to know is how do we handle something like this on Mobile?

Hope that helps!

alt text

untitled.png (131.0 kB)
avatar image RyanB STAFF Jul 03 '14 at 08:39 PM

haha thank you for this. I actually have not placed instanced meshes inside BPs yet and wasn't sure you needed that "add instance" node. The more u know!

avatar image Joe1029 Jul 02 '14 at 10:05 PM

Hi Eric,

I cane across this page trying to optimize my own project. Lots of good info, I would just like to clear some things up for myself if you don't mind.

So if I have 1 static mesh with 2 materials on it, instanced in a BP 20 times, it would count as 2 draw calls right? And the way I understand it, no matter where those meshes are in the world, if one is being rendered all of the instances have to be rendered with the same LOD. Is this right? So if I can only see one of them at the moment in game, it would still have to render 20 times the necessary polygons and just 2 draw calls, right?

Thanks, Joe

avatar image Lovecraft_K ♦♦ STAFF Jul 03 '14 at 01:50 PM

HI Joe1029 -

Yes you are correct there would be 2 draw calls for those 20 instances and the LODs would be based on the "original" settings of the one mesh. Usually the hit to performance comes from the draw calls and not the rendering of the vertices.

Thanks

Eric Ketchum

avatar image Joe1029 Jul 03 '14 at 03:33 PM

That's what I thought. Thanks Eric.

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

2 answers: sort voted first

Hey Bailey -

So I finally have been able to create a significant draw call difference for you to try, It is using instancing, but you will not have to code anything in blueprint just work in the component section. Create a new blueprint actor-based as you have been doing. Instead of adding your static meshes directly into the blueprint, go to the Components Window pull down and add Instanced Static Mesh. In the content browser, select the mesh you want to instance then place it in the Static Mesh area of the details panel for the newly created instanced static mesh. You can now from the Instances area of the details panel add as many of that particular type and it will be treated as one draw call. Important note here, all instances of that mesh will have to have the same material, but it looks like you have that anyway. Each Instance can be located unique anywhere through the Instances area of the details panel Location, Rotation, Scale sections. So for the image you originally shared with me, the draw call would go from many down to just 5.

Here are some images to demonstrate what I am talking about:

Instance

OriginalImage

Let me know how this turns out I would love to see the new draw call information when you get it all put together.

Eric Ketchum

instance01.jpg (183.6 kB)
instance02.jpg (275.1 kB)
more ▼

answered May 27 '14 at 01:34 PM

avatar image

Lovecraft_K ♦♦ STAFF
36.7k 702 260 735

avatar image Bailey May 27 '14 at 03:24 PM

The pic which you referred to in your answer is actually displaying the LOD meshs, which yes, do all share 1 material, but the non LOD mesh which is swaps back does contain different materials (Albeit just a normal map change, its still not the same) I will give this a shot though and defiantly report back!

Thanks!

avatar image Lovecraft_K ♦♦ STAFF May 28 '14 at 02:38 PM

Hey Bailey -

I am a bit confused about what you said about LOD meshes. You should be setting up LODs in the Static mesh editor in the LOD panel not directly through blueprint. That way one mesh is brought into the blueprint and it already has a self established LOD settings through its inherient properties.

Let me know if I am misunderstanding your setup here or if I need to explain further.

Eric Ketchum

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

Yeah they are set inside the static mesh editor, all seems to be working fine, just the initial build inside the blueprint is taking longer to compile, as its harder to clone pieces to move around, nor does it show you what element to duplicate i the list when you click it! When i finish building the section (Currently gotta finish up another project real quick) I'll post some more scene rendering screenshots to analyze the impact your method has made for all to see.

more ▼

answered May 28 '14 at 03:04 PM

avatar image

Bailey
1 1 3 3

(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