Realistic 2D Lights & Shadows in Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ต.ค. 2024

ความคิดเห็น • 74

  • @CatchMeAlone
    @CatchMeAlone ปีที่แล้ว +55

    For anyone having problem with 2D Light, you have to change the material on the Sprite Renderer to URP's Sprite-Lit-Default material, so that the sprite is affected by lighting.

    • @megazord5696
      @megazord5696 3 หลายเดือนก่อน +1

      Thank you!

  • @Xenalith
    @Xenalith 9 หลายเดือนก่อน +4

    from 9:00 to 10:00 was so touching & human 🥺
    The way your comments faded in and out of the sped-up process with that beautiful ass music was a joyride to experience, seriously, what a well made segment it caught me off guard lol

    • @Willy_Dev
      @Willy_Dev  8 หลายเดือนก่อน +1

      Thanks, I really appreciate that !

  • @jakewood1942
    @jakewood1942 ปีที่แล้ว +4

    How the heck do you only have 352 subscribers? This is so well made. Made it 353 :)

  • @Nirvana-yq2dm
    @Nirvana-yq2dm 7 หลายเดือนก่อน +2

    rly cool to see the changes through lightings! Thanks a lot for your tutorial

  • @eastpenguin
    @eastpenguin 8 หลายเดือนก่อน +3

    Great video it was the only video that I could find with this much detail❤I also liked and subscribed thanks for the information.

  • @shauas4224
    @shauas4224 2 หลายเดือนก่อน +1

    You are criminally underrated man. +1 sub

  • @dovacatmacferson8230
    @dovacatmacferson8230 ปีที่แล้ว +4

    Your video is awesome! Your explanations are concise and you really are giving us the right tools for creation
    Hope more people will watch this

    • @Willy_Dev
      @Willy_Dev  ปีที่แล้ว

      Thanks, that means a lot !

  • @LtStxpendous
    @LtStxpendous ปีที่แล้ว +3

    such a well made video thank you so much for answering my unasked questions

    • @Willy_Dev
      @Willy_Dev  ปีที่แล้ว

      Glad i could help !

  • @lafineequipe6655
    @lafineequipe6655 ปีที่แล้ว +2

    Your video is very nice, super nice to understand ! Thank a lot for that

  • @cozygamemaker
    @cozygamemaker 5 หลายเดือนก่อน

    This tutorial is sooo awesome! Thanks a lot

  • @gudvinzis4479
    @gudvinzis4479 3 หลายเดือนก่อน

    Thank you very much you said everything i needed!👍👍👍👍

  • @styxrakash4639
    @styxrakash4639 6 หลายเดือนก่อน

    Wow! Unity upped there game for 2D I don’t remember this being around years ago

  • @hauntedcrowdev
    @hauntedcrowdev 7 หลายเดือนก่อน

    Awesome tutorial! Thanks!

  • @ziggruna
    @ziggruna หลายเดือนก่อน

    Thank you very match

  • @WeirdGoat
    @WeirdGoat ปีที่แล้ว +3

    Great job! Could you go any deeper and take a look at the lights of octopath traveler, post processing + lights = pretty damn good.

    • @Willy_Dev
      @Willy_Dev  ปีที่แล้ว

      Thank you, I will defenitely do a video on post processing in the future !

    • @WeirdGoat
      @WeirdGoat ปีที่แล้ว

      @@Willy_Dev Looking forward to it!

  • @Hajnex
    @Hajnex 5 หลายเดือนก่อน

    Awesome explanation 👌 Thx man

  • @友贤
    @友贤 ปีที่แล้ว

    Clear and good tutorial! Keep going!

  • @klutz6557
    @klutz6557 ปีที่แล้ว

    Thanks a lot this was very informative , Subscribed👍👍

  • @BulentA-i1x
    @BulentA-i1x 8 วันที่ผ่านมา

    super bro

  • @MrOmenMusic
    @MrOmenMusic 11 หลายเดือนก่อน

    thank you for the useful tutorial! :D

  • @ourclarioncall
    @ourclarioncall 5 หลายเดือนก่อน

    Wow, love it
    Have you seen the game phantom fellows ? It’s got like really vibrant light , like neon . I wonder if they made it using what your showing

    • @Willy_Dev
      @Willy_Dev  5 หลายเดือนก่อน +1

      Hard to say what they made it with, but I like the look !

  • @elib1421
    @elib1421 ปีที่แล้ว +1

    cool stuff!

  • @danylo_master
    @danylo_master 6 หลายเดือนก่อน +1

    Thank you for this tutorial. But... What about shadows for animated 2D sprites with multiple corners and holes? )

    • @Willy_Dev
      @Willy_Dev  6 หลายเดือนก่อน +1

      That is a good question ! Since animated sprites are basically just multiple sprites, displayed in quick succession, i guess a sprite mask applied to every single frame could potentially achieve the desired effect. Don't take my word for it though, this is not something i've done before !

  • @MVMborzoi
    @MVMborzoi 7 หลายเดือนก่อน +2

    I used the old version of adding URP to my 2022.03.20 version of Unity Project. And it didn't work even though I could put various 2D Lights option, they literally didn't work.
    As I followed your instructions, everything worked well in New file.
    Here's my question, if I want to make my own game that has light system, should I have to make file through 2D URP? instead of 2D?

    • @Willy_Dev
      @Willy_Dev  6 หลายเดือนก่อน +1

      It is possible to make your own light system in regular 2D. 2D URP however will have all the premade lights i showed in this video. Hope it helps !

  • @Wellyngton-rm3bb
    @Wellyngton-rm3bb ปีที่แล้ว +1

    Great content!

  • @greciaosorio7108
    @greciaosorio7108 5 หลายเดือนก่อน +2

    If my game has already been created in a normal template is there any way to import the URP? 😕

    • @Willy_Dev
      @Willy_Dev  5 หลายเดือนก่อน

      Yes ! you can go in Window > Rendering > Render Pipeline Converter in your project and upgrade to URP from there

  • @TheIronHeadRat
    @TheIronHeadRat ปีที่แล้ว

    Thanks for sharing 👍

  • @oOBlackSun3912Oo
    @oOBlackSun3912Oo ปีที่แล้ว +2

    Could you also please create a Tutorial for shadows in a 2D top down game?

    • @Willy_Dev
      @Willy_Dev  ปีที่แล้ว +3

      It's basically the same thing no matter the point of view of your game! Your assets are gonna change, but you,re gonna want to put shadow casters on your walls just the same

    • @oOBlackSun3912Oo
      @oOBlackSun3912Oo ปีที่แล้ว +1

      @@Willy_Dev nice i'll try that, thanks :)

  • @moonwatchereclipse5291
    @moonwatchereclipse5291 ปีที่แล้ว

    Thank you so much!

  • @thebestcelep6358
    @thebestcelep6358 ปีที่แล้ว

    Thank you ❤

  • @alexanderscarborough9472
    @alexanderscarborough9472 2 หลายเดือนก่อน

    What was the second game you showed in the intro, with the animal character chopping the tree?!

    • @Willy_Dev
      @Willy_Dev  2 หลายเดือนก่อน

      It's called Cult of the lamb !

  • @MohamadNurjaman
    @MohamadNurjaman 10 หลายเดือนก่อน +1

    i didn use URP model when creating my project, when i can find the light menu ? cause in mine, the light menu is not working, also the memnus was different.

    • @Willy_Dev
      @Willy_Dev  10 หลายเดือนก่อน

      You will have to install it using the package manager

  • @TamTruong-kg7yt
    @TamTruong-kg7yt 9 หลายเดือนก่อน

    I have problem that golbal light is not working

  • @brianmiller266
    @brianmiller266 ปีที่แล้ว +1

    How do normal masks combine with sprites to get realistic lighting?

    • @Willy_Dev
      @Willy_Dev  ปีที่แล้ว

      A normal mask gives a depth map to a sprite, which is then calculated with lights to create shadows as if a sprite was 3D.

  • @kapcapkapcap6104
    @kapcapkapcap6104 8 หลายเดือนก่อน +2

    I don't have a Global Light 2D? How do you get one?

    • @Willy_Dev
      @Willy_Dev  8 หลายเดือนก่อน +1

      Make sure you created the project with the 2D URP preset, and not the regular 2d preset

    • @kapcapkapcap6104
      @kapcapkapcap6104 8 หลายเดือนก่อน +1

      @@Willy_Dev I created the project without the 2D URP preset, and already have a lot of progress in it

    • @Willy_Dev
      @Willy_Dev  8 หลายเดือนก่อน +1

      You can import the URP via the package manager I berlieve. A gogole search about upgrading your project to URP will point you in the right direction. It is something i have done in the past but i don't remember exactly how

    • @kapcapkapcap6104
      @kapcapkapcap6104 8 หลายเดือนก่อน

      Thank you!@@Willy_Dev

  • @lokosstratos7192
    @lokosstratos7192 ปีที่แล้ว +1

    Is there any options for this to work on built-in renderer?

    • @Willy_Dev
      @Willy_Dev  ปีที่แล้ว

      Unfortunately I don't think it is. If the goal is to implement this in an existing project made with the standard renderer, you can download the URP in the package manager to upgrade your project. I'd suggest to watch a video before you do that as there are a couple steps to follow to ensure your project still works the same !

    • @lokosstratos7192
      @lokosstratos7192 ปีที่แล้ว +1

      ​@@Willy_Dev Ty! i just noticed i had a tool from humble bundle that does all this in built-in renderer.

  • @mesaperr
    @mesaperr ปีที่แล้ว +1

    Is there an easy way for ShadowChaster2D

    • @Willy_Dev
      @Willy_Dev  ปีที่แล้ว

      There are probably easier ways. You could make a script that applies this to the edge of every GameObject of a certain type in your scene!

  • @nikolaitesla4267
    @nikolaitesla4267 ปีที่แล้ว

    Is there any way to cast a shadow from a global light and also have a shadow caused by that global light on a dynamic object (i.e. a character casting a shadow on the grass behind them as the sun is facing them, plus we can move the character so the shadow should move with them as well)??

    • @Willy_Dev
      @Willy_Dev  ปีที่แล้ว

      As far as I know, tehre's no way to do that with a global light since global lights are not directional. It just lights up every single pixel of a scene. Since it has no direction, no shadow will be cast. If you really want to achieve this effect, what you could probably do is have a directional light setup to illuminate you whole scene. That way you'll be able to cast shadows.
      This is the first thing that comes to my mind, there are probably more effecient ways to go about it !

  • @MVMborzoi
    @MVMborzoi 7 หลายเดือนก่อน

    이것만 알았어도...

  • @scoop9551
    @scoop9551 ปีที่แล้ว

    I already have a bunch of scripts for moving/falling platforms, player climbing, etc. but they were attached to squares and stuff I created just to test. Yesterday, I started messing with tilemap and stuff for level design, but I don't see a way of attaching my scripts to some of the tiles, is it possible to do so ?

    • @Willy_Dev
      @Willy_Dev  ปีที่แล้ว

      As far as i know it is not possible. You can however use a tilemap for most of your level design and then add your moving platforms on top of it as separate game ojects with your colliders and custom scripts !

  • @nielspalmans6237
    @nielspalmans6237 ปีที่แล้ว

    my project doesnt have a global light by default?

    • @Willy_Dev
      @Willy_Dev  ปีที่แล้ว

      Are you sure you created it using the Universal Render Pipeline? If you did, you can always just add the global light yourself !

    • @nielspalmans6237
      @nielspalmans6237 ปีที่แล้ว

      @@Willy_Dev ooh shoot no i did not 😅 Well i know where to look now thanks!

  • @exice2878
    @exice2878 ปีที่แล้ว +2

    this channel is way too small for the quallity in this videos

  • @BlenderDestruction
    @BlenderDestruction ปีที่แล้ว

    I dont have 2D lights help!

    • @Willy_Dev
      @Willy_Dev  ปีที่แล้ว

      Make sure you created the project using the URP template in Unity ! If you created it with the basic 2D template they won't show up.

  • @BunnyboyCarrot
    @BunnyboyCarrot 9 หลายเดือนก่อน

    Make sure you choose 2d light and not be a dumb dumb like me

  • @ZombieChicken-X
    @ZombieChicken-X หลายเดือนก่อน +1

    I have a cat character and I want it to have a shadow, using a shadow caster doesn't give me an accurate shadow it just blocks light. What approach should I take for something like this?

    • @Willy_Dev
      @Willy_Dev  หลายเดือนก่อน

      You can enable Debug mode on your sprite rendered and check the "receive shadows" box. You can out this great video for a quick recap : th-cam.com/video/flu2PNRUAso/w-d-xo.html

  • @Stupid_Utube
    @Stupid_Utube ปีที่แล้ว

    Great