Tips: -If the instances are invisible in game, go to the material editor and enable *Used With Instanced Static Meshes* - Use instances only for objects close to each other, because the whole group is either rendered or hidden (culled) at once - no granularity here. - Several instancing components per actor are OK, and can help with the issue from the previous point. -You can't vertex paint individual instances - though you can paint the mesh and save, if identical copies are not a problem for you.
not for this project :))), i looked everywhere for a proper tutorial but i couldn't find any, i'm asking if you can do a favor to me and show me how to make it please :)
Yay, finally! Very informative, thank you very much. :) Btw. if you didn't know: you can right-click a pin (like tranform and location) and "split struct pin" instead of the "make transform" nodes. Just makes your BPs a little bit more compact. You can also right-click and "promote to variable", to skip some steps, when you want to use new variables :)
Wielkie dzięki za ten kanał, od lat uczę się modelowania, ale wraz z własnym rozwojem, zacząłem bawić się shaderami i wciąga mnie to coraz bardziej. W pracy trafiłem na problem związany z sortowaniem przezroczystości, potem trafiłem na film z ditheringiem. Później szukałem czegoś o shaderach na YT i trafiłem na Twój material płonącego drewna, zacząłem więcej o Tobie szukać i okazało się, że prowadzisz cały kanał na ten temat, na którym ponownie znalazłem wspomniany wczesniej dithering. Super jest to co robisz i doceniam! Ta cała wiedza z różnych dziedzin miksuje się w jednym miejscu, bardzo mnie to fascynuje. To jest chyba to, czym chciałbym się zajmować, ale obawiam się, że może już być trochę za późno z nadgonieniem wielu rzeczy. Chociaż - kto wie... Ledwo po studiach trafiłem do pierwszej poważnej pracy i ze stanowiska 3d przeniesiono mnie do robienia efektów i każdy kolejny kawałek wiedzy, każdy kolejny efekt, który uda mi sie osiągnąć jest jak diament... Zdaję sobie sprawę, że historia życia jakiegoś randoma spośród komentarzy jest nic nie warta, ale miałem jakąś wewnętrzną potrzebę się tym podzielić. Tym bardziej, że ludzi z taką wiedzą i to we własnym kraju jakoś ciężko mi znaleźć : ) Pozdrowienia!
Thank you so much for doing these tutorials. They're very easy to follow and are structured so well. Can't praise your work enough. Looking forward to the next tutorial!
I'm so glad that the structure and pace works well! I was worried by the length of this one. Initially I thought that slides would take a bigger part, as "it's just a setup"
+Kinos141 Merry Christmas :) So you're using instancing for buildings? I'm interested whether it's a final solution for you or just for prototyping? What problems had you encountered? I'm curious how you handled variations
I do not browse specifically for anything. But want to make some beautiful space scenery and this really helped me. And the way you explain it is top notch. I usually like YT channel = ''barry lowndes'' , '''CGUOD'' , ''Project Torture'' , ''MrFalaranah'' , ''liaret'' , ''Jonas Mølgaard'' , ''GameDevMan'' , ''GameDev1909 Gaming and Guides'' , ''Steve's Tutorials'' , ''Tesla Dev'' , ''UnrealTek''. Also watching Unreal Engine 4 official channel but they have like 1 - 2 hour streams so its hard to check it, but lately they had a video about photorealistic rendering in real time and how to disable game-optimising for mesh/light/textures so you can achieve better quality when going for maximum quality.
super helpful while debugging my current framerate and even though my game's for mobile, it showed me some tools i can work with, thanks :) just have to figure out the numbers I should achieve for having more mobiles being able to play my first map :)
As a quick follow up on this, I used the techniques you explained in your video to create a UE4 blueprint that allows creation and animation of hundreds of identical instances along a custom spline. This is achieved by building up the instances for one frame, destroying them and then building new ones up with a slight transform in the next frame (for me this turned out faster then modifying existing instances). The input mesh I used was quite detailed as well. Before framerates dropped to the 20s range on my gtx 1080 now the application stays steady at 120 in editor. Wouldn't have been reasonably possible without this technique so many thanks again and keep up the great tutorials!
Amazing. And... it shows how serious (not straightfoward actually) performance problems Blueprint can have. If destroying is faster than updating. Most of the time it's brilliant, I love BP, but this or ray casting can murder performance. Well, I have to make a video which compares C++ to BP in various scenarios, just out of curiosity.
+Juri K ... with the new 4.14 lightmap sets feature? (day/night) ;> I don't promise yet but sounds interesting. How'd you do it from the level art perspective? As I think of the channel should be art focused
I would be interested in this as well, your videos are very informative and useful, please continue. They are especially useful for me as I'm transitioning from Unity to Unreal and examples (which UE doc is seriously lacking) help bring me up to speed much quicker. Much appreciated! :)
"One thing to know about instanced static meshes is that if any part of the mesh is rendered, the whole of the collection is rendered. [...] It’s recommended to keep a single set of instanced meshes in a smaller area; for example, a pile of stone [...], a stack of boxes" software.intel.com/en-us/articles/unreal-engine-4-optimization-tutorial-part-2#instanced-static-meshes
:D Sure, I will. Now I'm planning a series on lighting optimization in UE4. (Houdini basics should have been done as well, but I'm still playing with the environment I'll use for it)
only one small question, if i use this for grass (without foliage tool just this method) is there any chance that i can specify to place itself on the ground without clipping thru? like.. detecting the ground and place itself above it? thx again and yes i know it may sound a bit silly my question but i'm trying to learn
+wabachi You'll have to write some crazy construction blueprint. Foliage tool makes use of instancing, but even more optimized is the Grass Tool. It's harder to learn it, though, but after you get through you'll see it's really easy to use. You assign a grass type in the landscape *material* and it gets automatically spawned on the certain painted layer of landscape: docs.unrealengine.com/latest/INT/Engine/OpenWorldTools/Grass/QuickStart/index.html
5:28 gave me an idea, say we have a town ur walking to a specific building and you didnt group any meshes outside. However in the building you group meshes together because theres no point in culling as oppose to outside you cant call because everything is popping in and out. Obviously using level streaming when going towards/inside the building.
That 30 min tutorial took a lot of time from you to make it , thanks a lot mate for your time , btw are you enginer in some big games company :) ? you have great info .
+N Noni You're welcome :) It was also slowed down by a commission, crunch time and a long illness. A month of surprises... I have sticked to small companies for now. I joined QubicGames, my first job, when the company sort of 'rebooted'. There were only several in the beginning but they got Nintendo DS devkits and their custom 3D game engine. Gradually we've grown to 15. This let me switch roles from environment art to racing level design to tool scripting. I learned a ton by discussing with programmers, which was natural in such environment. Then I led a team of 4 artists on a VR project in Unity. This was a big switch to PBR rendering, which was just emerging in games then, so we learned by experimenting. Such a small team won't be able to produce entire cityscapes or coastlines without tricks. So I read every GDC paper I could get my hands on ;) Now I work in Houdini in a VFX company (amazing piece of software btw.) But I'll be getting back to games definitely.
Tech Art Aid That's good to hear , good luck mate , no need to ask what kind of tutorial we need as you already surprise us every time you upload such unique tutorial so thanks again .
It's fine, thanks. Marek Černoch is right, though this behavior of Unreal loops is unconventional (for loops are usually done with < operator in C++ world)
Great video but still have questions: 1. What's the difference between regular Instances and Hierarchical Instances? 2. How can you reference any of the instances in case you need to destroy one, etc? Thanks
Hierarchical support LOD - i.e. simpler meshes based on distance from camera. To reference them just use their index, starting from zero. Instances are added in a linear fashion - if you had 360 instances, the new one will have index 360, then 361 etc. There should be a node called Remove instance, if you dragged the pin from your instance-group component.
AFAIK later Unreal versions added Auto Instancing (in 4.23?). Would you say this manual approach is now less relevant and only for extreme/edge cases? Or is the Auto Instancing actually not that useful?
Auto is based on luck :) I recommend manual where it is still reasonably convenient. You can do Actor -> Merge -> Batch. Also, check out Packed Level Actors - they kinda do that for you
@@TechArtAid Thanks for the quick answer! I'll take a look at Packed Level Actors. :) In my case I wanted to move instances (created dynamically at Begin Play) of like 3-4 different meshes along a spline which I've been finding a bit difficult. Before I just spawned BP actors with multiple meshes inside them, which I think was the cause for some performance problems (not 100% comfortable with profiling though). But when I read about Auto Instancing I wondered if maybe instancing is actually not gonna help me that much?
Ah I see. Updating instances' transform is kinda expensive - but that depends, as always :) You can see my vid Measuring Performance for a lightweight kind of profiling (just milliseconds)
@@TechArtAid But if I only mark the render state dirty at the last instance of each instanced mesh it should be better right? I am aware that it's difficult to give definitive answers to questions like that.
Hello Again, how would you spawn Hierarchical Instanced Static Mesh at runtime? Here is what I have so far: 1) Created a blank BluePrint 2) Added the Hierarchical Instanced Static Mesh component on the left and then choose the static mesh on the right. 3) Saved and then added the BluePrint to the level 4) In the level Blueprint I setup a Get all actors of class and then chose the Hierarchical Instanced Static Mesh BP in the level 5) Connected that to a "Add Hierarchical Instanced Static Mesh component" 6) Connected that to a the F key on the keyboard 7) When pushed the F key when playing nothing happens. Is there something special I am missing? Thank you, John
Was able to spawn the Hierarchical Instanced Static Mesh boxes and then played in the game which is cool but when I use the Get All Actors of Class and save them in a save game object, all the actors are saved but not any of the Hierarchical Instanced Static Mesh boxes. Do you know if these Hierarchical Elements are saved in the Hierarchical BluePrint or are they saved some where else? If they are save in the Hierarchical BluePrint is there a command to save them?
Why does my mesh not show the "Instancing" option? It goes from Static Mesh, to Materials, then to "Instanced Static Mesh Component" But there's no "Instances" section???
Oh god, this is sooo good! I have a question: You said the foliage tool use basically Hierarchical Instanced Static Mesh metod. If so, i will not get any perfomance improvement when spam al lot of tree, or grass with Hierarchical Instanced Static Mesh, right?
+Alessandro Bononi Do you mean using HISM instead of the foliage tool? Yes, it probably won't lead to improvements and it will make placing the plants a lot harder. If you're looking for ways to optimize further, I'll try by combining plants into bigger meshes and painting with those - instead of painting with individual grass planes or trees. And sometimes it's better to add polygons but have a better-fitting mesh (cutting off transparent places) rather than simple quads with more wasted space.
great video, i just wanna ask: Having a mesh with 157 triangles + lod Using Hierarchical instanced static mesh Why the instances don't have an independent lod, but they all depends from the first instance ?
Im making a Minecarft style block building game, would instancing meshes be the right method for me to use or is there a even better way? Im going to have several different meshes, first off regular blocks that are identical geometry wise, but that have a different material but also other meshes with different geometry. Amazing video btw! Its hard finding good videos on game optimization for UE4
Oh, thx for letting know there was a 2nd one :) Hmm, instances seem to be a good way to go, but you'll need to divide them further, into separate Instanced Mesh components. One huge group of instances (I mean millions) would be too hard to manage and update. Minecraft uses so called chunks of 16x16x16 blocks, if I recall correctly. This way the code can quickly access and modify nearby blocks, without querying all millions of them.
@@TechArtAid Yeah it does use 16x16 (16x16x256 actually) chunks. I started watching the video on your home page: ua-cam.com/video/J5LXIApQmzA/v-deo.html I havent really finished watching it yet but is this a feasible solution? I wanna go for really maximum performance with the project, as I believe the game Im making might make good as a mobile game as well (tho its primarily targeting console/pc) Im 100% new to instancing, yesterday I didnt even know having 1 actor with a mesh with twice as many vertices as having 2 meshes as different actors gave different performance results so I would appriciate if you could pin point me to the right solution for my appliance
+Rahul Verma It's meant for movable objects. But you can place Lightmass Importance Volume around it - which in 4.18 will generate a volumetric lightmap
This is amazing, great work! I downloaded your demo and then for testing changed the "Instance Mesh" in one of the blue prints to a basic block and then the frame rate went from 120fps to 12fps. It would see that the simple box would take up less CPU/GPU than the complex asteroid. Why do you think this happened?
+Proud Arts Is it possible the box wasn't so simple, e.g. had subdivisions? You can check total triangle count with a "stat Foliage" console command. Check my video "Measuring performance" too see how to enter commands.
+Proud Arts Sure, please do! From Gumroad/license: "You can also use and remix them for any purpose, even commercially, as long as you mention Tech Art Aid in credits, description or other appropriate place."
Did you use Hierarchical Instanced Mesh Component? Only this one supports LOD. If yes, try tweaking LOD distances. It's calculated slightly differently for instances meshes
Nice tutorial ..... this is for static meshes .... Does this have a similar technique for skeletal meshes ? I mean : is it possible to get hundreds of skeletal meshes working together (like in the total war games) or as a wandering crowd ?
+O Lory GPU Gems article suggests storing animations on a texture (1 pixel per bone's single frame, where r, g, b of a pixel mean x, y, z rotation). Then you apply this data in a vertex shader. http.developer.nvidia.com/GPUGems3/gpugems3_ch02.html It's impossible to do in UE4 (unless you're an engine programmer, probably).
Great topic! I have tried Instancing many times before but every time failed somehow Now I'm going to play with the power of instances ps. how working particles with meshes compared to this Instancing method?
+ScorpyX Didn't test how it compares to GPU mesh particles. Nice idea. Illusion Ray in their Solar System VR used all three (particles, instances and foliage)
Question: is this only really useful if you need to have tons of a certain mesh in a scene at once? I'm using a ton of building meshes for a city, but they're randomly generated and the player typically can't see more than 15 at a time if they try. Would instancing help with this at all?
+John Blaszczyk In your case it will be best to try both approaches and profile them (i.e. measure performance). Check my latest tutorials on how to do profiling. Part 1 should be enough to tell if this approach is worth trying.
+RB FILMS Into another LOD? It tries to do "blending" with dithered opacity mask. Translucency is not possible, because it's a different rendering mode. Check my tutorial on fixing transparency for explanation.
it's a great technique but what about the visibility\frustrum\etc culling, is it faster to cull(hide edraw) individual sm actors(f.e. when we merge actors into a single mesh instead of constructing HISM) or instances in the HISM actor? f.e. if you have some actors in front and behind the mountain, would it be better to make 2 hism actors, or one for all of the meshes. And in what cases would it be better to simply merge them into 2 meshs? Thx
Yes, in such obvious cases (behind and in front of a mountain) it's worth to split into distinct, localized groups. ISM doesn't support culling I think, but HISM does. It's always faster to process then separate actors. An actor has a lot of additional overhead (logic, mesh switch). Merging meshes, on the other hand, adds you memory and can't be culled in parts (except Nanite). Epic in their Matrix demo relies on HISM heavily, even despite having Nanite (both work even nicer together, btw). In latest UE 5 build you'll find a cool usability improvement - you can select and move individual instances in the viewport :)
+Moot Juh They won't. Chances are that setting them as Static and building the level will help - that's the way it works in Unity (static batching, exactly as you said: groups by materials). But I never found a proof that UE has got batching too. (anyone?) But still, it's will save you RAM and the overall number of shaders.
Hi, Thanks a lot, super helpful video, but I would like to ask for a clarification, I am searching like crazy how to bake lightmaps for instanced meshes but I didn't find it. So, it makes me thing that dynamically lighted instances are less expensive then if they are baked and less expensive yet then "pure" (not instanced) static meshes. Am I right ? P.S.: I am a beginner in Unreal Engine 😉
I recall that Unreal, at least UE4, can actually assign individual instances to a lightmap atlas - but only for LOD0. You'd have to make a simple experiment to verify that. In general, it may be true in some cases that dynamic lights + instances are cheaper. That's for example the usual open-world case. These games rarely bake unique lightmaps. And cities, foliage, specifically tend to benefit from mesh instancing & modularity, keeping the memory footprint low. It also makes the work easier for artists.
Hi, I'm trying to figure out why performance is degrading when you keep adding instances at runtime. Even if you add 1 instance per tick, the first 5000 instances are perfectly smooth, but then the performance drops down to 1 fps at 30k instances. When you stop adding instances, everything is fine again, of course. Perhaps you know why is this happening? thanks.
Yes. Adding an instance is an expensive operation. However that's impactful mostly when the ISM component has collisions enabled. In both cases, watch the part in the video where I explain to enable Mark Dirty only for the last instance added
@@TechArtAidStill, I don't quite understand why the instant add/remove operation is not constant time. Instead, it increases as you add an instances. Making it unusable for runtime modification after about 10k meshes per component.
In your example the BP of instance mesh if you move it in a circle path does the collision of each instance will move with the object ? hope you got what i mean .
Yes. Collision shapes (set up in Static Mesh editor window) stick to their instances. I disabled the physics, though, because it was too much for the CPU to update 35,000 physics bodies every frame.
Why is it unwise to set the meshes to static? Is it because the lightmap will be large? I was using this method to create a distant city with meshes of very low resolution lightmaps (
Yes, I meant exceeding the maximum size of a lightmap atlas. If virtual texturing is used for lightmaps too, then it should be fine. Also, volumetric lightmaps (UE 4.18) reduce the difference between static and movable.
+Vee REX It depends on the number of objects and how close they are to each other. If you have many well defined groups of nearby objects, go for it :) Setting instances would take too much time and gives you clones, while HLOD can group many different objects. New HLOD is basically batching, but very smart and without manual LOD work. As I said in 5:06, by batching you reduce the number of draw calls - which is good - but end up with having big meshes, eating disk space and RAM. HLODs also take quite a long time to be generated.
Your Experimental Code does not seem to work in 4.23 killing frames yes but doesn't move anything. Any thoughts? This is in regards to the Update Instance Transform.
Hello, I'm facing a weird issue in 4.19 where a large no. Of hism changes lod simultaneously like if i have 20 hism then 10 hism change lod and then other 10, and it is completely random they are not changing lods 1 by 1 based on screen space. Can u help ?
@@TechArtAid is there a way to manage the group size or is it completely random becuse in my case if i have 30 hisms than 20 or more changes lod simultaneously Is this the way they work.
hi, thanks for video you said that we can update the transform of a single instance, but then we will lose all the performance. But we lose all the performance if we update all the instances individually right? With a for loop for example? In case we want to update only a single one, we lose only a respective fraction of the performance, right?
hey i know this is 5 years ago, but i am wondering, i have a utility widget that i want to spawn in a bunch of tiles, however when i close the program those tiles don't save. is their a way to keep them saved in data ?
Could you still individually vertex paint these instance meshes? I.e. it will cost an extra draw call on for example moss over rocks, but not a draw call per individually painted instanced rock.
+Tjalle We can't paint vertices of instances in editor. Color is an attribute of mesh's each vertex. The idea of instancing makes use of storing a single mesh and duplicating it for free
Tech Art Aid Thanks for the quick reply, I'll look at that then! in case I want more variation I'll just several separate instances meshes for my large scene then, it's still saving performance!
Rly wanted to check it out but couldn't make it to the end. I think some info is great but it gets too diluted: either one talks about instancing meshes, or about what the compile button does, if you get what I'm saying.
I see. I'm planning a text version of this tutorial, and to add new things I learned since. Do you suggest to wrap 'noob info' into some folding sections?
@@TechArtAid Generally I'd think of expanding the different subjects into other videos and/or articles where they part too much in context, e.g. "compiling will take a moment, if you want to know more about this process check out my video on programming logic and ue4 UI", I'm sure that with your extensive knowledge as shown by the video you wouldn't have any issues expanding like this. But of course, then there is style and time ie, what do you prefer? And, "have you got time for that"? In any case, I think that a roll-out or similar solution as you stated, would indeed keep the hole project looking shorter (more concise) and organised, hence more comprehensive.
Do you know of any good ways of adding instances to the HISM generated by the foliage tool? I have a dataset with foliage mesh refs and location coordinates from an external program to generate my forests (the procedural foliage spawning tool in ue is not suitable for my needs) which i've imported into ue as a data table, using that information i can try to add instances however its causing a few strange bugs with the array of instances, the crash log reports errors with the array attempting to go into the negatives aswell as seen in the gif how when deleting the painted meshes the exact number of spawned meshes will remain and be uninteractable or engine crash, and its random which instances will stay while deleting gif of my problem - gyazo.com/1f128f90ef4836cbf83e508f90f94a10 code that was used- blueprintue.com/blueprint/a8yi9q-k/ im pretty dumbfounded and dont really know where to go from here since there isnt too much information on instancing and how the foliage tool works compared to, my aim is to be able to import data and have it be editable with this tool afterwards, any help is appreciated
Either this or the Foliage Tool. It's built into Unreal, is based on the same method and (as the name suggests) has a plenty of options for scattering trees and bushes. The Foliage Tool can for example spawn colonies of smaller trees around the older ones.
@@TechArtAid OK so you actually recomend using that tool to place the trees and if I then adjust a couple of them manually that will not affect performance right? It will remain the same?
Give it a try and check the frame rate :) If you need a solution for grass or dense bushes on a landscape, check the Grass Tool. It's fully procedural, without manual control. It's much more complicated to use and error-prone, though, so try doing everything with Foliage first.
Hi, if I create instances of a static mesh will that include the materials attached too? I mean will it create separate materials or an instance of the main material. Thanks.
@@TechArtAid Nice. Im working on mobile so I know the issue with normal instances is that lod's do not work properly which is where Hierarchical Instances come in handy. Materials have have a similar lod with their textures (mipmaps). How are mipmaps affected with instances as mipmaps are pretty important for mobile? Will each material instance have its own mipmap? For example a far away object will have a lower resolution while a close object will have normal resolution. Will this all work properly?
Mipmaps are handled directly on the GPU, so no worries :) But decrease texture resolution (or in some cases increase mip bias) if textures slow the game down. Also if you're ready for a deep dive into understanding your game's performance, I recommend my Profiling series. I hadn't covered mobile, but it should be possible to profile (aka measure performance of) a remote session on a device. At least it is possible in Unity.
LODs.....LODs......LODs......OMG, never new how much of a difference they can make. I swapped out your 7K TRI asteroid for a simple 1K TRI square box with no texture that you had in the common folder. Went from 120 FPS to 12 FPS. Opened the 1K TRI square box static mesh and created auto LODs and then ran your simulation again and it went back to 120 FPS.
Aside from raw polygon count, there's also 'quad overdraw' - i.e. GPU wasting time on tiniest details, with triangles being so close to each other that they overlap from GPU's perspective (it can't render single pixels, GPUs render shaders by blocks)
I was too, your video helped me figure out why adding foliage to my landscape was killing the FPS. Created LODs for the static meshes used for the foliage tool and frame rated soured back to 120. Thank you!
@@TechArtAid Not to bright when it comes to this have a very hard learning curve do you happen to have any doc or tutorial that you can point me in the right direction? Thanks so much for the responds and keep up the great work
Tips: -If the instances are invisible in game, go to the material editor and enable *Used With Instanced Static Meshes*
- Use instances only for objects close to each other, because the whole group is either rendered or hidden (culled) at once - no granularity here.
- Several instancing components per actor are OK, and can help with the issue from the previous point.
-You can't vertex paint individual instances - though you can paint the mesh and save, if identical copies are not a problem for you.
how about occlusion culling?!
+Ben S: You either see all instances or none. No finer culling
@@TechArtAid no! I mean i think occlusion culling is also good.
Would you please make a tutorial about occlusion culling? Like horizon zero dawn
I don't have to. It's enabled by default in UE :) But instancing doesn't support per-instance culling. Only the whole group at once
not for this project :))), i looked everywhere for a proper tutorial but i couldn't find any, i'm asking if you can do a favor to me and show me how to make it please :)
jump to 6:45 for how to create instances in Unreal Engine
the real MVP
Super helpful! Thanks.
Yay, finally!
Very informative, thank you very much. :)
Btw. if you didn't know: you can right-click a pin (like tranform and location) and "split struct pin" instead of the "make transform" nodes. Just makes your BPs a little bit more compact. You can also right-click and "promote to variable", to skip some steps, when you want to use new variables :)
+Creep Whoa, you're quick! Yeah, finally ;)
And I didn't know that splitting works for basic types too - nice.
Well done! Just want to clarify one section: using instancing doesn't require using blueprints. You can also do it from code. Thanks for the tutorial!
This was a super-useful tutorial, and very well-explained! Thank you very much for sharing.
Wielkie dzięki za ten kanał, od lat uczę się modelowania, ale wraz z własnym rozwojem, zacząłem bawić się shaderami i wciąga mnie to coraz bardziej. W pracy trafiłem na problem związany z sortowaniem przezroczystości, potem trafiłem na film z ditheringiem. Później szukałem czegoś o shaderach na YT i trafiłem na Twój material płonącego drewna, zacząłem więcej o Tobie szukać i okazało się, że prowadzisz cały kanał na ten temat, na którym ponownie znalazłem wspomniany wczesniej dithering. Super jest to co robisz i doceniam! Ta cała wiedza z różnych dziedzin miksuje się w jednym miejscu, bardzo mnie to fascynuje. To jest chyba to, czym chciałbym się zajmować, ale obawiam się, że może już być trochę za późno z nadgonieniem wielu rzeczy. Chociaż - kto wie... Ledwo po studiach trafiłem do pierwszej poważnej pracy i ze stanowiska 3d przeniesiono mnie do robienia efektów i każdy kolejny kawałek wiedzy, każdy kolejny efekt, który uda mi sie osiągnąć jest jak diament... Zdaję sobie sprawę, że historia życia jakiegoś randoma spośród komentarzy jest nic nie warta, ale miałem jakąś wewnętrzną potrzebę się tym podzielić. Tym bardziej, że ludzi z taką wiedzą i to we własnym kraju jakoś ciężko mi znaleźć : ) Pozdrowienia!
This was awesome!! thanks so much. Now I can change my game settings and tackle the performance issues I've been seeing!🤩
Thank you so much for doing these tutorials. They're very easy to follow and are structured so well.
Can't praise your work enough. Looking forward to the next tutorial!
I'm so glad that the structure and pace works well! I was worried by the length of this one. Initially I thought that slides would take a bigger part, as "it's just a setup"
keep up the good work, there aren't a lot of TA help on youtube, so this channel is absolutely a goldmine. THANKS!
Absolutely terrific video! Thank you so much for this!
Thank you for this.
This really helped me with creating city layouts!!!
Thank you and Merry Christmas!!
+Kinos141 Merry Christmas :) So you're using instancing for buildings? I'm interested whether it's a final solution for you or just for prototyping? What problems had you encountered? I'm curious how you handled variations
Thankyou so much! This will greatly improve the framerate of my game!
wow your tutorials are some high quality well explained stuff i saw on youtube, and trust me i browse daily for tutorials. Jeez this is amazing.
+StarScream2092 Thx! Do you browse specifically for something? Which other channels do you like?
I do not browse specifically for anything. But want to make some beautiful space scenery and this really helped me. And the way you explain it is top notch. I usually like YT channel = ''barry lowndes'' , '''CGUOD'' , ''Project Torture'' , ''MrFalaranah'' , ''liaret'' , ''Jonas Mølgaard'' , ''GameDevMan'' , ''GameDev1909 Gaming and Guides'' , ''Steve's Tutorials'' , ''Tesla Dev'' , ''UnrealTek''. Also watching Unreal Engine 4 official channel but they have like 1 - 2 hour streams so its hard to check it, but lately they had a video about photorealistic rendering in real time and how to disable game-optimising for mesh/light/textures so you can achieve better quality when going for maximum quality.
+StarScream2092 Thanks for the names. UE official is good, that's right. From basics to real advanced stuff, like blueprint render targets.
super helpful while debugging my current framerate and even though my game's for mobile, it showed me some tools i can work with, thanks :) just have to figure out the numbers I should achieve for having more mobiles being able to play my first map :)
Great explanation man! You have helped me out more than you could possibly know!
:o Cool, great to know! :)
As a quick follow up on this, I used the techniques you explained in your video to create a UE4 blueprint that allows creation and animation of hundreds of identical instances along a custom spline. This is achieved by building up the instances for one frame, destroying them and then building new ones up with a slight transform in the next frame (for me this turned out faster then modifying existing instances). The input mesh I used was quite detailed as well. Before framerates dropped to the 20s range on my gtx 1080 now the application stays steady at 120 in editor. Wouldn't have been reasonably possible without this technique so many thanks again and keep up the great tutorials!
Amazing. And... it shows how serious (not straightfoward actually) performance problems Blueprint can have. If destroying is faster than updating. Most of the time it's brilliant, I love BP, but this or ray casting can murder performance. Well, I have to make a video which compares C++ to BP in various scenarios, just out of curiosity.
Thank you very much for this !
Keep going !
Excellent tutorial! Thank you so much, this was the info I needed.
Nice to hear that!
Great! Thank you! It's a brilliant tut!
Great Video, Very Informative, Thank you.
Very Helpful. Thank you!
finding your chanal was like finding gold! realy amazing stuff! Thank you a lot, can't wait for your next topic :) !
+Markus Frei Great! Next will be instances pt. 2, then either render targets or blueprint-shader interactions. Feel free to suggest topics too!
+Tech Art Aid very informative! Thanks! My suggestion for the next topic: level-streaming/level loading and unloading
+Juri K ... with the new 4.14 lightmap sets feature? (day/night) ;> I don't promise yet but sounds interesting. How'd you do it from the level art perspective? As I think of the channel should be art focused
I would be interested in this as well, your videos are very informative and useful, please continue. They are especially useful for me as I'm transitioning from Unity to Unreal and examples (which UE doc is seriously lacking) help bring me up to speed much quicker. Much appreciated! :)
"One thing to know about instanced static meshes is that if any part of the mesh is rendered, the whole of the collection is rendered. [...] It’s recommended to keep a single set of instanced meshes in a smaller area; for example, a pile of stone [...], a stack of boxes"
software.intel.com/en-us/articles/unreal-engine-4-optimization-tutorial-part-2#instanced-static-meshes
Thank you fantastic job. I downloaded your assets from Cubebrush to study them.
me first minute in the video : "WHAT SORCERY IS THIS!!!" nice video man thx and keep the good work
:D Sure, I will. Now I'm planning a series on lighting optimization in UE4. (Houdini basics should have been done as well, but I'm still playing with the environment I'll use for it)
only one small question, if i use this for grass (without foliage tool just this method) is there any chance that i can specify to place itself on the ground without clipping thru? like.. detecting the ground and place itself above it? thx again and yes i know it may sound a bit silly my question but i'm trying to learn
+wabachi You'll have to write some crazy construction blueprint. Foliage tool makes use of instancing, but even more optimized is the Grass Tool. It's harder to learn it, though, but after you get through you'll see it's really easy to use. You assign a grass type in the landscape *material* and it gets automatically spawned on the certain painted layer of landscape:
docs.unrealengine.com/latest/INT/Engine/OpenWorldTools/Grass/QuickStart/index.html
i see, thx a lot for the reply
Great explanation. Thank you!
I think I've said this before. But you are amazing!
Great video ! Thanks you
Life saver! Outstanding tutorial!!
Huge help, thank you so much!
This will be perfect for my mountain cliffs thank you :-)
This is very well explained thank you,
Amazing video, this was extremely helpful!
Nice to hear that, thanks
Amazing stuff! Thanks so much!
I owe you a beer or two for your amazing resources. Muchos gracias!
+Mike R Enjoy! I have to speed up preparing new ones, as recently the job change (and book project) disrupted the flow
Fantastic video! Very informative
This was really helpful, Thanks!
Really interesting tutorial thanks
over 9000! cheers. compile 🔥
5:28 gave me an idea, say we have a town ur walking to a specific building and you didnt group any meshes outside. However in the building you group meshes together because theres no point in culling as oppose to outside you cant call because everything is popping in and out.
Obviously using level streaming when going towards/inside the building.
Vid was 3x longer than it shoulda been, tbh
That 30 min tutorial took a lot of time from you to make it , thanks a lot mate for your time , btw are you enginer in some big games company :) ? you have great info .
+N Noni You're welcome :) It was also slowed down by a commission, crunch time and a long illness. A month of surprises...
I have sticked to small companies for now. I joined QubicGames, my first job, when the company sort of 'rebooted'. There were only several in the beginning but they got Nintendo DS devkits and their custom 3D game engine. Gradually we've grown to 15. This let me switch roles from environment art to racing level design to tool scripting. I learned a ton by discussing with programmers, which was natural in such environment.
Then I led a team of 4 artists on a VR project in Unity. This was a big switch to PBR rendering, which was just emerging in games then, so we learned by experimenting. Such a small team won't be able to produce entire cityscapes or coastlines without tricks. So I read every GDC paper I could get my hands on ;)
Now I work in Houdini in a VFX company (amazing piece of software btw.) But I'll be getting back to games definitely.
Tech Art Aid
That's good to hear , good luck mate , no need to ask what kind of tutorial we need as you already surprise us every time you upload such unique tutorial so thanks again .
superb tut
+Scott Bez - Thanks
Thank you very much! You save my life
amazing tutorials in your channel, thanks a lot keep like this :)
Glad to hear you enjoyed it :)
@@TechArtAid of course I've enjoyed, internet is awesome thanks to people like you who do thinks and share knowledge ;)
0 to 50 is 51, not 50 (I assume Last Index means the last index to call function with - for(i = first_index; i
Delete this. This is disrespectful to the author.
It's fine, thanks. Marek Černoch is right, though this behavior of Unreal loops is unconventional (for loops are usually done with < operator in C++ world)
@@brutal6129 i know this is old but i dont understand how this can be disrespectful.
Exactly! Feedback and critical thinking is definitely welcome :)
Very good video. Please make more!
Thanks! I'd like to return to tutorials sooner than later :)
Great video but still have questions:
1. What's the difference between regular Instances and Hierarchical Instances?
2. How can you reference any of the instances in case you need to destroy one, etc?
Thanks
Hierarchical support LOD - i.e. simpler meshes based on distance from camera. To reference them just use their index, starting from zero. Instances are added in a linear fashion - if you had 360 instances, the new one will have index 360, then 361 etc. There should be a node called Remove instance, if you dragged the pin from your instance-group component.
Teşekkürler.
Very usefull video, thank you!
Great video!
Thanks you very mush.
thank you my friend,its useful
+yi sun I'm glad to hear that :) Cheers
Great tutorial!
AFAIK later Unreal versions added Auto Instancing (in 4.23?). Would you say this manual approach is now less relevant and only for extreme/edge cases? Or is the Auto Instancing actually not that useful?
Auto is based on luck :) I recommend manual where it is still reasonably convenient. You can do Actor -> Merge -> Batch. Also, check out Packed Level Actors - they kinda do that for you
@@TechArtAid Thanks for the quick answer! I'll take a look at Packed Level Actors. :)
In my case I wanted to move instances (created dynamically at Begin Play) of like 3-4 different meshes along a spline which I've been finding a bit difficult. Before I just spawned BP actors with multiple meshes inside them, which I think was the cause for some performance problems (not 100% comfortable with profiling though). But when I read about Auto Instancing I wondered if maybe instancing is actually not gonna help me that much?
Ah I see. Updating instances' transform is kinda expensive - but that depends, as always :) You can see my vid Measuring Performance for a lightweight kind of profiling (just milliseconds)
@@TechArtAid But if I only mark the render state dirty at the last instance of each instanced mesh it should be better right? I am aware that it's difficult to give definitive answers to questions like that.
Yes, it definitely will. In this case you can easily see it - just do it in every loop in my example scene :)
Hello Again, how would you spawn Hierarchical Instanced Static Mesh at runtime?
Here is what I have so far:
1) Created a blank BluePrint
2) Added the Hierarchical Instanced Static Mesh component on the left and then choose the static mesh on the right.
3) Saved and then added the BluePrint to the level
4) In the level Blueprint I setup a Get all actors of class and then chose the Hierarchical Instanced Static Mesh BP in the level
5) Connected that to a "Add Hierarchical Instanced Static Mesh component"
6) Connected that to a the F key on the keyboard
7) When pushed the F key when playing nothing happens.
Is there something special I am missing?
Thank you,
John
Good reasoning :) Just replace 5. with Add Instance (not component), dragged from HISM component variable's output pin
That work, thank you!
Was able to spawn the Hierarchical Instanced Static Mesh boxes and then played in the game which is cool but when I use the Get All Actors of Class and save them in a save game object, all the actors are saved but not any of the Hierarchical Instanced Static Mesh boxes. Do you know if these Hierarchical Elements are saved in the Hierarchical BluePrint or are they saved some where else? If they are save in the Hierarchical BluePrint is there a command to save them?
Interesting... Sorry, I never had to store them in a save file. If you find out, on Answerhub or elsewhere, please let me know
Ok, sure will and thank you for all your help!
very good teacher
great video !!
Why does my mesh not show the "Instancing" option? It goes from Static Mesh, to Materials, then to "Instanced Static Mesh Component" But there's no "Instances" section???
Hmm there should be. I used it not long ago
Oh god, this is sooo good! I have a question:
You said the foliage tool use basically Hierarchical Instanced Static Mesh metod.
If so, i will not get any perfomance improvement when spam al lot of tree, or grass with Hierarchical Instanced Static Mesh, right?
+Alessandro Bononi Do you mean using HISM instead of the foliage tool? Yes, it probably won't lead to improvements and it will make placing the plants a lot harder. If you're looking for ways to optimize further, I'll try by combining plants into bigger meshes and painting with those - instead of painting with individual grass planes or trees. And sometimes it's better to add polygons but have a better-fitting mesh (cutting off transparent places) rather than simple quads with more wasted space.
thank you! i'll try to combining in a bigger mesh. i haven't thougt about before.
you save me from the hell fps drop i tried and it gives me 120fps with 1000 of instances
thanks thanks
Thank you :)!
many thanks! :)
will this work for me I have very large 16 tile height map with lots of trees and rocks mountains etc
fajny filmik dzięki! :P
great video, i just wanna ask:
Having a mesh with 157 triangles + lod
Using Hierarchical instanced static mesh
Why the instances don't have an independent lod, but they all depends from the first instance ?
Thx :) They somehow do, but in bigger clusters. That's probably an optimization, to avoid calculating and switching LOD level per single instance
@@TechArtAid thank you so much for you great help, and thank you so much for you quick reply. Your channel is amazing !
Im making a Minecarft style block building game, would instancing meshes be the right method for me to use or is there a even better way?
Im going to have several different meshes, first off regular blocks that are identical geometry wise, but that have a different material but also other meshes with different geometry.
Amazing video btw! Its hard finding good videos on game optimization for UE4
Oh, thx for letting know there was a 2nd one :) Hmm, instances seem to be a good way to go, but you'll need to divide them further, into separate Instanced Mesh components. One huge group of instances (I mean millions) would be too hard to manage and update. Minecraft uses so called chunks of 16x16x16 blocks, if I recall correctly. This way the code can quickly access and modify nearby blocks, without querying all millions of them.
@@TechArtAid Yeah it does use 16x16 (16x16x256 actually) chunks.
I started watching the video on your home page: ua-cam.com/video/J5LXIApQmzA/v-deo.html
I havent really finished watching it yet but is this a feasible solution? I wanna go for really maximum performance with the project, as I believe the game Im making might make good as a mobile game as well (tho its primarily targeting console/pc)
Im 100% new to instancing, yesterday I didnt even know having 1 actor with a mesh with twice as many vertices as having 2 meshes as different actors gave different performance results so I would appriciate if you could pin point me to the right solution for my appliance
Awesom Tutorial @Tech Art Aid. I have one question. How can I use Baked Lighting on this?
+Rahul Verma It's meant for movable objects. But you can place Lightmass Importance Volume around it - which in 4.18 will generate a volumetric lightmap
Actual Asteroid belt creation begins on 13:05
This is amazing, great work! I downloaded your demo and then for testing changed the "Instance Mesh" in one of the blue prints to a basic block and then the frame rate went from 120fps to 12fps.
It would see that the simple box would take up less CPU/GPU than the complex asteroid. Why do you think this happened?
+Proud Arts Is it possible the box wasn't so simple, e.g. had subdivisions? You can check total triangle count with a "stat Foliage" console command. Check my video "Measuring performance" too see how to enter commands.
Great, thank you, I will give it a try. PS: Are name are similar, Tech Art and Proud Arts :)
Can I use the asteroid belt in my game?
+Proud Arts Sure, please do! From Gumroad/license: "You can also use and remix them for any purpose, even commercially, as long as you mention Tech Art Aid in credits, description or other appropriate place."
Thank you, I will defiantly put Tech Art Aid in credits! Your deserve it :)
why do the instances LOD dont work on my project? They all come at the same color when i go into the LOD visualization
Did you use Hierarchical Instanced Mesh Component? Only this one supports LOD. If yes, try tweaking LOD distances. It's calculated slightly differently for instances meshes
@@TechArtAid yes dude ok i will try :) thank you
Nice tutorial ..... this is for static meshes .... Does this have a similar technique for skeletal meshes ?
I mean : is it possible to get hundreds of skeletal meshes working together (like in the total war games) or as a wandering crowd ?
+O Lory GPU Gems article suggests storing animations on a texture (1 pixel per bone's single frame, where r, g, b of a pixel mean x, y, z rotation). Then you apply this data in a vertex shader. http.developer.nvidia.com/GPUGems3/gpugems3_ch02.html It's impossible to do in UE4 (unless you're an engine programmer, probably).
ok... what hardware you have?
i think that the tesselation stage is doing a great job too.
Nvidia GTX 760 2GB, Core i7 3770 equivalent, 16 GB RAM
Could you potentially turn on collision based on the LOD used?
No idea, sorry
Tech Art Aid it’s still awesome though! Thanks for making this video. :)
Awesome video! Is it possible to instance skeletal meshes?
+Helmet Grouse Thanks! No, only static meshes
inspiring
Great topic!
I have tried Instancing many times before but every time failed somehow
Now I'm going to play with the power of instances
ps. how working particles with meshes compared to this Instancing method?
+ScorpyX Didn't test how it compares to GPU mesh particles. Nice idea. Illusion Ray in their Solar System VR used all three (particles, instances and foliage)
Question: is this only really useful if you need to have tons of a certain mesh in a scene at once? I'm using a ton of building meshes for a city, but they're randomly generated and the player typically can't see more than 15 at a time if they try. Would instancing help with this at all?
+John Blaszczyk In your case it will be best to try both approaches and profile them (i.e. measure performance). Check my latest tutorials on how to do profiling. Part 1 should be enough to tell if this approach is worth trying.
are there anyways of making it fade into one another rather than instant snapping?
+RB FILMS Into another LOD? It tries to do "blending" with dithered opacity mask. Translucency is not possible, because it's a different rendering mode. Check my tutorial on fixing transparency for explanation.
it's a great technique but what about the visibility\frustrum\etc culling, is it faster to cull(hide
edraw) individual sm actors(f.e. when we merge actors into a single mesh instead of constructing HISM) or instances in the HISM actor? f.e. if you have some actors in front and behind the mountain, would it be better to make 2 hism actors, or one for all of the meshes. And in what cases would it be better to simply merge them into 2 meshs? Thx
Yes, in such obvious cases (behind and in front of a mountain) it's worth to split into distinct, localized groups. ISM doesn't support culling I think, but HISM does. It's always faster to process then separate actors. An actor has a lot of additional overhead (logic, mesh switch). Merging meshes, on the other hand, adds you memory and can't be culled in parts (except Nanite). Epic in their Matrix demo relies on HISM heavily, even despite having Nanite (both work even nicer together, btw). In latest UE 5 build you'll find a cool usability improvement - you can select and move individual instances in the viewport :)
If you were to add 2 actors in your level and their mesh and materials are the same, will they automatically instance?
+Moot Juh They won't. Chances are that setting them as Static and building the level will help - that's the way it works in Unity (static batching, exactly as you said: groups by materials). But I never found a proof that UE has got batching too. (anyone?)
But still, it's will save you RAM and the overall number of shaders.
Hi, Thanks a lot, super helpful video, but I would like to ask for a clarification, I am searching like crazy how to bake lightmaps for instanced meshes but I didn't find it. So, it makes me thing that dynamically lighted instances are less expensive then if they are baked and less expensive yet then "pure" (not instanced) static meshes. Am I right ?
P.S.: I am a beginner in Unreal Engine 😉
I recall that Unreal, at least UE4, can actually assign individual instances to a lightmap atlas - but only for LOD0. You'd have to make a simple experiment to verify that.
In general, it may be true in some cases that dynamic lights + instances are cheaper. That's for example the usual open-world case. These games rarely bake unique lightmaps. And cities, foliage, specifically tend to benefit from mesh instancing & modularity, keeping the memory footprint low. It also makes the work easier for artists.
Hi, I'm trying to figure out why performance is degrading when you keep adding instances at runtime. Even if you add 1 instance per tick, the first 5000 instances are perfectly smooth, but then the performance drops down to 1 fps at 30k instances. When you stop adding instances, everything is fine again, of course. Perhaps you know why is this happening? thanks.
Yes. Adding an instance is an expensive operation. However that's impactful mostly when the ISM component has collisions enabled. In both cases, watch the part in the video where I explain to enable Mark Dirty only for the last instance added
@@TechArtAid thank you!
@@TechArtAidStill, I don't quite understand why the instant add/remove operation is not constant time. Instead, it increases as you add an instances. Making it unusable for runtime modification after about 10k meshes per component.
@FireF1y644 I'm not sure tbh, but I guess it may be rebuilding some acceleration structure inside? You'd have to trace it with a debugger
In your example the BP of instance mesh if you move it in a circle path does the collision of each instance will move with the object ? hope you got what i mean .
Yes. Collision shapes (set up in Static Mesh editor window) stick to their instances. I disabled the physics, though, because it was too much for the CPU to update 35,000 physics bodies every frame.
Why is it unwise to set the meshes to static? Is it because the lightmap will be large? I was using this method to create a distant city with meshes of very low resolution lightmaps (
Yes, I meant exceeding the maximum size of a lightmap atlas. If virtual texturing is used for lightmaps too, then it should be fine. Also, volumetric lightmaps (UE 4.18) reduce the difference between static and movable.
@@TechArtAid Thanks.
with unreal engine 4.14's new LOD capabilities, is instancing still the best way to go?
+Vee REX It depends on the number of objects and how close they are to each other. If you have many well defined groups of nearby objects, go for it :) Setting instances would take too much time and gives you clones, while HLOD can group many different objects. New HLOD is basically batching, but very smart and without manual LOD work. As I said in 5:06, by batching you reduce the number of draw calls - which is good - but end up with having big meshes, eating disk space and RAM. HLODs also take quite a long time to be generated.
Your Experimental Code does not seem to work in 4.23 killing frames yes but doesn't move anything. Any thoughts?
This is in regards to the Update Instance Transform.
Thanks for letting know. I'll take a look
Hello,
I'm facing a weird issue in 4.19 where a large no. Of hism changes lod simultaneously like if i have 20 hism then 10 hism change lod and then other 10, and it is completely random they are not changing lods 1 by 1 based on screen space.
Can u help ?
Do they switch in a similar manner as in my video? If yes, then that's how HISMs behave. A big group changes its level at once
@@TechArtAid is there a way to manage the group size or is it completely random becuse in my case if i have 30 hisms than 20 or more changes lod simultaneously
Is this the way they work.
I have wondered myself. If you have time, try if it depends on LOD distances (Screen Size) setting in Static Mesh and let me know
@@TechArtAid
I have tried it already no success 😞
Anyway thanks for the help.
hi, thanks for video
you said that we can update the transform of a single instance, but then we will lose all the performance. But we lose all the performance if we update all the instances individually right? With a for loop for example? In case we want to update only a single one, we lose only a respective fraction of the performance, right?
+Constantinos Kyprianou I wasn't clear then. Sorry. Yes, exactly as you described :)
nice, thanks for confirmation. And your insanely quick response helps a lot! :) appreciated
hey i know this is 5 years ago, but i am wondering, i have a utility widget that i want to spawn in a bunch of tiles,
however when i close the program those tiles don't save. is their a way to keep them saved in data ?
Do it via Get Editor Actor Subsystem -> Spawn Actor From Object, iirc
Could you still individually vertex paint these instance meshes? I.e. it will cost an extra draw call on for example moss over rocks, but not a draw call per individually painted instanced rock.
+Tjalle We can't paint vertices of instances in editor. Color is an attribute of mesh's each vertex. The idea of instancing makes use of storing a single mesh and duplicating it for free
+Tjalle ... but please check this video ua-cam.com/video/J5LXIApQmzA/v-deo.html for texturing ideas that work with instancing :)
Tech Art Aid Thanks for the quick reply, I'll look at that then! in case I want more variation I'll just several separate instances meshes for my large scene then, it's still saving performance!
Rly wanted to check it out but couldn't make it to the end. I think some info is great but it gets too diluted: either one talks about instancing meshes, or about what the compile button does, if you get what I'm saying.
I see. I'm planning a text version of this tutorial, and to add new things I learned since. Do you suggest to wrap 'noob info' into some folding sections?
@@TechArtAid Generally I'd think of expanding the different subjects into other videos and/or articles where they part too much in context, e.g. "compiling will take a moment, if you want to know more about this process check out my video on programming logic and ue4 UI", I'm sure that with your extensive knowledge as shown by the video you wouldn't have any issues expanding like this. But of course, then there is style and time ie, what do you prefer? And, "have you got time for that"?
In any case, I think that a roll-out or similar solution as you stated, would indeed keep the hole project looking shorter (more concise) and organised, hence more comprehensive.
Do you know of any good ways of adding instances to the HISM generated by the foliage tool? I have a dataset with foliage mesh refs and location coordinates from an external program to generate my forests (the procedural foliage spawning tool in ue is not suitable for my needs) which i've imported into ue as a data table, using that information i can try to add instances however its causing a few strange bugs with the array of instances, the crash log reports errors with the array attempting to go into the negatives aswell as seen in the gif how when deleting the painted meshes the exact number of spawned meshes will remain and be uninteractable or engine crash, and its random which instances will stay while deleting
gif of my problem - gyazo.com/1f128f90ef4836cbf83e508f90f94a10
code that was used- blueprintue.com/blueprint/a8yi9q-k/
im pretty dumbfounded and dont really know where to go from here since there isnt too much information on instancing and how the foliage tool works compared to, my aim is to be able to import data and have it be editable with this tool afterwards, any help is appreciated
Should I make this instances in order to place trees on an open world game?
Either this or the Foliage Tool. It's built into Unreal, is based on the same method and (as the name suggests) has a plenty of options for scattering trees and bushes. The Foliage Tool can for example spawn colonies of smaller trees around the older ones.
@@TechArtAid OK so you actually recomend using that tool to place the trees and if I then adjust a couple of them manually that will not affect performance right? It will remain the same?
Give it a try and check the frame rate :) If you need a solution for grass or dense bushes on a landscape, check the Grass Tool. It's fully procedural, without manual control. It's much more complicated to use and error-prone, though, so try doing everything with Foliage first.
Супер урок!!!!
Hi, if I create instances of a static mesh will that include the materials attached too? I mean will it create separate materials or an instance of the main material. Thanks.
The entire group will use 1 common instance of the material (regardless if it's a dynamic instance or assigned from UI)
@@TechArtAid Nice. Im working on mobile so I know the issue with normal instances is that lod's do not work properly which is where Hierarchical Instances come in handy. Materials have have a similar lod with their textures (mipmaps). How are mipmaps affected with instances as mipmaps are pretty important for mobile? Will each material instance have its own mipmap? For example a far away object will have a lower resolution while a close object will have normal resolution. Will this all work properly?
Mipmaps are handled directly on the GPU, so no worries :) But decrease texture resolution (or in some cases increase mip bias) if textures slow the game down. Also if you're ready for a deep dive into understanding your game's performance, I recommend my Profiling series. I hadn't covered mobile, but it should be possible to profile (aka measure performance of) a remote session on a device. At least it is possible in Unity.
@@TechArtAid Thanks. Your profiling series looks very useful as mobile optimisation is like half the battle when making a mobile game lol
Hi, which GPU was used to do these tests? best regards.
NVidia GeForce GTX 760 (2 GB)
I'm abit confused, i switched out the default static mesh, to use my own but it appears invisible even though i have instanced static mesh enabled..
Check if the material has Use With Instanced Static Mehses enabled
LODs.....LODs......LODs......OMG, never new how much of a difference they can make. I swapped out your 7K TRI asteroid for a simple 1K TRI square box with no texture that you had in the common folder. Went from 120 FPS to 12 FPS. Opened the 1K TRI square box static mesh and created auto LODs and then ran your simulation again and it went back to 120 FPS.
Also the texture LODs made very little different on FPS.
This is what I suspected - still, I'm stunned by the difference it made :)
Aside from raw polygon count, there's also 'quad overdraw' - i.e. GPU wasting time on tiniest details, with triangles being so close to each other that they overlap from GPU's perspective (it can't render single pixels, GPUs render shaders by blocks)
I was too, your video helped me figure out why adding foliage to my landscape was killing the FPS. Created LODs for the static meshes used for the foliage tool and frame rated soured back to 120. Thank you!
Hi my friends. What is the difference between instantiated mesh hierarchy and instantiated mesh?
Hierarchical supports LOD, among other things. There is a slide in the video
hey would this work for open world game that uses a lot of trees and rocks?
Definitely! UE's Foliage Tool also uses instancing internally, so you can use that. You can also add Auto Grass for grass, small foliage, pebbles
@@TechArtAid Not to bright when it comes to this have a very hard learning curve do you happen to have any doc or tutorial that you can point me in the right direction? Thanks so much for the responds and keep up the great work
Sure!
docs.unrealengine.com/en-US/BuildingWorlds/Foliage/index.html
docs.unrealengine.com/en-US/BuildingWorlds/OpenWorldTools/Grass/QuickStart/index.html