LOD Your Lights - Performance Optimization | Unity Tutorial

  Рет қаралды 5,874

LlamAcademy

LlamAcademy

Күн бұрын

Пікірлер: 41
@dreamisover9813
@dreamisover9813 Жыл бұрын
I really like the topics covered on this channel, something not everyone talks about and still very useful!
@LlamAcademy
@LlamAcademy Жыл бұрын
Happy to hear that ❤️
@arctiformgames
@arctiformgames Жыл бұрын
Wow, what a great idea! I had never even considered LODs for lights and will most definitely be utilizing this, thank you!
@LlamAcademy
@LlamAcademy Жыл бұрын
I hope you get a big performance uplift from implementing it!
@JasonWelch
@JasonWelch Жыл бұрын
I often don't really need to know the implementation details, but rather to simply answer my question "are other people doing this?", but I probably would have spent a ton of time manually tweaking every light property if I hadn't watched this. I wound up just using a timer within an update loop myself. The extra thing I added was a scriptable object for default settings so that you don't need to prefab a bunch of lights or manually copy the settings for each light.
@LlamAcademy
@LlamAcademy Жыл бұрын
Those are some great enhancements to make this more accessible and easy to use/scale! 💪
@shahar.mmoshin8694
@shahar.mmoshin8694 Жыл бұрын
Your one of the best KZbinrs for unity out there, keep up the good work.
@LlamAcademy
@LlamAcademy Жыл бұрын
🙏thank you! I appreciate that
@stylie473joker5
@stylie473joker5 Жыл бұрын
You never disappoint thx i never thought this was a thing
@MASATOSHIP_Official
@MASATOSHIP_Official Жыл бұрын
Oh...WOW! Awesome tutorial.
@AletseDev
@AletseDev Жыл бұрын
Super useful thank you ❤️
@qaz86310038
@qaz86310038 Жыл бұрын
Thanks for this tutorial, It will be very helpful 👍
@LlamAcademy
@LlamAcademy Жыл бұрын
You're welcome 😊
@LiamLucca
@LiamLucca Жыл бұрын
the ceo of optimization
@LlamAcademy
@LlamAcademy Жыл бұрын
😍 I like that
@isjesse1
@isjesse1 Жыл бұрын
you may have saved my game
@lando6583
@lando6583 2 ай бұрын
I always wondered what the best way to do non-Update based distance checking!
@snorQz
@snorQz Жыл бұрын
Amazing :DD THXXX
@connorpayne2671
@connorpayne2671 Жыл бұрын
You were talking about improving performance at 0:18 and my WiFi was being really slow. I thought you put lag in the video intentionally 😅😅
@LlamAcademy
@LlamAcademy Жыл бұрын
😁
@connorpayne2671
@connorpayne2671 Жыл бұрын
@@LlamAcademy I'm definitely going to try this when I work on optimization. I'm working on a game called Bible Dungeon and there are a lot of torches and fire pedestals in the game. So many that the torches cause the game to lag. I get 30 to 40 frames per seconds on my Ryzen 7 5700g, RX6650XT desktop and I7, RTX 3050Ti laptop. I disabled all the torches and fire pits and it shot up to 100 frames or more on my desktop
@gerarddiazvidal5121
@gerarddiazvidal5121 5 ай бұрын
shadowmasking the lights should avoid the shadow popping, would that have a noticeable impact on performance?
@sanatdeveloper
@sanatdeveloper Жыл бұрын
Can you please update Asset in asset store 🙏
@LlamAcademy
@LlamAcademy Жыл бұрын
Is there something wrong with the version on the asset store?
@Abdullah3864
@Abdullah3864 11 ай бұрын
hello i have 1 directional light how can i implement this to only 1 directional light
@LlamAcademy
@LlamAcademy 11 ай бұрын
For a directional light you are not moving meaningfully closer or farther away. I think you can get a similar effect via shadow cascades in the lighting settings
@galaxyacetype0
@galaxyacetype0 11 ай бұрын
Couldn’t seem to get this to work on 2021.3 using URP. No errors the shadows come on and off but the resolution stays the same.
@LlamAcademy
@LlamAcademy 10 ай бұрын
Hmm... I'm using 2021.2 or .3 on this one. If you check it out from GitHub does it work for you?
@domowomo8032
@domowomo8032 9 ай бұрын
@@LlamAcademy Hey I've got the same exact problem, in URP it seems you can't change the Light.shadowResolution but in SRP you can, do you know any workarounds?
@mediaexposed6256
@mediaexposed6256 Жыл бұрын
thnks
@DrakeKazmierczak
@DrakeKazmierczak 8 ай бұрын
Does this work with URP?
@LlamAcademy
@LlamAcademy 8 ай бұрын
Yes
@DrakeKazmierczak
@DrakeKazmierczak 7 ай бұрын
@@LlamAcademythis is fantastic, thank you for creating it! I was wondering if there's a way to automatically turn off the lights when the player moves farther away from them?
@mad616
@mad616 Жыл бұрын
Unreal has nanite and unity still bound to LoDs :/
@LlamAcademy
@LlamAcademy Жыл бұрын
🙂 unfortunately Nanite does not help this particular problem. I’m not sure if Unreal has this built in, but if you spawn 50 or more real-time lights in a smallish area you’ll likely see a similar problem to what this is helping solve (high real-time lighting compute cost)
@johnsojourn9114
@johnsojourn9114 21 күн бұрын
It works but there is no difference in performance.
@LlamAcademy
@LlamAcademy 21 күн бұрын
Well, depends on your scene. As I mentioned in the video, your mileage will vary. In this particular example we shaved off a significant chunk of rendering time. If you’ve got a handful of real-time lights and simple scene geometry, probably won’t see much improvement. If you’ve got dozens or hundreds of real-time lights, you’ll definitely see gains
@johnsojourn9114
@johnsojourn9114 21 күн бұрын
@@LlamAcademy Ah okay. I have a scene with thousands of blocks with rigidbodies and a small number of lights. So lot's of shadows all being calculated but not so many lights. I'm trying to optimize performance through shadows and lighting but hard or soft doesn't really seem to matter. I know this has been huge when dealing with mobile platforms but on PC with URP there seems to be very little difference between soft or hard or low or high quality, it kinda blows my mind because this doesn't fit with what I've learned over the years. But I guess the performance gains are not going to be found on this side using such a simple setup.
@johnsojourn9114
@johnsojourn9114 21 күн бұрын
@@LlamAcademy By the way: a cool idea for a tutorial in the same vein as this one is fading out lamps and turning them off based on proximity to the player. Like what is done in this video: kzbin.info/www/bejne/r2WpdIFvaZ1sl9k
@MuchCow9000
@MuchCow9000 Жыл бұрын
New Unity lighting sucks
@CrashChan666
@CrashChan666 Жыл бұрын
Hello ,I'm interested in if this will work with HDRP too. There are no Soft Hard options, I realized that when I attached the script. In HDRP, ShadowMapResolution handles the shadow resolution, right? But I'm not sure Volume handling whole shadow resolution. If it could handle using LODLight, I could manage lighting more easily. I used SetShadowResolution, but this doesnt work. public class LODAdjustment { public float MinSquareDistance; public float MaxSquareDistance; //public ShadowMapResolutions ShadowResolutions; public HDShadowFilteringQuality ShadowResolution; //public LightShadows LightShadows; //public HDAdditionalLightData LightShadows; public Color DebugColor; } private IEnumerator AdjustLODQuality() { //To Avoid Big Spikes float delay = UpdateDelay + UpdateDelay == 0 ? UpdateDelay : UnityEngine.Random.value / 20f; WaitForSeconds wait = new(delay); while (true) { if (LightLODCamera.Instance == null) { yield return wait; continue; } if (LightShouldBeOn) { float squareDistanceFromCamera = Vector3.SqrMagnitude( LightLODCamera.Instance.transform.position - transform.position); for (int i = 0; i < LODLevels.Count; i++) { if (i == LODLevels.Count - 1 || (squareDistanceFromCamera > LODLevels[i].MinSquareDistance && squareDistanceFromCamera
Top 5 Optimization Tips from Building a Mobile Game in Unity
15:54
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 42 МЛН
OPTIMIZE your Unity game using these performance tips | Tutorial
11:20
Sasquatch B Studios
Рет қаралды 22 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 749 М.
When Optimisations Work, But for the Wrong Reasons
22:19
SimonDev
Рет қаралды 1,1 МЛН
Unity Performance Optimization - DevLog #9 for My Game, MiLE HiGH TAXi
10:12
Unity Performance Tips: Draw Calls
4:24
Lofi Dev
Рет қаралды 199 М.
I never understood why you can't go faster than light - until now!
16:40
FloatHeadPhysics
Рет қаралды 4,6 МЛН