Unreal Engine 5 - Insane Building Performance Gains (Using Auto Instancing)
HTML-код
- Опубликовано: 8 сен 2024
- In This Video I'll show how to Instance Houses/Buildings/Random Objects in the scene to get things more performance friendly.
Join Our Discord: / discord
I could have done this better; I left a lot out. I had to redo it several times though for various reasons. If anyone has any questions, feel free to ask.
I did test this on Individual buildings and the performance gains are similar if they share similar pieces
This video helps a lot, thanks man!
How did you pack them as hierarchical? outside of making a blueprint and HISM I cant find away around that. Or if you can do a video on HISM, any help would be appreciated. Awesome video, learned a lot.
It does it automatically. It is Blueprint based, what it does is place them on their own level and somehow links them to a blueprint which is setup to automatically instance them. Those get placed in the world and have features that allow you to remotely re-position the actors in the other level when in edit mode.
@@unrealdevop I will keep at it, but mine always turn to ISM not HISM. Your video is one of the few involving HISM and well done, thanks for the help
@@cbomcnasty Oh I went back and checked it out, it's been so long since I did that video I thought it was a different one. So no, he set those up by hand. This was an asset from the marketplace.
@@unrealdevop oh ok, yea I know how to make in a blueprint, my issue is that I have a map made and need to turn them into HISM. I was looking for options for over a week. So I did discover that foliage tool is HISM without a BP, but no conversion tool like merge actors or packaged, hope this helps someone or maybe a video for you. Thanks for replying, youre the man
@@cbomcnasty I'll try to remember that, thanks for the update.
thanks i'll try this, i was basically making a race map and it had 10-12 different kind of houses repeat hundreds of times by the road side, but even with nanite enabled the fps drop were huge. When i monitored stats it showed most delay due to prepass taking like 30-40ms. Hope instancing can make this better.
If im wrong somewhere do let me know, thanks
Yeah, so this isn't fail proof there are a lot of things to consider that I'm not 100% in the know on but it does prove that instancing can result in performance gains. If performance is still bad after that it doesn't mean that Instancing isn't helping, it just means that some other factor in your scene is consuming performance.
@@unrealdevop worked like a charm. fps from 15 to 90.
Everything else was already optimized
@@phantomgaming5199 That's great to hear. I tried helping this one guy with this and the issue ended up being his landscape and not the buildings as he thought. Performance did increase but fps was still low due to the foliage and trees.
@@unrealdevop i see. yes foliage has given lots of trouble as well. So i just try to avoid it now lol. but 5.1 offers Nanite foliage, haven't tried it on mass scale, but hopefully it will ease some optimization
@@phantomgaming5199 Yeah, just be careful because Nanite does run on the GPU and GPUs have limitations as well. Avoid small debris or anything that is small but with a high count.
thanks for the video! i'm experiencing a weird bug with these: i'm packing pre-assembled kits with my modular assets (you can imagine like a packed wall, packed door, packed roof etc.) and then i'm using those packed actors to assemble a building, however when i scale those pre-assembled kits non-uniformly (stretch them in one axis etc.), and then pack all those packed actors together once again as you show to create one big packed building, all the non-uniform scaling gets messed up. most of them resets to uniform scaling, some of them are streched in more weird ways. this has been going on since 5.0 early access, reported it as bug and asked around in forums but nobody seems to know why. hope i have explained this clearly.
Yeah, I haven't experimented with distorting the scale of them, but I could see how that may cause issues with Instanced pieces. Have you tried this in 5.1 Preview 2?
@@unrealdevop yes, same issue persists
@@ali3ser Why not just use the UE 5 Modeling tools to bake the scale into the mesh...jump in the discord and I'll walk you through that if you need.
@@ali3ser discord.gg/38ceaJ67Eu
Nice!i have a question though, would this be useless when using nanite on all static meshes or would it increase nanite performance too?
For simple geometry, Nanite can have a slightly Negative impact on performance. In this scene when I wasn't recording my FPS dropped from around 175 fps to around 160-170 fps. I may redo this video again. Nanite didn't have a significant impact so if you were using Virtual Shadow Maps it could actually be beneficial since they work best with Nanite. I'm not sure if I had that enabled but it's likely since it's on by default.
@@unrealdevop i had hundreds of simple wall mesh in my level (4 vertices each) without nanite but had bad performance. With nanite enabled on said mesh it doubled(and more), but it could be because i use both lumen and virtual shadow maps
@@memeproductions4182 Yeah I guess it just depends. I haven't experimented with it much and in this case, it didn't really seem like the performance was affected much...it depended on my positioning...if I could see all instances there was a slightly lower performance uplift but I'm not even sure at this point. It's hard to say. When I viewed them as a player would not overhead the performance was actually better with Nanite enabled.
Wow nice! On an basic empty scene (floor, sky and light) I get from 25 to 40 fps on good days.
Yeah that might be Lumen and virtual shadow maps if your using an older card like a 1080 or something like that. Default settings have those two things on as well as that new Anti-Aliasing method Temporal Super-Resolution. Disabling all of that should get you 40-60 fps back
@@unrealdevop I think it is 3070 rtx. I'm gonna try your advice and check the anti aliasing. That is strange because it really depends on days. I can have 40 one day and 15 on the same scene the next day
@@unrealdevop thaaaaanksss saved me
@@marcapouli7805 Ah yeah, the 80 and 90 series GPU's are really the way to go honestly If I had a choice between a 4070 and a 3080 I would probably buy a 3080. Best bet when it comes to these things though is to check the benchmarks and to watch videos. If I'm not mistaken though I think the 70 and lower are always rated below the last gens 80's and higher. VRam is really important for game development, so it's worth considering that as well.
@@unrealdevop I think you are right, but I don't choose anything. I would never be able to buy computer gears, I take what I'm given 😅
I dont know if im dumb or what... i used it on my level packing all the building meshes and rock assets in one package but the fps dropped from 100 to 70 and it gave me visual bugs on some of the meshes
Test it outside of the editor
Can you make a video on your method of making clothes and fitting them to a character in Character Creator 4? Thank you!
Sure, I'll try to do that this weekend when I'm not so busy. If you'll remind me that would be great because I have trouble keeping up with stuff like this when I get really busy.
You can reach out to me on my Discord. discord.gg/38ceaJ67Eu
Hey there, thanks for the video. I have a question.. Maybe I missed it. But in my BP actors, i'm not able to actually see a second instanced static mesh component. The first one renders and i can manipulate it anyway i want to. The problem occurs when i add a second ISM Component (i want to make an actor consisting of different shapes, like you have). That second component remains completely invisible
You can try joining the Discord and sharing some photos, I've never seen that though. Be sure it's the same static mesh and that it is using the same material.
what if i want the GPU to remember the duplicated house but from a random location in the world? so the pivot point stays in the center of the house, but for all the houses, is that possible?
The Location of them on the HISM or ISM is the pivot point actually, you can't however have the HISM split up to have multiple actual Pivot Points. When things are instanced the game will treat the HISM or ISM pivot point as their location. Although this will improve performance you have to be careful actually doing this, over instancing things can cause some issues for example GPU hitches when large packages get thrown at it at once....because of this, you don't actually want to do it like I did in this video, but instead break them up into smaller packages. City Blocks might be ok but Entire Cities would not be a good idea.
Hi!!, i have a question. Im using a map fully on meshes with Nanite, Lumen and Virtual Shadow Maps with World Partition, besides some hitches in GPU while the player is moving we are getting a lot of big hitches in RHIT but we dont know where it came from, even when the player is not moving. Thanks
It's hard to say, I would have to look through some GPU stats. Maybe contact me on my Discord and send me a Developer Build and I'll see if I can figure out what it is using the profile tools.
Also, make sure it does it outside the editor. It could just be an issue with lots of Nanite running inside the editor.
Can I do this with actors spawned at runtime?
Yeah I believe I've seen people do it before, I don't mess with level design that much anymore. I've been focusing on Animation lately, but I am pretty sure that's a common thing.
i had rocks anbd didn't make a lick of difference for me. though I am using 5.3.2.
There is a point where if you overdo it, performance can actually get worse. This works best on a Small - Mid scale, if you try to use it on a Large or Enormous Scale...then you actually get to the point that performance gains level out and may even decrease performance causing fps to drop.
Perhaps. I am more concerned about my tree density. right now i think that is part of the issue with it being way too dense. But no denying it can be a bit tedious dialing in that ideal density to promote proper gameplay interaction without having too many trees in the way. fun times as they say lol.@@unrealdevop
@@jamesbrady1930 Yeah but for the most part this is automated for Trees and rocks and stuff like that unless your placing them by hand. Also Static Meshes to get Batched Automatically by Unreal Engine...I don't know to what extent though but I've been told that Instancing them Manually is still better in some cases.
@@jamesbrady1930 In other words if your using Landscape tools to place things, then it's already being Instanced, which would explain why you didn't see any difference.
the large rocks themselves are hand placed.@@unrealdevop
seems some what to work but for a small area its making a new map?
Packed Level Actors store them as loose actors in a separate level yes. I don't think Packed Level Actors maintain that form once they have been Compiled. I would have too look into that.
The Numbers you see on the Thumbnail are 100% Real and not Click-Bait (Both Images were taken from the same camera angle in both scenes). Instancing is used Religiously in games for performance reasons but you have to know how to properly use them.
The point to take away from this is Instancing because that is what it's doing. Instancing is used often in Games. It's by no means a new method and is a tried and proven method. Instancing is Automatically applied to Foliage when you use any of the Foliage tools and PCG also Auto-Instances things. If you look into it though you will learn that Foliage across an entire map will not be one single instance but instead will be instanced in blocks. This is because when you load an Instance the GPU has to draw all of that stuff and if you throw 1000 instances at it then the entire game will Hitch when it suddenly has to draw 1000 objects onto the screen.
Also Instances are treated as a single object and you can't selectively stream in pieces. It's also worth noting that if you have too many objects instanced eventually it will actually start having a Negative impact on performance. You can imagine a Line chart where it reaches peak performance gains and then starts declining after that until it's not helping at all.