50 Effects in 1 Shader! (Take your game from boring to AWESOME!)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome i'm your code monkey and here let's check out a really awesome asset the all-in-one sprite shader this is a very easy way to add tons of polish into your game to make it just that extra bit awesome this video is split in two parts first let's look at the official demos and see what the essence can do and how they work and then after that i won't do a step-by-step guide on how to start using it and actually add it to your games check out the entire asset review playlist where i highlight great assets to help you make your games awesome this video is sponsored by unity which is currently running the massive black friday sale on the unity assessor there's over 500 assets all heavily discounted everything from tools to models animations and tons of effects on top of that this sale also has lightning deals which start at 90 off and slowly go down in discount as more and more people buy the asset so that means that if you get it quickly you can get a massive discount i also made a video and a list covering some of the best highlights the sale is on until the 4th of december so check it out with a link in the description and this asset the all-in-one sprite shader is also discounted as part of the sale so if you like what you see in this video go ahead and pick it up before the discount ends and if you're watching this after the sale is over then you can instead use the coupon code monkey10 to get 10 off your order so the all-in-one sprite shader like the name implies this one is a combination of tons of sprite shader effects all in a single shader so you can very easily add them to any sprite to give it that extra bit of polish or you can also combine them to make some truly unique effects then of course you can animate all the properties and enable or disable the infects in runtime all these effects work on sprites and also on really any renderer so you can use it with particles use it with the tile map the sprite shade or for example in the ui so you can pause your ui with tons of these effects make it flash jump around add some gradients some glow and so on the acid has 150 reviews with a 5 star rating so if your game is in 2d then this asset is a no-brainer so here i've got my project and i imported the package now the main thing that you see is over here there's a file with the documentation it's a really detailed pdf file lots of instructions and details all very in-depth and when you install the package the demo scenes work regardless of your render pipeline the shader is made to work with any pipeline so it automatically identifies which one you're using and everything works flawlessly so if you're using the built-in urp or agrp then it works instantly now urp does have a 2d specific renderer which uses 2d lights so there's also over here a package this one includes a second demo scene made with those urp lights so just double click on it and import the whole thing then of course make sure you're using urp so go into edit project settings and over here in graphics there's an included urp asset so make sure you use that one and then the folder go inside urp and then open up the demo original urp now one thing according to the documentation the settings on this demo are supposedly meant to work with the gamma color space this is meant to be mobile friendly so i assume that's why if you don't know how to set the color space you go into edit then down into project settings then over here go into the player go down into the other settings and over here you've got the color space so if you're working on mobile usually you'd use gamma because it's more performant but on desktop usually you'd go with linear since it tends to look a bit better either way this asset works with both you just need different settings with regards to the light intensity so for example over here i'm using linear and the glow effect isn't really glowing so by default if you expand the camera inside you've got the urp volume so here it's got the post crossing so it's got bloom and here the threshold is set really high in the intensity real low but if you set both of these to one then you have now it closed properly so keep in mind you can use any color space just make sure you set your values accordingly okay so this asset actually comes with two great demos let's first see this one this one is perfect for seeing all the various effects that you can use so this one is the base normal sprite and in this demo just use the controls to see all the various things so you've got a glow a fade an outline textured outline some more you've got an inner outline this one looks great some gradient a radial gradient for some reason this one isn't working with the demo but the effect does work then some color swap also really interesting hue shift changes one color color ramp and so on a nice hit effect a nice negative you can pixelate making grayscale and so on so as you can see tons and tons of bass effects so these are the various color effects and then if you use the keys to go down over here you see a bunch of uv effects so these modify quite a lot of things about the sprites for example this hand drawn effect looks really nice a nice little wind some wave round wave some offset over here really nice zoom some really cool distortion twisting and so on so you can see tons and tons of things that you can apply and the point is that you can combine both them so you can combine the color effects up here with uv effects on here so if you go down here you can see the effect combinations and you can see all of them so here's a really nice burn so you got an outline as well some fade you got a hologram you got a really interesting one an evil marine and so on so as you can see tons and tons of things you can mix and match all these effects and get pretty much anything you can imagine all right so this is the first demo as you can see tons and tons of possible use cases all of them are using the exact same shader and all these effects are usable with any sprite or even any ui element then here is the second demo this one is a really nice scene looks pretty natural like it's part of a real game and also this demo is meant to demonstrate how the effects work with td and lights so that one back there is being illuminated normal lights as i pass in the light with the camera as you can see everything looks great and it all works pretty perfectly alright so now that we've seen what the effect can do let's see how you can use it in your own game by the way if you find the video helpful please hit the like button it's a tiny thing but it really does help thanks like i said the asset comes with a great documentation so definitely check that out and there's also some super quick video tutorials it's really easy to set it up so let's see how to do it so over here i've got my game using my own custom sprites so i can move my camera i can shoot some bullets and i can hit those targets so this demo scene here is pretty much the same one that i used in the shoot projectiles video where i covered multiple methods of handling projectiles so just a really nice base scene and over here i've got a really nice star this one is meant to be a power up so as i go i approach and i touch and i pick it up now just like this this power up definitely doesn't look too special so let's use this really nice asset to add some effects so over here in my scene i've got my star and inside the sprite okay that's it just a spread render nothing else now the first thing you need is to add a component and add the all-in-one shader component and when you do it automatically modifies the sprite material to use the shader so it adds a component and if you expand upon this material yup now you see all the various effects that you can add so for example maybe let's make the sprite glow a little bit then maybe also add an outline you can make the outline use some distortion there you go really nice and maybe a nice hand-drawn effect this one looks really nice alright so there it is now it looks much more special and you can see just how easy it was at all these effects to make this power up feel completely different much more powerful now one quick note here if you have issues with some of these effects then it's likely because the sprite is too tight if you go up here and change from shaded into wireframe you can see the actual mesh shape now some of these effects like this outline they need a little bit extra space to render so if the mesh is way too tight then they might not look correct so for that just make sure you select your sprite and over here on the mesh type you can change from tight which will make it have this shape it tries to cut off all the alpha as much as possible but you can set it to phone rect so now the mesh is a quad which means it has a lot more space for distortion or outlines or any other effects same thing if you're working with a sprite atlas just make sure there's enough space for every effect now the way that this asset saves all of the effects data is in an interesting way when you add this script it automatically assigns a material that is dynamically generated so this way you don't need any extra assets on your project folder the data is instead saved along with the scene file so that's great no more files no more clutter but that also means that if the object isn't in a scene then this method does not work for example if i take off the star and i make it into a prefab and i open the prefab and nope there's no effects so all the effects are now gone so all that that is completely lost so for anything that exists outside of a scene like a prefab you need to make a proper material for it now thankfully there's an easy way to do just that it's over here on the all in one shader component you've got this button save material to folder now if you want to know what folder this is going to save to you can go up here into window and then the all in shader window and over here you see all the defaults and various other things so for example the material save path is over here on the materials folder and if you click on it you see it's inside all in one and you've got the materials so if you take on this and you just click on that and there you go it creates this one let's just rename this to the star so now this one is using that material and now i can safely turn this into a prefab and if i go inside the prefab yep it does work also one quick note here it's not glowing that's simply because in the prefab scene over here we don't have any post pressing but if we are over here in our scene and we just paste it there you go everything works perfectly so now i can spawn as many power-ups as i want and they all have the same material with the same effects now as i mentioned a while ago you can easily animate all of these effects so all these properties are emittable so let's see how to do that over here on the target i already have a nice animation for when the target is damaged so as i am and i shoot it you can see that nice little animation so let's add some more effects and animate it so once again we add the component first of all then down here and let's use a bunch of things one of the effects is a hit effect so this one is perfect for hitting and then slowly bringing it down so just open up the animation window and over here this one already has this animation so it just moves the sprite to the side and over here just need to hit on record and first of all when it hits let's put this one on one then go back there and bring it back down to zero and yep now if we play yup now we do see the effect all right so here i am as i shoot it yep there you go now i've got some real nice effects and all of them nicely animated alright awesome so that's one way to modify the effects through an animation another way is directly through code another quick note over here is my player character and i'm not actually using the sprite renderer my character uses a custom animation system which is a mesh render so if i just add the script as usual so i add the all in one script if i do that doesn't actually change the material so this one as you can see it's still using the spritelet default but in order to change it first over here on shader variant change it to default and when you do it automatically modifies the shader so now my material still exists in my project files and now it's using that shader and i can apply all the effects that i want so over here on this material i added just the glow effect now this is meant to be the special shader material so as the player picks up the power up it should enable these effects and when the power up expires they should get disabled so that's the goal let's see how we can modify these through code it's actually quite simple it's the same way as any other shader property so here is my player script just got some basic power-up logic so just a timer counts down then you got the power-up stopped and listens to a trigger enter when it hits with a star then we've got the player picked up star so it starts the power-up and then stops so over here let's modify those effects first thing we need is the actual material reference so i'm adding here as a serialized field and now in the editor just drag the reference okay and now here i just want to go into the material and i want to modify the glow so like i said as with any other shader you call material.setfloat if you're modifying a float then this one takes a name for the actual material property so for all of the property names there it's written directly in the shader so if you select the shading over here click on edit it opens up the actual shader file and over here you can see all the properties so for example for the glow you've got the underscore glow or alternatively they're also over here on documentation if you scroll all the way down yep here you've got all the properties so for example for glow you've got the underscore glow so this is the one that i want to modify so modify the underscore glow and when the power up starts let's put it maybe on 30 and when the power up ends let's put it back to zero okay so let's see so here i am my player does not have any glow and as soon as i go in yep there you go i get a glow and after three seconds if there you go no more glow all right awesome and of course you can apply some simple smoothing in order to make it less instant so right now it instantly goes and instantly goes away let's apply some smoothing so for that instead of setting it just once let's do up here on our update all right so just the same thing just using meth.lyric in order to smoothly interpolate it all right so here and as i pick it up there you go now it's nice and smooth and for going away yep nice and smooth so you see how by combining those with a proper tweening library you can see how easy it is to control so here i applied a whole bunch more effects and if i pick it up yep there you go nice and smooth look down looking really nice and yep then it goes away as you can see tons of effects really nice really nicely smooth all right awesome and like i mentioned this works on any renderer so here the bonelet has a trail renderer and it's using a material and i'm using this and apply a bunch of effects and yep there's the bonelet with a really nice glow so i can pick it up go into my super and then the super ends and then i pick it up again and everything looks really nicely awesome so nicely animated and then yep really good so if you compare the before and after you can see quite a drastic change and all it took was just a few minutes to set it up so you can see how by combining all these individual effects by animating them either through animations or through code by doing all of that you can really make an infinite amount of variation alright so that's the all-in-one sprite shader if you've got a 2d game then i would highly recommend you look into this asset adding all kinds of effects to your game will give it that extra bit of polish to make it truly stand out it is super easy to use and all of the effects work great so the fact that it has 150 five star reviews definitely checks out and don't forget to check out unity's black friday sale if you like this asset then this is the best time to get it and beyond that check out all the other assets on sale pretty much all of the best ones are currently discounted i hope you find this asset useful in your own projects check out the full asset review playlist for some more awesome assets let me know in the comments any suggestions for what other assets i should review thanks for watching and i'll see you next time [Music] you
Info
Channel: Code Monkey
Views: 38,748
Rating: undefined out of 5
Keywords: all in 1 shader, unity shader effects, unity effects 2d, unity effects, code monkey, unity asset store, asset review, shader multi pass, asset store, unity asset, unity tutorial, unity game tutorial, unity shader graph, unity shader, unity tutorial for beginners, unity 3d, unity, game design, game development, game dev, game development unity, unity 3d tutorial, programming, code, software development, learn to code, learn programming, unity tutorials, unity black friday
Id: fSDEcsVK2UY
Channel Id: undefined
Length: 14min 38sec (878 seconds)
Published: Sat Nov 27 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.