New 2D graphics features - Unite Copenhagen

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] so this is going to be a session on the new 2d graphics features some of which you might have seen if you're at the keynote yesterday or watching the livestream or you've been poking around in our script to render pipeline github as I know a lot of people do and then compare everything that happens and changes and that's cool and a lot of talk I actually don't like PowerPoint that much so most of the talk is going to be in the editor just playing around with the tools and having fun is that okay some people like beer some people like no I prefer PowerPoint please make made pretty diagrams for me so my name is Andy I work at Unity Technologies and I'm based here in the Copenhagen office so it's a very long commute and I'm very jet-lagged for the five minute bus ride I had to get here I'm also on Twitter as everyone is it's just my name without a space and I usually just check cool stuff people making a rant about the weather in politics so yeah just the marketing stuff okay cool so I've got a bunch of different things that I want to talk about today there's quite a lot of material I'm quite a lot of things and I've got two projects I want to kind of dissected so I'll show you how things were set up but the main key things I'm going to cover are these so the first one is kind of the way that with the universal Rena pipeline which has kind of been rebranded from the lightweight render pipeline has a now a 2d renderer and that's kind of dedicated to making purely 2d games you can render some 3ds stuff in there but it's pretty much built so that we can make some very nice performance 2d features which fit sprite workflows the most the other part I want to talk about studi lights and that's probably one of the most fun things to show because there's a lot of amazing gizmos a lot amazing tooling and functionality with these and there's many different types so in the keynote things showed like two different types and there's probably like seven different types so I'm going to show you all of them and all the sliders because I really like playing with sliders so you'll see the lots of that different settings and also the 2d renderer is masking system so the 2d renderer has added this pretty amazing tool called this masking layer rendering which is kind of like the 2d equivalent of kind of I guess PBR asks so where's with PBR mask maps you'd have like baked AO specular and metallic and these values so with the with this 2d render they added a similar one so you can isolate lights to certain layers and say oh this is the foreign el mask and this is the kind of glow mask because the silhouette mask and I'll show you show you some of that it's a lot of fun another topic is 2d shader graph if you've used shader graph before or you're aware of shader based workflows with nodes like shader Forge or I mean every engine has a shade of thingy at this point I'm just going to go over specifically kind of like the sprite workflow with unity and it's actually not that very different to if you use shader graph before just a different way of outputting the shader that's then generated and the last thing is 2d shaders which got him pretty hot so this is going to be fun for me as well as you to see how this works it's going to go great so explaining sort of how the 2d shadowing system sort of works in conjunction with all these different tools so is that okay for everyone Susan tuck sorry I moved here and I'm still trying to learn Danish and it's limited to thank you so it's very fitting to English politeness right and so there's two two Studios I want to say a massive thank you to one is a studio called pixel rain I don't think they're here if they are we should probably chat at some point so they make this amazing game called Robbie Swift hand and the urban mysteries released on tons of platforms so they've lent us assets to be able to demonstrate this one of the projects I'm going to show you of this character that runs around and steals things this ways could Robbie and here's a swift hand and the other studio is back to the game and this is a studio we worked with in creating the lost crypt demo that was in the keynote and I'm gonna talk a bit about more and we were released at some point and things like this so and that's literally on my slide so I'm now going to go to the editor so this is a project put together to kind of demonstrate lots of different lights and lots of different settings and this is using the universal render pipelines 2d renderer so wanna play the game it's actually super basic you just run around and collect stuff there's nothing revolutionary about that but you basically have this character called Robbie who runs jumps around this environment his face is lit up when he stands next to this glowing Lantern when he stands in front of it he gets this like weird silhouette because it doesn't make sense to render the light in front of his face you have these like floating orbs you also have some swinging things with like some nice light like cookies or I'll show you how that well that works here we have like a nice lens a nice sari a nice light shaft coming down which is sort of influence in the noir map so these like spikes I'll show you how that stuff is set up what else do you have oh we had this a tile map wall with this like kind of weird like blue going a mission area that's using the masking system and I'll show you this as well you basically collect these orbs it's super basic let's collect all the orbs and see what happens and everyone's just everyone just come to talk to watch me play a game which is great so yeah and then you basically the level is just got all these different lights and different things littered so so one of the super cool things about this project is it's pretty much it's all 2d right so if I actually fly here none of that well other than some like layering of the layers to do some nice parallax it's pretty much all entirely 2d but you get a lots of these nice depths and different definitions so I'm going to go through a couple of these things very quickly right now and explain how this was done so we have this tool in unity called the package manager so now trying to connect to the internet which is a very brave thing to do on conference Wi-Fi and we have here lot all the different packages that you can install to bring features into your project and you don't have to get features this way you can all summer still embedded some you can just get from like github and stuff but with the universal render pipeline or the lightweight render pipeline you basically can just install this from here so you just click click the package and install it and then once you install it you not only get that that function add such a shader graph and all these different tools but also the 2d renderer so if I go to my graphic settings I'll get there quickly one thing you might notice in the top right-hand corner we have this thing called the 2d renderer so one thing that Universal REM pipeline lets you do is actually create your own custom renderer and inject them so if you want to have a renderer that let's say all shadows are now red why not you know you can create your own kind of custom renderer extension and kind of inject them into this process and the 2d renderer data is or the 2d renderer part of this is actually part of that whole workflow so once you plug that in you then get the 2d renderer settings once you get those you can then have all the lights and all these different 2d renderer tools so let's have a look at a couple of things in this in this scene so we have here a little hanging lamp and the hanging lamp has basically this point light range I'll just remove its cookies so you so I can show you bit clearly so you've got this hanging lamp here and the hanging lamp is using a thing called a 2d point lights but 2d point light and my opinion is kind of like a weird way of naming it because it's not just a point light you can use it as a spot light you can use as a fill light you can use it as a kind of a cookie light and all these different things and one thing that team really tried to do is make the lots of different options and lots of different things you can do with this light but also lots of different gizmos so you probably saw you can basically sort of change the range of this light so you could still have it behave as a as a point light moving around the environment but you can also do things like specify like the range so you could have it as like a kind of like a spotlight you can also do things such as fall-off so currently it's a very hard spotlight so if I if I click off of it right it's just very hard spot light and it's got very hard edges but you can also do things like feather because we're using 2d and everything is kind of being masked with the environment or in the camera render we can also do things such as fall-off so now we have like a nice smoother fall-off around the light and obviously this is a lot of this is possible because we're rendering this 2d light on to 2d sprites everything's flat and composited in that way 3d is obviously very different in how fall-off works so we have this we have this 2d light as well as being able to do these things we've got lots of different sliders on the side so another thing to do is actually the inner radius so notice how another gizmo sort of appears and you can basically do things like so you don't want it to be kind of a nice linear fall-off from the root of the light towards the end you can actually do things like you know like 80% fall-off so it's more of like a curve so you get like a lot of nice little sliders and nice little things to play around with to control how your your point light is affecting the environment we also get some things such as alpha blend overlap this is pretty cool so if you get like multiple lights so here we've got like a yellow point light so if I move this off here we have a yellow point light which is moving which is rendering this above gargoyle face so if I bring this up here you'll notice that the lights are kind of not meshing very well but if you enable this a little alpha blends on overlap notice that without it there's kind of a light priority the blue light is dominating this light and often when you're creating projects with lights you're often like overlapping lots of these lights or means different places but with alpha blends on overlap we basically the 2d renderer kind of takes these lights and kind of like merges them so you notice that as I bring it now it's actually combining these colors together so rather than it's lots of hard lights fighting each other we get this nice mix so we get this yellow light and the blue light working very very nicely together so what else should we talk about here we can do some things such as intensities so obviously you can brighten up the intensity and see how intense it is that's cool but the other thing is normalmap influence so one thing you can do well you've been able to do for a long time is generate normal maps and assign them to things and with the 2d renderer one thing that we've wanted to do is be able to give you the access to let's find a nice thing give you access to be able to assign so here we've got in the far right hand corner like a normal texture of the tar map wall and previously if you created normal maps using Photoshop or no matter or any other tool for for 2d sprites 3d lights has this super weird effect or it's kind of got this weird depth and the distance doesn't really make sense and the fall-off just doesn't sort of fit very nicely with the normal map influence so with 2d with the 2d renderer the shaders that come with the 2d renderer all have normal map influence and can be influenced by the 2d lights so here you'll notice that I've got this if I turn off normal mapping intensity notice it's just lighting it as if it's very flat it looks very flat there isn't really any depth to the sprites but in enabling your map influence it's then going to read from that normal map texture and you also get some control such as the distance of the normal map influence so you guys should get some nicer finer controls for the 2d lights in how they influence the normal Maps being applied to the sprites so you can either use no normal apps and just have a very nice hard hard light or you can have a you can have a light looks like this with no map influence you also get some other fun stuff to play with this one is volume opacity so this basically defines how filled this actually space the space is so with zero volume opacity it's basically just taking this point light data creating that mask and being applied to the the sprite shader with the volume opacity you can fill the space a lot more so you noticed that it's actually not only influencing noir maps and things like this but it's basically becoming a volumetric cone and this is a lot easier in 2d partly because we'd have to worry about things like camera position in 3d space or rendering direction and depth and these things basically we're basically creating this nice mask and just filling up the how thick it is so you could do some really nice stuff with to delights in terms of volume metrics so if I places like here place another lie here you know me just like red you could do some really nice effects obviously disco mode [Music] my parents like this one they're like what do you do for a job and I shouldn't disco mode and they're pretty happy that's not a joke there's actually real real conversations I have a Christmas so yeah you could basically take a lot of these lights and stack them on top of each other and it's gonna be very nice and how they all merge together and blend so everyone's now gonna make disco games and that's that's cool I think we need more disco games in in the world so yeah we've got this this light like this let me just go back because I want to show you something something else that's a lot of fun to play with we need a mega undo button I'll add that to the feedback dog so we have this point light and that's rendering like this another thing you can do is actually apply cookies and again this is nothing new people have been adding cookies the games for so many years probably decades at this point but we can now use sprites as cookies so if I take any sort of sprites and I think I've got this nice like black and white cross influencing the area I can then assign this so this light has this kind of like cross area and this cookies being applied here which means that now the light when it swings as it does in the in the go is this one as the demo the cookie light is then coming with it so that's cool you can now apply to these lights not just the shape of the point light and the coin range and things like this but also like a nice little mask so yeah that's that's a lot of fun you can also obviously do things so let's get the character's head you know okay it's upside down but whatever so we now have like a big 2d light using the sprites of the of the character and you can obviously I'm kind of going off script for that that's cool so we can out do graffiti in games and the on spot lights and stuff on notice how it's all very consistent so you can not only sculpt lights using these gizmos but scope lights and Photoshop or wherever bring it in and use it for that shape I'm sure pixel Reina watching right now and didn't expect or watching the video and didn't expect that I'd use their characters head as a light at some point in this demo so that's fun if you so so going back back onto the topic of lights when you install that Universal render pipeline package when you go to the light menu you have all your usual fun stuff directional light point light and these things but the 2d lights are all here so you've got global light point light parametric light sprite light and freeform lights so you've got all these different lights that you can use and stack and I've kind of covered mostly point light I'm going to cover a couple of other ones the other one that's probably key to talk about is a global lights and if you see in the inspector in the fire right hand side the global lights a lot simpler than that point lights it's kind of like the ambient lighting in your environment or similar to kind of a directional lights so everything in this project is actually using the global light so if I then increase intensity notice that we can actually control how sort of light and dark that sort of b-big fill light is and it is used often as a fill light or you know as a tint so someone shout out a color please don't say whites black or pink because those are all break my demo oh great so yeah disco mode right cool yeah is if it's not white black or purple or pink they usually say purple which is close to pink so thank you for making this monstrosity right here so you can do some very nice tinting and Viet very nice shading by using this global sort of fill lights through throughout the environment cool I'm going to undo that I'm sorry we can have a talk afterwards yeah so that's the global light it's pretty simple pretty straightforward you just fill your light throughout the entire scene the next one is probably my favorite light and I'll say that quite a few times they're all my favorite light I won't lie to you is a free-form light so a free-form lights a bit different to a point light a point light is specifying a source of a light like a light bulb like the spotlight here and then the projection from that light from the center of that point now a free-form light it's different you actually sculpt a specify a range for that light to fill so in this demo we've got this big light light shaft I wanted to kind of simulate light shafts even though in the world there's actually no hole the wall video game hacks right so basically wanted to specify this big range that the light was was being cast in in this zone so we have here this freeform light and with the freeform light there's a lot of similar settings that you have at the point light but this time you can actually sculpt similar to how you do like sprite shape kind of the area that this that this freeform light takes so you can actually specify some kind of shape I'm not going to try sculpting Copenhagen but you can see here how easy it is you can actually just grab and add points and notice how it's actually just filling all the all the environment it's just such a nice pleasing tool to play with and specify you know there you go my level designers now like what the hell were you thinking when you created this make it more like a light shaft piece but now that we have this freeform light and you can kind of scope light in different ways you can control things like how much the fall-off is so for one in a very tight freeform light look we literally just sculpted like like this I'm no artist but this is my art right so in game jams people look at my monstrosity and think what the heck are you thinking and but we can specify like a nice fall off from this outside area and also control things like how smooth that fall-off is if it does the blending stuff the intensity the normal map influence as well you basically get a lot of the similar controls that you had before with the point light but also with the freeform light we're just specifying a nice big area and again these also like stack so if I make this like you know really demonic in a free-form light and then sort of make another one down here it's a lot of fun to be able to just play around with how this light fills this space let's make I'm not gonna crowds actually no purple guys really sad you can have your purple light back so you can notice how you can sort of sculpt and overlap the lights and they all add civilly blend nicely together so again people are going to make nice disco videogames with using this stuff that's a lot of fun so yeah we've got a nice big light shaft that looks like that so that's a free-form light that's great so I through a couple so far I've been through global light I've been through point light I've been through free from light and the next one I want to talk about is sprite lights so a sprite light is actually used for this kind of glowing area around here so if I now select the sprite light I'll show you what it's actually doing this is basically a sprite light it's taking a sprite shape and it's different to a cookie so what the cookie is doing is the cookie is taking the the range of the point light and then it's kind of LEM masking kind of where the light shouldn't be what sprite light is doing is without this without this range without the sprite basically is then saying oh here is where the sprite light should be so it's kind of I guess similar to like like a projector projecting out onto a screen a shape or something so if I go to one of my you know so we now got this this little head here and then now got this nice big blown up head we then get all the similar controls you know the intensity whether it influences normal maps and things that there's the volume opacity so you can actually sculpt a lot of lights using sprites and then assign them so it kind of goes nicely with the cookie where it's kind of removing light and this is then adding light in that particular shape so you can kind of use a lot of these pretty cool things together and this project has all sorts of different things like the floors using normal maps so it's getting this free-form lights there's lots of different parts and this projects not available yet I need to tidy up and then I'm gonna release it and write information I kind of don't believe in releasing a project that's messy so I want to tidy it up and then release it and then people will be able to see how these things were done with this this project so moving on to more stuff next one it is a shadow graph so one thing you'll notice here is the background of this tile map wall because this was painted using the tar map system as this weird blue glowing kind of like weird neon sort of effect at what you might notice in some parts is it's not affecting all parts of this tar map wall it's only affecting just the little group it's not taking you know or all the individual parts it's only these kind of grooves that are basically having this blue glowing influence and this is done using shader graph but also using that mask map system so if I now select this tile map wall and have a look at the shader here on the far right side you'll notice that there's two texture properties one is for the normal maps and one is the thing called a mask texture which I'll get onto in a second another one is a bunch of different fun tools and properties that I've exposed because when how to take screenshots the marketing web people like oh we want it more like faster we want it more glowy and you know like asking me for lots of changes so I said hey I'll just expose a bunch of values and you can take the screenshots and then I can go do some do some other things but um so basically you know obviously use it using this expose properties we could control various things like the glow influence you know how bright these are because all of this is using blooms well okay that's a little too much you know the size of the cells so we can make it sort of a bit more glitchy which is kind of fun you know scrolling fast shuffle speed we get lots of fun controls that we can expose so if I now open this shader lets have a look at to see how it was put together so here we're basically constructed the whole shader using this tool called shader graph and I won't spend too much time on exactly how shader graph works in the node creation process because we've got like loads of examples and videos and stuff already online I want to just vote so if you're watching the video pause right now watch those and then resume of at this exact points obviously people in the crowd don't have the luxury of doing this right now but I want to just cover like this sort of sprite part so this is quite a simple shader sore put together so one is how it Scrolls using time so it's taking the UV of the tar map wall and it's scrolling it in in a direction then here there is basically a element of Vernie noise which is taking that scroll and then it's then basically been tinted blue it doesn't have to be blue it could be red it could be green it could be in any of these colors but blues are nice neon glow I think and then if we then move up here and move over to this end masternode this is basically the output of the shader graph so all the shaders and shader graph and most shader based in interfaces generally flow all their data from from left to right and right the far right being the output of that end shader this is what at this this one here is what actually then generates that output shader that is then used so we've a look at it it's actually called sprite lit master we've added two new master nodes if you've you shared a graph before there wasn't a sprite lip master but now we've added sprite limb us and spray unlit master as well so if I go to the go to the the notation menu and go to master here I have Universal render pipeline installed so we've got PBR which is for like 3d physically based rendering shaders unlit for unlit stuff and visual effects which I've never used so I can't really talk about that I don't know what it does but we've now got these two sprites lit and sprite unlit and these are kind of self-explanatory sprite unlit switch so far creates will basically output your end result of your shader into a vertex position that it's normal that it's tangent and also a color so if you just if you don't care about 2d lights and this whole time you've been asleep and you're like whatever lighting is overrated I'm gonna do lots of unlit stuff cuphead did pretty well you know very well you know then there but you get to this part then you think cool I can now output just the end color values so we've then got that color value for those people but if you really insert the 2d light stuff and you want to make some nice to delete games we still have the same vertex position vertex and one vertex tangent outputs but we also have color that's kind of like the the base sprite value mask which I'll talk about in a bit and normal map so you can then output slightly more data to be hooked into the 2d lighting system normal Maps kind of self-explanatory it's a normal map and you output a normal map to be influenced by the 2d lights color is a little bit more interesting so here is being applied to the time app wall and you'll notice that it's taking all the different tiles from that tile map sheet that's been painted onto the wall and if I look in this little blackboard at the top here we've got here this reference called underscore main text and this is the reference that the shader graph is listening out for and if you call your references underscore main text it's then gonna grab the sprite renderer x' sprite or the tar maps renderer and then that way you can basically reference anything being animated and set in that in that value so for example this time Atwater's a bunch of tiles painted onto it and then rather than me having to say oh these are all the tiles and assign them basically using underscore main texts it instantly grabs that data that's being rendered to the time at render of sprite renderer and being applied directly into the shadow graph so we're getting that date automatically which means that this background glow effect I can apply to any tarmac renderer and any sprite renderer and it's going to have basically the same result without having me to specify some more settings so it kind of grabs that data that data is kind of separate from shader graph and it pulls it from that component which is pretty cool you can make reusable shaders and stuff and I'll show you some examples in a little bit now let's talk about mask stuff so the mask color the mask output has a value of 4 so RGB a and with the 2d system you basically get control over the global control over these mask outputs and what it's going to be ideal in handling this whole process is to kind of define on which channel which of these channels controls different things so in PBR you have like one channel for metallic one channel for smoothness one channel for Fram in occlusion and one child for emission and stuff like this and in the 2d renderer you could be more flexible you can say oh the red channel is for silhouette and in the green channel is for a mission and the blue channel is for an L and stuff like this so if I now select the 2d renderer which you see in the top right hand corner all the way at the top I'm happy I've got a really big screen because it's really embarrassing when it's small and have to point to a tiny thing on the screen we've got these different light blend styles so we got default which is basically just rendering all the sprites as is that's just normal and then it's rendering with a multiply blend mode and things like this and then I have two extra like blend styles so here we've got silhouette layer for when the character walks in front of the lights and that's on the red Channel so anything with the red channel we use the data from this silhouette layer the green channel is using an emission glow layer so it's everything it outputs through this green channel in shader graph or the green channel in the mask map is going to use this emission glow so if we have a look here let's go to this mask map well you'll notice that we have this little mask map texture that looks like this let's have a look at it it's so one thing you'll notice here is we have this mask map texture which I painted I just said wasn't an artist so but it's pretty simple to color inside the lines and what it's doing is it's basically kind of creating a pre-baked mask or created a pre-baked mask and this is what that glow layer is then going to use so you can like PPR workflows you can color in red channel here is Fornell green channel here is for emission blue channel here is for whatever you want you can be very flexible and dynamic sorry there's a lot of talking in the keynote rehearsals so basically with that mask map you can define the area that that light is is influencing so if I come back to here have a look at this glow map it's using that mask Channel and kind of taking it and then isolating it to a particular light layer so if I now go to the this this light so this is a global light called a glow layer and light notice that it has a different blend style so rather than default so rather than its default affecting everything it's actually saying hey go to the green Channel of everything using that mask output through shader graph or through shadow graph and then affect it so that means that I can then set up lights to influence specific layers and I'll show you the law script demo in a second it uses this heavily so here I've got this light there's only effect that I can change I can tweak so someone shout out a color not purple thank you thank you for a normal suggestion that's great so we have here now this global light affecting this mask map here and of course you could do things like make extra lights so if I take a point light so you've got a point light like so let's put a point light here we can tell it which layer to render onto that's one thing I actually forgot about so the 2d light system is actually engrained heavily into sorting layers so you made a 2d game and you often have soiling layers of like background layer foreground layer detail layer whatever the 2d lighting system actually allows you to render specific lights to specific layers so if you have a background you could say this background is affected by this global light and some point lights for stars or whatever or the moon or the Sun then you have the the player light and you have like oh have a spotlight just on the player not the background you can actually isolate lights per layers which is super cool so if I say that this point light affects all layers let's move to somewhere where I can't actually see anything so it notice it's actually affecting all layers let's increase the intensity so you are this nice little point light that's actually moving around in the scene but I don't want it to render to all layers I wanted to just render to that green Channel and influence this I can then change it to green channel where you'll now notice is it is not doing it this oh it is kind of doing Ashley so notice that it's now like a much brighter spot around here when it's being influenced by that shader graph so you can actually do things like mix shader graph with the global light with mask layer and you can kind of stack a lot of these things down into place so I actually pre-prepared one here just in case that didn't work but it works so that's cool so we've got here this little this little totem and this little totem or this pedestal is actually pretty simple it's got a normal map and you can notice the normal hat fall off from here it has a mask maskull textures set up and notice that as I bring the light forward it's actually isolating this nice big glowing light so you could do some really cool effects like mask out certain areas that are affected by certain lights so you can like have some super nice glowing if I influence this notice it's got a very nice sort of like glowing part for certain parts of this totem so if I now actually select this pedestal I have a look at its textures so we've got as we got its default texture that looks like this good it's a normal map texture and then we have its mask texture which notice in the green channel which is the one using that emission map sorry it's really small it's using that for the emission mask so I know it's like a lot to wrap your head around and things but once you start playing around with these mask maps and start isolating colors to certain channels you can do some really really cool powerful things one thing I wasn't actually going to talk about but I'll talk about it now is these little glowing particles in the air oh notice actually this red lights now influencing the the mass Channel here these little particles in the air are using shader graph oh and Robbie as well that's so she kind of cool I didn't know you do that so you must have a mass Channel yeah you could do like I didn't realize this we should just we should just have fun and just mess around with lights this is a super cool do some cool scanning stuff yeah so these these little particles in the air also using shader graph so these they're using shader graph as well so notice as I'm bringing this red light around here it's actually glowing all these like little dust particles so you can combine particles with lights with shader graph and do some really nice combined effects else does this light of influence this is actually curious I didn't know you do this I did pre plan some stuff but this is I'm going way off track now yeah you could say oh the Unity logo I haven't cleared this to branding but it should be okay UT logos like more red in this effects and now it's scrolling green but then it's red in this hottest spot area here so you can really layer up different things and have some really nice influences and effects so this is this project I mean a butchered it a little bit and I'm the art directors can be really really annoyed at me for such a horrible clashing of colors so this this there's this project I need to tidy this up and then like release it so then people can play around with it and stuff so I want to now jump to another project this is very brief so I jump to another project which is the one who's in the keynote yesterday oh sorry okay cool so I'm going to jump to that project now would you we actually have out on the booth if you want to go play around with it and see how stuff's made and show you a couple of really cool things that are in this demo because this demo has a lot more to it and I should have pre-loaded this what is pre loading it let's have some more fun with this light so yeah we got this pretty cool point light here we could specify sort of a nice range yeah you can do some really nice cool effects I'm sure some of you are already like yeah I'm gonna make a predator scanner and you know all this type of stuff yeah actually I'll show you a really fun thing so this character called Robbie say notice he's being influenced but all these lights and stuff so he actually has this he has this little silhouette let me let me just behead him can't pet him okay okay let's go into play mode he's going to play mode that would be wonderful no okay oh the red lights still down there okay so notice that he actually walks in front of the silhouette originally this light rendered in front of his face which doesn't make any sense right the lights but if the lights behind me it shouldn't like here right it should be you know silhouetted so notice he's got that it's very faint a little silhouette and it's not she'd done if I should go to this that go to this this funny character it's actually done by creating a little silhouette texture so notice how there's like a very fine it's kind of trick you see a little fine black line around the outside edge in the red channel and the light here the little silhouette point light here which let me just select it properly that would be great so got this little range inside here and this is on the red layer so what this is doing is it's going to the red channel of all masks and saying okay now use the data set in a 2d renderer data for here if I go here what you'll notice is that the silhouette layer and I close the other one so you can see solutely is affecting the red channel but it's subtractive it's actually removing the light or removing the value before so rather than being additive and making things glow it's actually removing it so when he walks in front of it is actually removing that front light so rather than turning on and off the light is actually just removing it and subtracting it so you can do some nice subtracting people can make all sorts of weird games which is cool weird games a weird games are more fun but it was like a weird trick every time people were testing this in the office and he was running from the light they were like that just looks wrong and broke the whole demo so then I had to kind of work out the subtractive stuff so you having characters running in front of lights this is kind of one way to do it so let's have a look at this project so this is the law script array which is saw in the keynote it's a simple platformer you run one way pick up a thing and you run left it's but there's lots of really nice beautiful things that are in play in this demo and one of them is 2d sha so what you see here in this filled area is this is actually a big kind of sprite light or free-foam lights which is coming down from this pot so this this demo is pretty cool because it's actually littered with all these little 2d lights so if I actually thicken this up a bit and select one of these I can select stuff eventually okay let's let's ignore that for the time being so if I go if I go to the if I go to the character I'm a hole editor lay out some messed up that's great very embarrassing I'm sorry so if we go to the character the character actually occludes the shadow so if I take her along here so one thing you'll notice that as she walks here there's a very faint little shadow there's a reason why it's faint because we only support hard shadows currently instead of soft shadows but basically the character herself has a composite shadow caster so this is a little component you can add and what it will do is they'll actually take various shapes on the character and sort of sculpt a shadow shadow mask or like a shadow a shadow shadow basically yeah a shadow caster it creates a shape that the shadow system then kind of ignores and things like this so if I now select the the lights of which we have oh my gosh we assume Oni which one was it okay it's one of these don't worry I'll get there eventually it's the last one I've got so if I go to this very last light well you'll notice is that there's some extra shadow setting serious shadow intensity in shadow volume so right now like increase the shadow intensity and increase the shadow volume it obviously doesn't do anything right okay let's increase this so one thing you'll notice now is that because that shadow cast the components there and the light direction the light position is up here she's actually casting this light a bit more and sort of creating this shadow so for now like rotate her I know this is very weird but it's now like as her body moves around it's then not casting light from that point so the shadow casting system is very powerful in that you kind of add these little shadow caster components whether it's the composite or the other shadow caster component which is a finer details it then occludes that shadow light that includes that light from that direction so you can do some nice stuff with 2d shadows 2d light shader graph and all these different parts here there's no there's lots of really cool stuff to play around here so so we got this serve this water which is actually reflecting a lot of the environment if I now select this if I actually grab this this lights and basically do what a come on I have used Union C maybe once okay whatever let's just grab it as I move this so move this light is actually kind of like suddenly reflecting in the water and this was achieved by basically having like a secondary camera render this environment and then in shader graph then like flipping it down so if we go to the water material let's open this up the water material basically feeds in that render texture from the camera as you can see here so if I open up this blackboard and go down a little bit to go to here yeah Mirror render textures this is rendered from that second camera capturing the screen and then it's passed in here and then using shader graph it doesn't look like much here but using shader graph you can then apply some logic or apply some data to this so it's rendering that kind of section of the screen and then we're then applying you know the ripples we're applying the the cow sticks we're applying a whole bunch of different things that are then being applied to this this water area here and they're about to about to evict me but I want to show one more thing if that's okay thank you sorry so these are trees these will move rachet de Graaff so actually as a shader graph sine wave moving backwards and forwards and these tree but these tree bushes actually have a mask channel so if I find this mass channel so they look like this if I open up their shader graph they have a mask channel to define Afrin l around the outside edge which looks like this it doesn't look very pretty but what you can see here in the split is we have this little white edge around the outside edge we've got some sort of harsher colors in the top which means light is more influencing these sort parts here and look is output through the mask map so if I now take this I just created a point light here let's render it onto all layers so we've got this point light so notice that as I moved the point light round it's just influencing everything right it's not you know it's it's influencing everything it's just a hot spot light however if I then put this on to the direct light layer notice as I move it around it's not it's only it's not affecting the underlying but it's affecting the tops of the trees so you can actually do some really nice Fornell effects around the edges of different parts so we can have some really nice sort of fill lights and and isolate certain areas so notice the shadowy part there it's not being influenced by this light and this project we need to tidy up and then after we tidy up we're going to like release it and then write information tutorials and and all this stuff so people can sort of learn a lot more on how lots of different parts of this project we're put together so I'm one minute over which is great that was just a small like little run-through of all the lots of different things hopefully it was helpful maybe possibly maybe that [Applause] [Music] you
Info
Channel: Unity
Views: 42,060
Rating: undefined out of 5
Keywords: Unity3d, Unity, Unity Technologies, Games, Game Development, Game Dev, Game Engine, 2d, graphics
Id: 7OF-iBCHp0c
Channel Id: undefined
Length: 45min 40sec (2740 seconds)
Published: Mon Oct 14 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.