2D Lights with Sprites in Unity - Normal Maps

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
as you probably know if you just put your sprite into the scene and add some lights nothing happens to fix this create new material change its shader to sprites diffuse now change the material of your sprite let's go to the scene view and let me show you something in 3d view there is your sprite and there is your camera and your light needs to be in the middle to make lights position more visible i've added sprite renderer but it's not necessary for this project so you may skip this step good job you've just added lights to your 2d game but if you are looking for more advanced lighting you need normal maps you can generate them for free using the tool listed in the description of this video and drop your sprite into the tool window to open it in the top right corner you have two modes that are interesting for us first one is normal map and the second one is preview in preview you can see lights based on a generated normal map in normal map mode you can see how a computer uses different colors to create a 3d shape out of your flat 2d sprite and on your left are sliders for changing the map i recommend you to set the enhance as soft as it's possible and for the rest of the options just don't go too crazy with bumpiness and it will be okay usually i play with the sliders until i get clear outline of the sprite and one color in the middle then if it's needed i make the bump softer for pixel art you will need to scale the sprite up in the sprite properties and check pixelated in visualization tab if you don't want reflections on your sprite go to the specular tab in the bottom left corner and set threshold to its maximum value to export your map go to the export in the bottom right corner uncheck everything except normal and hit export your map will be in the same folder as your sprite alright let's go back to unity select your normal map change its texture type to normal map and hit apply now create a new material let's name it nm material and change its shader to legacy transparent bump diffuse you will have two slots for your sprite and for your normal map you will have to put your sprite or sprite sheet to the first one and its normal map to the second one now change the material of your object increase your light's intensity to see your sprites clearly and your 2d lights with normal maps are ready if you are working with more than one sprite make sure to change their order in layer so they don't mix in pixel art don't forget to set filter mode to point and compression to none unless you want a weird outline it's also worth to try out a create from grayscale option i really like this effect if you need even more advanced 2d lighting you will need a universal render pipeline and guess what a tutorial about this tool will be on my channel very very soon that's a good reason to subscribe to my awesome channel my [Music] friends
Info
Channel: Pawel Makes Games
Views: 2,751
Rating: undefined out of 5
Keywords: lighting, normal maps, 2d, unity, pawel makes games, lights, how to, tutorial, shadows, shaders, beginner, sprites, laigter, laigter tool, game dev
Id: 3u_I86tY8oM
Channel Id: undefined
Length: 5min 23sec (323 seconds)
Published: Fri Dec 04 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.