Unity-Technologies / AutoLOD

Automatic LOD generation + scene optimization
https://blogs.unity3d.com/2018/01/12/unity-labs-autolod-experimenting-with-automatic-performance-improvements/
Other
1.81k stars 212 forks source link

Principle of work of HLOD #65

Closed JohnnyDrive1 closed 4 years ago

JohnnyDrive1 commented 4 years ago

Hi, again! I have question about principle of work of HLOD For the purpose of testing I placed 10k prefabs of soldier model (static, no skinning). image And then I tried to make HLOD. I waited for 2 hours! And in the end I have something like this image

I am thinking, my computer is still thinking and new soldiers will appear soon. But I watched the structure of HLOD.. and I did not found combined mesh. I thought that at HLOD object I will find some meshes which will be combined version of 10-20 soldiers. image What have I missed in the understanding of HLOD?

JohnnyDrive1 commented 4 years ago

image Oh! I am sorry. I double-clicked at "Mesh" field of "Mesh Filter" and found combined meshes! Cool!

But it is very strange, that when I am selecting object in Scene hierarchy, only one object is highlighted at the Scene image

amirebrahimi commented 4 years ago

For the purpose of testing I placed 10k prefabs of soldier model (static, no skinning). And then I tried to make HLOD. I waited for 2 hours!

Yikes! I wish you had started with a smaller test case. 2 hours is a long time to wait. It's possible that you've encountered a bug. I'm going to see if I can repro with a smaller case.

amirebrahimi commented 4 years ago

I've made a video here, which I think should help: https://youtu.be/EuBeZvzVwrw

I also fixed a few small issues when deleting objects: e1c9cc5

Update your code and try the latest and let me know if this fixes your issue.

JohnnyDrive1 commented 4 years ago

Hi, dear amirebrahimi! Thank you! I will watch this video soon and I will give you feedback!

JohnnyDrive1 commented 4 years ago

Hi, dear amirebrahimi! Finally I tested new version of AutoLOD! Great thanks for your help!

I started brand new project from scratch and imported AutoLOD according to guide (https://github.com/Unity-Technologies/AutoLOD/issues/63#issuecomment-577613531) - everything was OK! No setup bugs!

I watched your video - it is cool and I understood main idea! I repeated everything that you made with one exception - I generated 30x30 spheres, not 10x10. And I have strange results: My fps for an array of spheres without HLOD is higher than for array of spheres with HLOD (see attached screenshots below) For performance test I created 30x30 spheres with unique materials with your Grid Placemenet Utility.

Did I misunderstand something? I wanted to use HLOD for better performance of my scene.

ps. Sorry for delay with answer! But, man, I kept my word and check all of your improvements!:)

pps. During my work I encountered freeze of application after saving of scene like I described at thread (https://github.com/Unity-Technologies/AutoLOD/issues/64) I will give you more info there

JohnnyDrive1 commented 4 years ago

image No HLOD

JohnnyDrive1 commented 4 years ago

image With HLOD

Pay attention at FPS - it is higher, when no HLOD is used ps. This screens were made with run-time mode, not editor mode

amirebrahimi commented 4 years ago

Apologies for not commenting on this immediately, so you know I've seen it. Per usual, I only get to work on this project on my own time, so that only comes so often. I had to handle some updates to the default mesh simplifier, which took most of my time tonight, but I hope to take a look at this soon.

JohnnyDrive1 commented 4 years ago

Apologies for not commenting on this immediately, so you know I've seen it. Per usual, I only get to work on this project on my own time, so that only comes so often. I had to handle some updates to the default mesh simplifier, which took most of my time tonight, but I hope to take a look at this soon.

Thank you! Everything is OK about time. We all have a lot of work

amirebrahimi commented 4 years ago

Hi @AzatKhafizov - I've come back to this and tried to reproduce your issue. I created a 30x30 grid of sphere prefabs and here is what I see in play mode with HLOD disabled: image

with HLOD enabled: image

There's a minor difference in performance with HLOD enabled being better than disabled, but as you'll see the batch count is low compared to without. One thing that is peculiar in your setup is that you have a much higher batch count than what I have for both. I wonder if you have duplicates of objects.

I fixed your other issue (#64) and there is now package manager support, so if you are still interested in resolving this issue, then please try out the update. We could also set up a zoom some time if we can't manage to resolve this over github.

amirebrahimi commented 4 years ago

If you're no longer using AutoLOD or need to resolve this issue, then please close the issue.

JohnnyDrive1 commented 4 years ago

Dear amirebrahimi, thank you for your help! I will check it as soon as I get free time!

ralkan commented 2 years ago

@amirebrahimi @AzatKhafizov I'm not sure if your issue was resolved but I tried exactly the same setups. Once with a new URP project (disabling batching in project settings) and once with Built-in RP (also disabling batching).

On the URP version the batches increased with HLOD for some reason, but the built-in without HLOD I got around 3150 batches, and with HLOD enabled I got 12 batches which is AWESOME!

I'm going to investigate why the URP setup did get more batches and decreased FPS. With this I hope to have at least given a push in the right direction for you both.

Kind Regards

ralkan commented 2 years ago

In the URP project I noticed that the component LOD Groups and Mesh Renderer is not being disabled when HLOD is activated. I believe that's the reason that the batches count increases and also HLOD does not work as expected.

JohnnyDrive1 commented 2 years ago

@ralkan thank you for the info! ps. Two years ago I gave up with direct solving of this task after several tries and just used smaller amount of objects. It is good that you could solved the problem with built-in RP! Unfortunately, I can not test this in the nearest time and can not interactively help you with this theme, but thread is open for commenting - maybe someone will help

amirebrahimi commented 2 years ago

@ralkan - This project hasn't had active development for some time, so unfortunately URP is not supported.