Hi everyone, thanks for your comments! 🩹 Fixes ► I made an editing mistake around 1:30. Please note, you need to place the outline material into the material field of the BlitMaterialFeature. It should not be empty after this step. Sorry about that! For 2020.2: ► When you create a shader graph, set the material setting to "Unlit" ► The gear menu on Custom Function nodes is now in the graph inspector ► Editing properties must be done in the graph inspector instead of the blackboard ✨ I've released a follow up video to this, adding normal edge detection and a bunch of other improvements. Check it out here: th-cam.com/video/fW-5srSHDMc/w-d-xo.html
@@theflamingturtle4084 Hi! Do you get any error? Does it not show up in the list? I would make sure that the file name and class name in the cs file match up.
Thanks Ned :) For people using URP 14+ this won't work, as BlitMaterialFeature.cs is using the old API. If you are new to URP and, like me, can't upgrade the file to make it work, I found an alternative solution: - discard the BlitMaterialFeature.cs file - at 01:22, click Select Renderer Feature and select "Full Screen Pass Renderer Feature" (Only available from URP 14) - In the renderer feature set the Material and, IMPORTANT, set requirements to "color" - Ultimately, apply two changes to the shader: 1) 06:58 instead of using a Sample Texture 2D with _MainTex for the blend, use a "URP Sample Buffer" node, and set the source to "Blit Source" (which simply passes the color of the pixels, like the main texture would) 2) In the Graph settings, change the material type from "Unlit" to "Fullscreen" - NOTE: you can skip the last step at 07:16 Also, I'm not sure if there's a difference in performance or if it's considered best practice or not...
Hey! For those who are using 2020.3, use a "screen position" node instead of a "UV" node for the input on the Custom Function! The reason is that unity is feeding a render of the UV output of the scene (don't ask me why), instead of what is expected, an UV that goes from (0, 0) to (1, 1) for the screen.
Oh that's interesting, I haven't encountered that before! I wonder if it still behaves strangely in builds? Either way, using screen position should be safe. Glad it's working!
Thanks so much for this video! Can't quite get it to work though, was hoping you could help. I've gone back over the video contents a dozen times to make sure I got everything right, made the "Fixes" in the description, scrolled through all the comments, still nothing. Basically the shader seems to have no effect EXCEPT when I set DepthTightening (is it tightening or thickness?) to a negative value, then the whole screen gets set to the outline color, with just a few object shadows showing through. I went through a few of the earlier videos in this series first and the desaturation shader works fine. Only thing I can find that isn't exactly like the video: My version of Unity (2021.3.2f1) in the debug options for the shader the single Keywords text field seems to have been replaced with two arrays, Valid Keywords and Invalid Keywords. They're behaving really wierd and buggy but I was able to add the REQUIRE_DEPTH_TEXTURE keyword to the Valid Keywords array (I've only gotten so far as depth not color) Here's the shader and hlsl script as I've put them together: drive.google.com/file/d/1nYbqcnY2WSnANoIZquMOtZ-GWBZq30RQ/view?usp=sharing drive.google.com/file/d/1VDkabtqxF1Rw9apCcPaKme3Xi7OrbJqE/view?usp=sharing This is like the last difficult thing to solve on my current project so I really hope you can help me out :) Thank you again for making these videos!
@@NedMakesGames I think that you could use both :) Sometimes one opens a random video and would like to know the previous and the following. And sometimes one already knows what he/she wants and then the playlist is better.
Thank you so much for these tutorials! I am completely new to shaders, and was expecting that everything would go over my head. But you explain it really well, looking forward for more content! :)
Thank you for watching! I'm really glad to hear that, since I'm often worried I race over stuff for the sake of brevity. I hope I hit a good middle ground.
I made the sobel function a bit more general so that I could feed it my own textures. But I was struggeling a while to get it working and I thought if the docs tell me UVs need to be normalized why are we using whole integers to offset it... So turns out I needed to use a screen node and use those values to normalize the offsets by dividing them. Maybe this will help someone who stumbled on to the same problem
If anyone has trouble with Unity 2021.3.20f1 I had to make my keywords in the graph set to exposed. Also, in the debug section the keywords are not separated by a space. There is now an array for them
Hi there! First of all i wanted to thank you for this amazing tutorial, I know its a bit late but I have a question! How can I exclude certain gameObjects so they dont have this render feature? I really want to use this method but i keep getting some weirds outlines on certain objects! Thanks again :)
Hi! It's not super simple to do with this exact implementation. You might have better luck with the outlines in these video: th-cam.com/video/1QPA3s0S3Oo/w-d-xo.html th-cam.com/video/74AS5DmLe8w/w-d-xo.html
Hi! Yes, it should work in 2021.3. Are you getting any errors? If you put a plain white material in your renderer feature, does your screen turn white? That would let you know that the renderer feature is running. From there you can start debugging the outlines graph.
You just made my day!! :) Btw, I had a bit of a bad start, so if anyone has trouble with the render pass not showing...just deleting my old camera and adding a fresh one to the scene made everything work for me!! :)
@@NedMakesGames Hey, I got stuck again and came back...now I realized, the effect does need the camera clipping planes to be kinda default to make it work!!
@@swannschilling474 Is it depth outlines? They are kind of picky. If you can, I would work through the follow up video here, th-cam.com/video/fW-5srSHDMc/w-d-xo.html . I add a lot of little tweaks that make outlines more stable. If you don't want depth normal outlines, I would at least try creating a scene depth node, set in raw mode. Multiply it with the threshold for depth outlines before feeding it into the fine tuning node. That will help things, I think.
I plan to use this feature to create a visual style heavily inspired by Jean "Moebius" Giraud's colorful comic art, and use that for a mecha crew simulator game me and my bff work on. Thank you for this great and deep tutorial!
Thanks for this! Custom render passes allow me to make the graphics look more unique and focused on the details I care about the most without changing all the shaders currently used for the premade models in the scenes... So, this was VEEERY helpful! Thanks again 🙏🏼
This sometimes happens to me if I accidentally write "float" instead of "float2" in one of the custom functions. I would double check that. You can also check the references in the video description, or take a screenshot and either email me or post on Discord. You can also post a link here, but TH-cam will hide it and not give me a notification, so I won't see it right away 😅
One question: how do I get this shader to work consistently between “scene” view and “game” view? I am getting good edges for both, but only if I have different material settings for each. Very little information exists out there when it comes to explaining when shaders are rendering for a scene editor view and when they are rendering through the scene’s main camera.
Thanks for the lovely tutorial! I got the depth edges working correctly, but the colour ones are constantly 'flowing outwards' as if there is some form of feedback. I have been fiddling with the params for ages in order to stabilize them but to no avail. I can't figure out if I did something wrong or if it's just the numbers as your colour outlines imemdiately look comparable to the depth ones.
Hi! Thank you! There could be a couple of reasons for this. Make sure that the scene color (or opaque) texture is enabled in your URP settings asset and camera. It could also be that your blit material feature is running before the color texture is ready. Move the render event in your renderer feature's settings later and see if that helps!
Did you ever figure this out? I'm seeing the same issue. I double checked my graph, copy and pasted all code, used the same material values as in the video, and made sure I enabled the depth and opaque textures + shader keywords, but after adding the opaque part of the graph, there's a trippy "flowing" effect that ends up creating a weird static pattern in the scene.
Hi! Yes something like this is definitely possible. You would have to make a lot of changes (no renderer features or shader graph, depth texture is sampled differently, etc.), but the sobel algorithm would be the same!
Cool video! URP 10 has a DepthNormals texture built in because they used it for their AO implementation, so no more custom feature needed. Although, it seems that unlit materials don't write to the texture, which is useless to me so I'll still be using my own pass.
Thank you! I did see that about URP 10, but I've been burned by using beta packages so I decided to hold off on it for now. It seems I made the right decision. Thanks for the heads up about unlit materials - that's really strange.
@@NedMakesGames My guess is that they were implementing AO, needed the scene normals for that but they don't want unlit objects to receive AO since that doesn't make sense, but their solution was just to make unlit objects not write to the texture? Idk, hope they change it
@@cleandust530 I’m not sure, I haven’t tested it. My understanding is that Unity has decided to implement deferred rendering so the URP supports everything the built-in renderer does.
Hey man All I have is a black screen when my thickness is zero or less and no outlines with anything above 0. I also did not have the Feature definition option for the DepthTexture Boolean
I've been fighting with this shader for a while now, and I have an issue I just can't seem to figure out a solution to. Specifically, this sobel implementation has a minimum outline thickness of two pixels, which is annoying when you're attempting to use it in pixel art applications. Is there a way to make the sobel filter not generate an outline when the depth texture at a given pixel is higher than its neighbors (Such that outlines only generate "behind" objects).
I'm using an overlay camera for my weapon which is added to my main camera's stack and for some reason it is rendering the lines through my weapon. Making it feel transparent. Any idea why this would be happening?
Came back to say I fixed it. I just had to find a different solution to the weapon camera. I now render the weapons layer on the main camera and have a render feature that prevents weapon clipping using the main camera.
Any to make it so that it doesn't place the outline on where the model gets shaded? Thanks! Okay, it's probably due to the low poly count, but please answer my question still. Thank you! P.S. Let me clarify: I don't want the outline separating colors of different brightness values if they have the same hue and saturation values. Let me know if that's possible!
Aye there, fantastic tutorial, really helpful for my present project. Had a question though, how can I get the shader to work for both my base camera and overlay camera? Its an FPS with the overlay camera rendering the held weapon while the base camera renders everything else.
Hi, thank you! That’s an interesting use case I haven’t really tried out. Do outlines not display on objects rendered from one of the cameras? Do both cameras use the renderer with the outlines feature? Theoretically this shouldn’t be a problem, but URP may handle depth textures differently for overlay cameras.
@@NedMakesGames Thanks for the quick response and apologies for the lack of info. The main camera is rendering fine, with the outlines and such, but the overlay camera, that views the view model (weapon) is rendered normally, with no outlines. I imagine I somehow need to put the overlay depth texture over the main one before the custom function in the shader graph, though I’m not sure how I’d go about doing that, or even if overlay cameras have a depth texture. I’d appreciate any assistance on the topic, Thanks. Edit: Both cameras do use the same forward renderer.
@@tylerdelange5959 Yeah, I think this problem could get complex. I have not worked much with overlay cameras, but my intuition says you should be able to run the outlines pass separately over each camera's depth texture. However, according to this: docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.2/manual/cameras-advanced.html overlay cameras receive the depth texture from their parent, which complicates things. What happens if you change the clear depth settings on your overlay camera? What happens if you detach the overlay camera and make it the main camera? Do you see outlines on your view models then?
@@NedMakesGames yeah I’ve been reading up on a bunch of documentation. Fiddling with the clear depth hasn’t resulted in any change. Setting the overlay camera to base makes it all bug a little bit, as URP can only have 1 base camera at a time. Setting the view model camera to base and the other one to overlay results in the outlines only showing up on the view model, not on the world. I’m not 100% what the best way to proceed is, I’ve looked through a ton of documentation already. If I could access the overlay cameras depth first, and additively combine it with the main one before running the function and such, I’d be set. I’ll put a solution here if I come up with one
@@tylerdelange5959 That would be really nice of you! Hopefully the solution’s not too complex. I’m curious now, so I may look into it a bit too, if I get a chance.
in the .HLSL file, shouldn't the sixth float2 of sobelSamplePoints[9] be (1,0) instead of (1,1)? As it stands the cell that should be the middle-right is sampling the top-right instead.
Hi, Do you know If I can somehow get shadow information into the shader graph as well? I want to add outlines to all the shadows as well, if you know of any resources please let me know. Also Thank you for making this tutorial it still works in the 2022.2 version with some changes:)
Hello, I am in Unity 2021.3 and I don't have any outline. :/ Also, I can't put any kewords on the materials but the DepthTexture checkbox shows up on the inspector. Thx in advance for help!
Hi! I haven't gotten to test this in 2021 heavily, but you may be able to get it to work by adding the keyword to your Shader Graph. Doesn't seem like you have to do the material debug inspector step any longer.
Hi! There may be something wrong with your graph. Make sure the "reference" of your main texture property is set to "_MainTex" . Also, feel free to upload a screenshot of your graph and I can take a look at it!
Hi Ned, wonderful tutorials! You explain things really well for code dummies like me. I have been getting an error with the BlitMaterialFeature script for this outline tutorial. I'm in Unity 2020.1.12 and whenever I input the Edge Detection Outlines Include script into the custom function node I'm getting the dreaded error exclamation mark and the node won't work. It's saying syntax error: unexpected token 'using" and then it lists the shader. I've checked typos and I swear I've done everything the same as your tutorial so I'm just really not sure. Any tips?
Hi, thank you, I'm glad it's helping you! Is the error with the BlitMaterialFeature or in your graph? Either way, there's a "using" keyword that the compiler doesn't understand 😅 If it's in EdgeDetectionOutlinesInclude, did you create the script as a C# file initially? Unity probably put some lines at the top that you can delete. If it's in BlitMaterialFeature, maybe you forgot a semicolon? You can check the files in the video description to see how the scripts should look!
@@NedMakesGames Hi Ned! I was feeling like the issue was in the BlitMaterialFeature, I finished the graph until the end of the video and I was pretty positive that I copied exactly. But I will double check and check out these things you've listed to make sure. Thank you I really appreciate the reply!
Hi ty for the video ! I can't understand why it's not working. I can see the outline but the other part of the screen is blank (color of the parameter in the node of the main texture) Any idea ? thank you !
@@NedMakesGames thank you for your quick answer! I don't know how to post my image so here is the link to download my shadergraph screen. we.tl/t-wCr91GeXFa Thanks a lot anyway! :)
Hey there! I am new to the renderer side of Unity, so I probably did something wrong in the setup - I can't even get the effect to show up in the frame debugger (which I believe it should?). I tried your blit feature as well as the cyanilux one you recommended somewhere. There are no errors, only in your renderpass, there is a warning about the RenderTargetHandle being obsolete. How would I go about debugging this further? The project is in Unity 2022.1
Hi! I have not tried this in Unity 2022, so I'm not sure if there are any major changes to renderer features. But, if your new pass does not show up in the frame debugger, that would suggest it's not running at all. I would start by setting your renderer feature to use a very simple material - create a shader graph to just output red for example. Then it will be very obvious if it's working or not. Then, I would try inserting Debug logs in various functions in the feature and pass classes to see which ones run and in what order. Hopefully, these steps will at least give you a better idea which parts of the system are running.
@@NedMakesGames Well, the good news is, I figured out a "solution". But I am so mad with how long it took :D In my Unity 2022.1, the project settings don't use any Universal Renderer Data asset other than the default one. Even if I switched them out (and it would show the new asset in the corresponding setting field!). I only noticed after a Library rebuild that the shown asset had reverted to the default asset. If I attach features to the default asset, the render passes do what they're supposed to. I tried reproducing the issue on a laptop but it appears to be specific to my PC. It's not Window's ransome ware protection. Not sure what else might interfere with writing to a settings file...
@@datnade2299 Now that is a strange one! Every once in a while, I do have problems with Unity's library becoming corrupted. It's always annoying to debug!
@@NedMakesGames ive beem searching for a way 2 make my 2d cartoon in 3d and make it look like 2d..and especially the outlines have been the biggest hurdle with your vids i might be ablte to get close to what i want..ty i will be watching and liking all ur vids in the near future
Hello, sir! I'm using a different version of Unity (2022.2) and was wondering if this could be used for unity's Fullscreen Material on Custom Passes? I can't seem to get it working for it.
Hi! I have not had time to try out that feature, but theoretically it should work. By that I mean the sobel algorithm will definitely give you outlines, but I'm not sure how to hook up depth and blend back to the screen using that method.
@@NedMakesGames Thank you for the response! I eventually figured out the problem through trial and error, and it didn't have anything to do with the Fullscreen Custom Pass, and, in fact, with unity's new features in 2022, it was easier than ever, as Shadergraph can now output the Scene Colors and Scene Depth using nodes instead of needing to render to a Render Texture first. Instead, it turned out to be a problem with the orthographic camera, which renders Depth Buffers differently from a Perspective Camera. I had to reduce the far clipping plane of my Orthographic camera to 500, and increase the sensitivity of my outline threshold much higher to compensate for that. Likewise, I discovered that to get pixel perfect outlines, (Ones that do not look blocky/have corners on a 1 pixel scale), you need to go into the Sobel Script and change the corner values of the number checking grid from 1 and -1 to 0's, as this will make the script ignore corner pixels in its calculations, making for a much crisper look. I hope this helps anyone who had the same issues that I did!
@@shadestylediabouros2757 I'm glad to hear it works so well in 2022! I hope I can check it out myself soon. Thank you for the detailed write up too, I'm sure it will help future viewers.
Hi, first thanks for this video really informative. However I think I have set it up wrong as if I say set this for one of my prefabs so say trees use this material I thought only those would be outlined but it seems it just renders the enter texture on the screen over what should be displayed. So say I pick a texture of a sword, set that on the blit material, run my project then instead of seeing all the trees for example in the view I just see the sword texture. Any ideas? Thanks
Hi! Thank you, I'm glad it helped you! Yes, this particular implementation draws outlines over the entire screen. The outline material should only go inside the renderer feature, your objects should just have materials with "normal" shaders. If you only want outlines on specific objects, try this tutorial: th-cam.com/video/74AS5DmLe8w/w-d-xo.html
@@NedMakesGames Thanks for the reply, actually I do want one that does an outline to everything but when I try adding it to the renderer I just get a white screen. The white screen is because of the Empty (white) Texture. If I drag a texture into it then I get that as the whole screen, nothing else is drawn just the entire texture. Is there something I need to do to tell it to use what is being rendered as the texture? Sorry if I'm being dumb but can't see how the screen image is being used as it just uses the texture in the shader. Thanks again, for any help or pointers!
@@dominiauk Oh sorry for the confusion! It's no problem. Do you mean the main texture in the outlines post process material? You can leave that blank and the system will fill it with the screen's texture. If you don't see any outlines, try changing some of the material settings or moving the camera around. Feel free to take a screenshot of your graph too and I can take a look at it!
@@NedMakesGames Hi Ned thanks for the help, I've got it now rooky mistake! I'd named the Texture _MainTex but not the Reference. So I guess it wasn't being picked up by Unity. Seems to be working fine now. Thanks again for the help, very much appreciated !
Hi! Only because I switched licenses after my first few tutorials. Since I wrote BlitMaterialFeature.cs for one of my first tutorials, it's under GPL. I should get around to formally changing that, but for now, I give you permission to use BlitMaterialFeature.cs under the guidlines of the MIT license.
Hey Ned. Great tutorial. Been trying to do an outline shader for single objects for a week now and keep stumbling over things. Could you use the sobel matrix for individual objects with their own shader?
Hi! That's possible. You could use hull outlines, which I detail in this video: th-cam.com/video/1QPA3s0S3Oo/w-d-xo.html. If you want to use edge detection outlines, it's still possible! You would need to modify the graph quite a bit so it runs on a mesh. I think you could still use the same custom function nodes, but you would need to get the screen space UV to feed into it. Then, blend the outlines with the mesh's albedo color. Could also delete the renderer feature at that point.
You could also give this a try. alexanderameye.github.io/jfaoutline.html it uses jump flood algorithm for outlines. It definitely has advantages but also disadvantages.
That is strange! What Unity version are you using? Is depth texture turned on in your URP settings asset? Also make sure the sample depth keyword is enabled on the blit material.
Hmm, do you mean edges with black on one side? I'm not sure how well it would work, but you could modify the sobel color function to check if any of the samples are black, and if so, set the sobel value to zero.
Hi! You would have to get the skybox not to render to the scene's opaque texture. You might be able to do this by changing the skybox's render queue value to "Transparent."
Hi! It seems like either the scene color node isn't working or isn't blending with your outlines. What displays if you route the scene color node directly into base color?
@@bananazzplit Oh I'm sorry, I mispoke. I meant the main texture sample. What happens if you route it directly into base color? I think something wrong might be happening with it.
@@NedMakesGames OH i found the problem ! xD I left the Main texture reference in _MainTexture and not _MainTex I didn't think the reference was so important. Thank you 😁
Hi! I wonder if your renderer feature is set up correctly? Try having your outlines shader graph just output red (route a color node into the base color field) and see if your game screen turns red. If not, then double check your renderer feature. Feel free to post a screenshot if you'd like and I'll take a look at it.
I fixed that problem, but it doesn't look quite right. I get these weird fuzzy visual effects, here is a screenshot. ibb.co/cDRJTZb. The area under the lines. Some of the lines themselves are a bit fuzzy. Thanks for your help.
@@NedMakesGames Though, I do have an issue - mainly that color attenuation isn't working. The actual outlines work fine, but not color. I tried copy-and-pasting your finished version of the HLSL into the text file, and that didn't fix anything.
@@trainsfemme Do you mean the shading on your mesh? That's actually a toon shader - separate from this outlines shader. I have a series on toon shaders here if you're interested: th-cam.com/play/PLAUha41PUKAasDP7TOMBRramS5mkQ0hIG.html
Hi, I work in Unity 2020.3.30 urp, and followed everything from beginning to end (with the changes in the comments). But the thickness doesn't seem to change no matter how much I change any settings. I checked debug mode and all multiple times, but don't see any difference in thickness. I'm not certain if have to make any changes for Unity 2020.3.30. Does anyone know what could be wrong? Would be a great help.
Hi Robin! It's easy to make little mistakes in you graph, so if you'd like, I can take a look at it. Feel free to take a screenshot and either email me or message me on Discord (you can find links in the video description). You can post here as well, though TH-cam tends to hide posts with links (so I won't get a notification).
Hello! Thank you for this amazing tutorial. I have noticed, significant framerate drop while running this shader on a mobile device with decent specs. (snapdragon 855 cpu and adreno 640 gpu), processing depth and color edge calculation for each frame must be taxing and presumably a game with multiple objects in a scene with lower specs device would perform much slower. I understand this wont be a problem for other platforms such as pc or console but could you please explain certain work arounds or optimization on this shader (for a mobile device.)
Hi, thanks for the kind words! One good thing is these outlines take the same amount of rendering power no matter how many objects are on the screen, since it runs as a post-processing effect. You could save some power in a couple of ways. If you don't use one, turn off either the depth or opaque textures. That will help a lot. Secondly, you can remove the non-diagonal kernel positions in the HLSL file. This will half the number of texture lookups. Quality will go down but that should help with performance.
i dont get it.... exactly how are you actually getting the unity depth texture? I understand you made a boolean, and i did that too but its not working i just get pure black color everywhere, please advise, thanks in advance.
@@stefanvidev1255 SHADERGRAPH_SAMPLE_SCENE_DEPTH should be defined for URP Shader Graphs. Do you have the depth texture enabled on your URP settings object? What version of Unity are you using? You could try routing a scene depth node into the output node just to see what that looks like.
Nice video, really informative. I'm currently stuck in 2021.2.10f1 with trying to apply it to the entire scene. The outlines are working fine, as they are present as a lighter color of the base color when placing the material on a object, but outlines aren't visible in screen view. I have no errors on the project so I'm imagining I'm missing something somewhere, the material is in the blit material for the render pipeline and post processing is checked on my main game camera. I'm writing this as I'm about to go to bed so sorry if this question isn't written well. Also thanks for answering a lot of these questions in the comments! it's helped troubleshooting a lot here. if you or anyone else could help me here I would greatly appreciate it!
Still have the problem of it applying through the renderer, but I found a work around with applying it to the object, I was able to get the outlines to appear when changing the material to a transparent mode then multiplying it. So now I have an object in front of the camera view always following around the player character to give the outlines, gonna have a friend look over it tomorrow and give some help to see if there's any other way of doing this as currently there's light changes that happen when moving the mouse that can be annoying.
@@armagedonthe1gamer Hi! Well I'm glad it's sort of working now! There seems to be issues with this outline system and stacked cameras, do you happen to use that system?
Hi, I'm using Unity 2022.2.21, I followed the tutorial, and the outlines are showing, but now there is no color except white and black outlines. Any idea on why this is happening? Great tutorial btw :D
Hi thank you! This is usually an issue with the final blend node, which blends outlines with the main screen texture. Try routing each input into the blend node into Base Color and see what it looks like. That should help you see what's going on.
Is there anyway i can combine this with the toon shader because I blended this with the sample 2d node and turns the mesh dark. The other method didn't work so I tried this . I am at the point where i am thinking my mesh is to complicated lol
It's a lot like the hull outlines. You put the outline material in the blit material feature, and it will draw on top of everything else. No need to blend the graphs together!
I'm using this in a game, and I've noticed that my reflection probs stopped working when using the Blit material in the Forward Renderer. The baked ones are fine, but the realtime ones are all black. Is there a fix or a way around this?
Hi! It's strange that a screen space blit messes up reflection probes! I'll have to look into this more, but you might try this blit renderer feature: github.com/Cyanilux/URP_BlitRenderFeature It fixes a few edge cases, and may work better for you. What version of Unity are you using?
Heya, awesome tutorial but I'm having an issue with the hlsl code. Visual Studio tells me "Function 'SHADERGRAPH_SAMPLE_SCENE_DEPTH(float2)' is not declared." , and I have everything written out the same way as the tutorial. I'm also pretty certain I've set up my Renderer the same way. Does anyone know a solution for this problem?
Hi! Visual Studio gives you that error? Does Unity as well? Visual Studio might just be confused because it doesn't know shader graph automatically includes some files, but the code will still work in Unity. To get rid of the error, you could try manually #including the URP ShaderGraphFunctions.hlsl file, which contains the definition for that macro. If it's a problem in Unity too, you might need to update your URP or shader graph package.
@@NedMakesGames I've made sure that ShaderGraph and the URP are using the latest versions, and the error only shows up in Visual Studio, not Unity. Using #include to add the ShaderGraphFunctions.hlsl file doesn't seem to work, and if I add the code from that file by copy-pasting the shadergraph_LWSampleSceneDepth function and associated #define, it compiles fine but then Shader Graph throws an error on the custom node telling me I've made a "redefinition of _Time". I can still get some weird results out of the shader so it's not entirely non-functional but nothing like what's in the video. Thankyou for your time!
@@shaunvandermey4305 That's really strange. Do you have the Visual Studio Editor package in the package manager? If Unity doesn't throw any errors, you could just ignore Visual Studio in this case. Unity does the compiling of your game code, so everything should work OK.
I am having the problem that everything works fine in the editor...also when I hit play, it all works! But when compiling the Game it does not show at all...any ideas?
@@NedMakesGames Hey, I watched you tutorial again and realized that I forgot to turn on Depth Texture in the URP settings...thanks for making these, they are a great help!! :) I am having another issue which is not related to you tutorial, but also to post processing...bloom also only works in the editor and not at runtime, could there be a related fix?
@@swannschilling474 Oh good! I'm glad they're helping! Are you using the bloom included with URP post processing? You could try making sure the opaque texture is enabled in the settings asset, as well as post processing on your camera.
@@NedMakesGames Yes, I am using the bloom inluded in the URP post processing...its the one that came within the URP template! I got post processing enable in my camera and opaque texture is enabled! I am pretty new to the scriptable render pipeline, maybe I messed something up along the way?
@@swannschilling474 Hmm I’m not sure why that’s happening. Are you building for Android by chance? I read some post processing doesn’t work on it: forum.unity.com/threads/bloom-doesnt-work-on-android-build-with-urp.950416/
I finished every step of the tutorial, sadly it's not working and nothing changed. There is an error in the .hlsl file and Rider tells me: Cannot resolve symbol 'SHADERGRAPH_SAMPLE_SCENE_DEPTH'. Could that be a problem - how can I make it work?
After doing the last step it works fine. Only problem left is that if I zoom out the Thickness of the outline stays the same and doesn't get smaller with the mesh. Is that fixable?
@@Nadeloehr1990 Hi, I'm glad everything works now! Usually that is a feature of these outlines - that they don't change with perspective! I hate to tell you to do this since you just got these working, but your best bet would be to use hull outlines. I have a video about them here: th-cam.com/video/1QPA3s0S3Oo/w-d-xo.html Alternatively, you could change your graph a bit to shrink thickness for far away objects. Add a scene depth node. Then multiply that with your thickness property before feeding it into your sobel custom function nodes. You could even use a smoothstep to set minimum and maximum depths, or a lerp node to set minimum and maximum thicknesses. I haven't tried this myself, so it might have a few weird artifacts, but it might be worth a try!
Hi Ned, I copied the process 1 to 1 on 2019.4.13f1 and my outline is messed up, is it possible for you to upload the shadergraph and ball texture as well to compare those?
@@fangoerbayun2587 Hi! Sorry, I don't have those available, at the moment. The ball texture is nothing special though, it's just vertical rainbow stripes. Can you take a screenshot of your scene and/or graph? I might be able to help out.
@@NedMakesGames Thanks for the reply! I found out that I was missing to set the material in the renderer features, the vid covers it briefly at 1:35 but the material is never set in. I actually thought that this is a material shader applied to each ball. So it's not that useful for my case because I don't want the outline applied to all objects.
Sidenote, do you know how I can make an outline for a 2d texture on a quad? Simple outline, only external, not internal by colors like yours. I followed this (th-cam.com/video/FvQFhkS90nI/w-d-xo.html&ab_channel=CodeMonkey) tutorial and it works great for a 2d sprite, but I also have a quad mesh that I put a 2d texture (with transparency). I switched the graph node from Sprite Lit Master to PBR Master, and it's broken and shows just a line.
@@fangoerbayun2587 Oops! Looks like I made an editing error there. Sorry about that! If you want outlines per object, you could check out my hull outlines: th-cam.com/video/1QPA3s0S3Oo/w-d-xo.html (Although looking at your sidenote, I don't think these would work, either) I'm planning a video to apply edge detection outlines from this video per object, too! Should be out in a few weeks. As for your sidenote, I haven't played around much with sprites in shader graph, so I can't give much insight. At first glance, I would check the UVs on your quad to make sure they're set up how that graph expects.
Hi! It didn't make it into this video, but the follow up ( th-cam.com/video/fW-5srSHDMc/w-d-xo.html ) has a lot of little tweaks which should help with outline stability at different zoom levels. Specifically, jump to 10:25
Hai, Love the tutorial videos! Have you ever tried creating a pixel perfect line in 3D? Something like the Line renderer, but pixel perfect. Drawing single pixel thick lines in the scene.
Hi, thanks! I have done something like that using a pixel perfect camera in a low res, pixel art game. It would be an interesting challenge to get working in other settings!
Subscribed!!! These tutorials are simply AMAZING! I have a road blocker though, in case someone could help me. I'm using Unity 2021.3.26f1 and when I get into Debug mode to change the Shader Keyword to REQUIRE_DEPTH_TEXTURE (7:43) I can't find that field :( Instead I see Valid Keywords Size and Invalid Keywords Size. Does anyone know how to pass this issue? TY!
Your outlines are so crisp and dark, mine are blown out and transparent. Not sure what I did wrong! (I run into this issue with other sobol tutorials too)
Outlines are really tricky! It may just take a lot of tweaking the material properties, especially the thresholds. I found depth outlines are especially difficult to get right. I make a few improvements to them in the video releasing tomorrow, so hopefully that will help!
Hi! If you look in the frame debugger, (window -> analysis), do you see your outlines pass show up? It should be near the bottom of the window. If not, something is wrong with your renderer feature. If yes, something is wrong with your shader or material.
@@NedMakesGames Thank you so much for replying. Unfortunately I've still had no luck. The outlines pass shows up in my frame debugger so I'm going to try re-creating the material from scratch again. I have this feeling it's going to be the smallest and simplest issue when I find it.
@@NedMakesGames I've actually just found out I can see the effect of the individual outlines pass by selecting it in the fame debugger. Perhaps there's something wrong with the way I'm applying the effect to the frame. The Outlines pass has no render target as opposed to the other passes in the frame debugger.
@@naeyoo42 Hmm, that would indicate a problem with the renderer feature, I guess. Try using this blit material feature instead of the one in the video: github.com/Cyanilux/URP_BlitRenderFeature Cyanilux's has a few updates which could fix this problem.
No, _MainTex is the screen texture. You can access the depth texture with a Scene Depth node (or the SHADERGRAPH_SAMPLE_SCENE_DEPTH macro in HLSL code).
Half the reason I liked was because there were 665 likes. I've been using shader graph for 2d, so most of this tutorial didn't apply to me, but I skimmed it anyway.
pls make a video showing only on specific objects not the entire screen and changing its color to maybe red idk, since alot of games have enemy ai that have red shader border on them but in Rinder Pipline its legit hard.
You can change the color of these outlines already. But I am writing a video about applying these to individual objects right now! Should be out in a few weeks
You mean the built in render pipeline? Outlines are possible, but you can’t use the shader graph or renderer features, so the implementation would be very different. You could use the same sobel algorithm though.
Hi! Does your screen go black after you turn on the renderer feature? I would guess something is wrong with your shader. Feel free to post a screenshot of your graph and check you script against the references in the video description.
Hi, thanks for the feedback. It's a difficult balancing act for me between going too fast and being too long winded. I will try to do better! Feel free to change the playback speed by clicking the gear in the borrom right corner of the video. I hope that helps a bit.
There are probably some optimizations to be made - I usually focus more on clarity for the tutorial's sake. That said, some old mobile devices have problems with the extra memory taken by the depth/opaque textures. I think current hardware can handle it though.
It's a shame they've overcomplicated image effect shaders so much. All you used to have to do was pass an image effect shader material to Graphics.Blit().
Bad tutorial. It no longer works with newer unity, and the original creator doesn't care or bother to clear up a fix. The beginning part is also confusing to what to do Wasted time.
Hey, in the urpasset_renderer inspector there is no option to add the render feature blit material feature. Am I using the wrong version or doing something wrong? On a URP template for 2020.3.2.
Hi! The Blit renderer feature is a custom renderer feature. You can download it from the video description. Add it to your project and it should show in that list.
Hi everyone, thanks for your comments!
🩹 Fixes
► I made an editing mistake around 1:30. Please note, you need to place the outline material into the material field of the BlitMaterialFeature. It should not be empty after this step. Sorry about that!
For 2020.2:
► When you create a shader graph, set the material setting to "Unlit"
► The gear menu on Custom Function nodes is now in the graph inspector
► Editing properties must be done in the graph inspector instead of the blackboard
✨ I've released a follow up video to this, adding normal edge detection and a bunch of other improvements. Check it out here: th-cam.com/video/fW-5srSHDMc/w-d-xo.html
It wont allow me to add a blit material feature at 1:26.
@@theflamingturtle4084 Hi! Do you get any error? Does it not show up in the list? I would make sure that the file name and class name in the cs file match up.
@@theflamingturtle4084 Had the same problem, you need to add the code from the description link into the BlitMaterialFeature.cs
Thanks Ned :)
For people using URP 14+ this won't work, as BlitMaterialFeature.cs is using the old API.
If you are new to URP and, like me, can't upgrade the file to make it work, I found an alternative solution:
- discard the BlitMaterialFeature.cs file
- at 01:22, click Select Renderer Feature and select "Full Screen Pass Renderer Feature" (Only available from URP 14)
- In the renderer feature set the Material and, IMPORTANT, set requirements to "color"
- Ultimately, apply two changes to the shader:
1) 06:58 instead of using a Sample Texture 2D with _MainTex for the blend, use a "URP Sample Buffer" node, and set the source to "Blit Source" (which simply passes the color of the pixels, like the main texture would)
2) In the Graph settings, change the material type from "Unlit" to "Fullscreen"
- NOTE: you can skip the last step at 07:16
Also, I'm not sure if there's a difference in performance or if it's considered best practice or not...
For anyone trying this in newer Unity Versions: You have to replace the "UV" Node in the shader graph with the "Screen Position" Node.
Thanks for the heads up!
Thanks you!!! I was entering another universe for a short while there
Hey! For those who are using 2020.3, use a "screen position" node instead of a "UV" node for the input on the Custom Function!
The reason is that unity is feeding a render of the UV output of the scene (don't ask me why), instead of what is expected, an UV that goes from (0, 0) to (1, 1) for the screen.
Oh that's interesting, I haven't encountered that before! I wonder if it still behaves strangely in builds? Either way, using screen position should be safe. Glad it's working!
Thanks so much for this video! Can't quite get it to work though, was hoping you could help. I've gone back over the video contents a dozen times to make sure I got everything right, made the "Fixes" in the description, scrolled through all the comments, still nothing. Basically the shader seems to have no effect EXCEPT when I set DepthTightening (is it tightening or thickness?) to a negative value, then the whole screen gets set to the outline color, with just a few object shadows showing through. I went through a few of the earlier videos in this series first and the desaturation shader works fine.
Only thing I can find that isn't exactly like the video:
My version of Unity (2021.3.2f1) in the debug options for the shader the single Keywords text field seems to have been replaced with two arrays, Valid Keywords and Invalid Keywords. They're behaving really wierd and buggy but I was able to add the REQUIRE_DEPTH_TEXTURE keyword to the Valid Keywords array (I've only gotten so far as depth not color)
Here's the shader and hlsl script as I've put them together:
drive.google.com/file/d/1nYbqcnY2WSnANoIZquMOtZ-GWBZq30RQ/view?usp=sharing
drive.google.com/file/d/1VDkabtqxF1Rw9apCcPaKme3Xi7OrbJqE/view?usp=sharing
This is like the last difficult thing to solve on my current project so I really hope you can help me out :) Thank you again for making these videos!
don't bother the author of video doesn't care to share a fix for outdated video
I'm writing a comment just to help the algorithm because every your video is awesome, I've recommended it at work :)
Thank you! I really appreciate it. Thanks for watching!
@@NedMakesGames I love that you put links in description to the previous and following videos. It’s organized better than most curses on Udemy ;)
@@adamodimattia 😅 Well I try my best! I wasn’t sure if people would prefer links like that or playlists!
@@NedMakesGames I think that you could use both :) Sometimes one opens a random video and would like to know the previous and the following. And sometimes one already knows what he/she wants and then the playlist is better.
@@adamodimattia I came to that conclusion too, and thankfully playlists are pretty easy to set up!
Another good shader video by you. Nice work!
This tutorial helped me a lot in my game development.
I'ld like to see more of advanced tutorials such like that. Great job !
Amazing tutorial, explained from top to bottom as you'd expect! Keep it up :)
If you have black vertical lines going across your screen like i did make sure the input UV in the custom function is a vector2 not a float or vector1
Oh yes, I think everyone makes this mistake at least once when using Shader Graph. Thanks for the heads up!
Thanks a lot, this really helped me soo much
Thank you so much for these tutorials! I am completely new to shaders, and was expecting that everything would go over my head. But you explain it really well, looking forward for more content! :)
Thank you for watching! I'm really glad to hear that, since I'm often worried I race over stuff for the sake of brevity. I hope I hit a good middle ground.
Really good and useful tutorial, thanks for sharing ! Can't wait for the custom render feature for the sobel depth normal texture :)
I made the sobel function a bit more general so that I could feed it my own textures. But I was struggeling a while to get it working and I thought if the docs tell me UVs need to be normalized why are we using whole integers to offset it... So turns out I needed to use a screen node and use those values to normalize the offsets by dividing them. Maybe this will help someone who stumbled on to the same problem
hey i work on unity 2022.3.20f1 and i couldnt even create a blitmaterial-renderfeature i think it doesnt work anymore
subscribed! best method i've seen on making outlines! ty for the corrections in the description btw.
If anyone has trouble with Unity 2021.3.20f1 I had to make my keywords in the graph set to exposed. Also, in the debug section the keywords are not separated by a space. There is now an array for them
Hi there! First of all i wanted to thank you for this amazing tutorial, I know its a bit late but I have a question! How can I exclude certain gameObjects so they dont have this render feature? I really want to use this method but i keep getting some weirds outlines on certain objects! Thanks again :)
Hi! It's not super simple to do with this exact implementation. You might have better luck with the outlines in these video:
th-cam.com/video/1QPA3s0S3Oo/w-d-xo.html
th-cam.com/video/74AS5DmLe8w/w-d-xo.html
This doesn't work with 2021.3? Followed the tutorial to the T, but no outlines show up.
Hi! Yes, it should work in 2021.3. Are you getting any errors? If you put a plain white material in your renderer feature, does your screen turn white? That would let you know that the renderer feature is running. From there you can start debugging the outlines graph.
It doesn't work form me :/ it does nothing when i set the values on 1, I tried with the screen position node, but it also doesn't work
You just made my day!! :)
Btw, I had a bit of a bad start, so if anyone has trouble with the render pass not showing...just deleting my old camera and adding a fresh one to the scene made everything work for me!! :)
Thank you! Glad it was a simple fix!
@@NedMakesGames Hey, I got stuck again and came back...now I realized, the effect does need the camera clipping planes to be kinda default to make it work!!
@@swannschilling474 Is it depth outlines? They are kind of picky. If you can, I would work through the follow up video here, th-cam.com/video/fW-5srSHDMc/w-d-xo.html . I add a lot of little tweaks that make outlines more stable.
If you don't want depth normal outlines, I would at least try creating a scene depth node, set in raw mode. Multiply it with the threshold for depth outlines before feeding it into the fine tuning node. That will help things, I think.
@@NedMakesGamesThx, I will check it out!! Great channel, liked and subscribed!! :)
I plan to use this feature to create a visual style heavily inspired by Jean "Moebius" Giraud's colorful comic art, and use that for a mecha crew simulator game me and my bff work on. Thank you for this great and deep tutorial!
That sounds really cool! I’m glad to help!
Jean Giraud’s art is breathtaking
Awesome! Could you tell if it would be possible to remove the colors from the output thys leaving only outlines on a white background?
Thanks for this!
Custom render passes allow me to make the graphics look more unique and focused on the details I care about the most without changing all the shaders currently used for the premade models in the scenes... So, this was VEEERY helpful! Thanks again 🙏🏼
it doesnt work for me. it just shows big black vertical lines across the screen
This sometimes happens to me if I accidentally write "float" instead of "float2" in one of the custom functions. I would double check that.
You can also check the references in the video description, or take a screenshot and either email me or post on Discord. You can also post a link here, but TH-cam will hide it and not give me a notification, so I won't see it right away 😅
One question: how do I get this shader to work consistently between “scene” view and “game” view? I am getting good edges for both, but only if I have different material settings for each. Very little information exists out there when it comes to explaining when shaders are rendering for a scene editor view and when they are rendering through the scene’s main camera.
Thanks for the lovely tutorial! I got the depth edges working correctly, but the colour ones are constantly 'flowing outwards' as if there is some form of feedback. I have been fiddling with the params for ages in order to stabilize them but to no avail. I can't figure out if I did something wrong or if it's just the numbers as your colour outlines imemdiately look comparable to the depth ones.
Hi! Thank you!
There could be a couple of reasons for this. Make sure that the scene color (or opaque) texture is enabled in your URP settings asset and camera. It could also be that your blit material feature is running before the color texture is ready. Move the render event in your renderer feature's settings later and see if that helps!
@@NedMakesGames thanks!
Did you ever figure this out? I'm seeing the same issue. I double checked my graph, copy and pasted all code, used the same material values as in the video, and made sure I enabled the depth and opaque textures + shader keywords, but after adding the opaque part of the graph, there's a trippy "flowing" effect that ends up creating a weird static pattern in the scene.
Is this possible to replicate for the built in render pipeline and for unity 2019.
Hi! Yes something like this is definitely possible. You would have to make a lot of changes (no renderer features or shader graph, depth texture is sampled differently, etc.), but the sobel algorithm would be the same!
@@NedMakesGames what about using ASE as an alt for shader graph?
@@Smash_ter I’ve never used ASE, but I think it’s at least as powerful as the shader graph, so you should be good.
Awesome, I really like the approach
Cool video! URP 10 has a DepthNormals texture built in because they used it for their AO implementation, so no more custom feature needed. Although, it seems that unlit materials don't write to the texture, which is useless to me so I'll still be using my own pass.
Thank you!
I did see that about URP 10, but I've been burned by using beta packages so I decided to hold off on it for now. It seems I made the right decision. Thanks for the heads up about unlit materials - that's really strange.
@@NedMakesGames My guess is that they were implementing AO, needed the scene normals for that but they don't want unlit objects to receive AO since that doesn't make sense, but their solution was just to make unlit objects not write to the texture? Idk, hope they change it
@@TOPPREDATORable That makes sense. I hope so too, or at least have an option for it
@@cleandust530 it does in URP version 10. I think you have to have Unity 2020.2 to use it
@@cleandust530 I’m not sure, I haven’t tested it. My understanding is that Unity has decided to implement deferred rendering so the URP supports everything the built-in renderer does.
Hey man All I have is a black screen when my thickness is zero or less and no outlines with anything above 0. I also did not have the Feature definition option for the DepthTexture Boolean
Hi! What version of Unity are you using? If you route the depth sobel custom function directly into base color, what do you see?
I've been fighting with this shader for a while now, and I have an issue I just can't seem to figure out a solution to. Specifically, this sobel implementation has a minimum outline thickness of two pixels, which is annoying when you're attempting to use it in pixel art applications. Is there a way to make the sobel filter not generate an outline when the depth texture at a given pixel is higher than its neighbors (Such that outlines only generate "behind" objects).
I'm using an overlay camera for my weapon which is added to my main camera's stack and for some reason it is rendering the lines through my weapon. Making it feel transparent. Any idea why this would be happening?
Came back to say I fixed it. I just had to find a different solution to the weapon camera. I now render the weapons layer on the main camera and have a render feature that prevents weapon clipping using the main camera.
This might be what sable game used for the looks, thanks a lot!
No problem! I think they might use something like this. That game is so beautiful!
Any to make it so that it doesn't place the outline on where the model gets shaded? Thanks!
Okay, it's probably due to the low poly count, but please answer my question still. Thank you!
P.S. Let me clarify: I don't want the outline separating colors of different brightness values if they have the same hue and saturation values. Let me know if that's possible!
Great Tutorial Ned!
Thank you! Thanks for watching!
Aye there, fantastic tutorial, really helpful for my present project. Had a question though, how can I get the shader to work for both my base camera and overlay camera? Its an FPS with the overlay camera rendering the held weapon while the base camera renders everything else.
Hi, thank you! That’s an interesting use case I haven’t really tried out. Do outlines not display on objects rendered from one of the cameras? Do both cameras use the renderer with the outlines feature? Theoretically this shouldn’t be a problem, but URP may handle depth textures differently for overlay cameras.
@@NedMakesGames Thanks for the quick response and apologies for the lack of info. The main camera is rendering fine, with the outlines and such, but the overlay camera, that views the view model (weapon) is rendered normally, with no outlines. I imagine I somehow need to put the overlay depth texture over the main one before the custom function in the shader graph, though I’m not sure how I’d go about doing that, or even if overlay cameras have a depth texture. I’d appreciate any assistance on the topic, Thanks.
Edit: Both cameras do use the same forward renderer.
@@tylerdelange5959 Yeah, I think this problem could get complex. I have not worked much with overlay cameras, but my intuition says you should be able to run the outlines pass separately over each camera's depth texture. However, according to this:
docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.2/manual/cameras-advanced.html
overlay cameras receive the depth texture from their parent, which complicates things. What happens if you change the clear depth settings on your overlay camera? What happens if you detach the overlay camera and make it the main camera? Do you see outlines on your view models then?
@@NedMakesGames yeah I’ve been reading up on a bunch of documentation. Fiddling with the clear depth hasn’t resulted in any change. Setting the overlay camera to base makes it all bug a little bit, as URP can only have 1 base camera at a time. Setting the view model camera to base and the other one to overlay results in the outlines only showing up on the view model, not on the world. I’m not 100% what the best way to proceed is, I’ve looked through a ton of documentation already. If I could access the overlay cameras depth first, and additively combine it with the main one before running the function and such, I’d be set. I’ll put a solution here if I come up with one
@@tylerdelange5959 That would be really nice of you! Hopefully the solution’s not too complex.
I’m curious now, so I may look into it a bit too, if I get a chance.
in the .HLSL file, shouldn't the sixth float2 of sobelSamplePoints[9] be (1,0) instead of (1,1)? As it stands the cell that should be the middle-right is sampling the top-right instead.
Yes that's right! I didn't catch it before editing the video, but the reference scripts in the video description have the correct values.
amazing job as always!!!!
Hi, Do you know If I can somehow get shadow information into the shader graph as well? I want to add outlines to all the shadows as well, if you know of any resources please let me know. Also Thank you for making this tutorial it still works in the 2022.2 version with some changes:)
Hello, I am in Unity 2021.3 and I don't have any outline. :/
Also, I can't put any kewords on the materials but the DepthTexture checkbox shows up on the inspector.
Thx in advance for help!
Hi! I haven't gotten to test this in 2021 heavily, but you may be able to get it to work by adding the keyword to your Shader Graph. Doesn't seem like you have to do the material debug inspector step any longer.
Mine just comes out solid white...
Hi! There may be something wrong with your graph. Make sure the "reference" of your main texture property is set to "_MainTex" . Also, feel free to upload a screenshot of your graph and I can take a look at it!
@@NedMakesGames That solved it, thanks!
Using Unity 2021.3.11f1, the shader keywords text box cant be found in the debug window :(
nvm, found a solution. you need to create a "Boolean Keyword" instead of just a "Boolean"
Hi Ned, wonderful tutorials! You explain things really well for code dummies like me.
I have been getting an error with the BlitMaterialFeature script for this outline tutorial. I'm in Unity 2020.1.12 and whenever I input the Edge Detection Outlines Include script into the custom function node I'm getting the dreaded error exclamation mark and the node won't work. It's saying syntax error: unexpected token 'using" and then it lists the shader. I've checked typos and I swear I've done everything the same as your tutorial so I'm just really not sure.
Any tips?
Hi, thank you, I'm glad it's helping you!
Is the error with the BlitMaterialFeature or in your graph? Either way, there's a "using" keyword that the compiler doesn't understand 😅 If it's in EdgeDetectionOutlinesInclude, did you create the script as a C# file initially? Unity probably put some lines at the top that you can delete. If it's in BlitMaterialFeature, maybe you forgot a semicolon? You can check the files in the video description to see how the scripts should look!
@@NedMakesGames Hi Ned! I was feeling like the issue was in the BlitMaterialFeature, I finished the graph until the end of the video and I was pretty positive that I copied exactly. But I will double check and check out these things you've listed to make sure.
Thank you I really appreciate the reply!
Hi ty for the video !
I can't understand why it's not working.
I can see the outline but the other part of the screen is blank (color of the parameter in the node of the main texture)
Any idea ?
thank you !
Hi, thank you!
Probably just a small error in your graph. Do you mind to take a screenshot of your graph and I can take a look?
@@NedMakesGames thank you for your quick answer!
I don't know how to post my image so here is the link to download my shadergraph screen.
we.tl/t-wCr91GeXFa
Thanks a lot anyway! :)
Hey there! I am new to the renderer side of Unity, so I probably did something wrong in the setup - I can't even get the effect to show up in the frame debugger (which I believe it should?). I tried your blit feature as well as the cyanilux one you recommended somewhere. There are no errors, only in your renderpass, there is a warning about the RenderTargetHandle being obsolete. How would I go about debugging this further? The project is in Unity 2022.1
Hi! I have not tried this in Unity 2022, so I'm not sure if there are any major changes to renderer features. But, if your new pass does not show up in the frame debugger, that would suggest it's not running at all.
I would start by setting your renderer feature to use a very simple material - create a shader graph to just output red for example. Then it will be very obvious if it's working or not.
Then, I would try inserting Debug logs in various functions in the feature and pass classes to see which ones run and in what order.
Hopefully, these steps will at least give you a better idea which parts of the system are running.
@@NedMakesGames Well, the good news is, I figured out a "solution". But I am so mad with how long it took :D
In my Unity 2022.1, the project settings don't use any Universal Renderer Data asset other than the default one. Even if I switched them out (and it would show the new asset in the corresponding setting field!). I only noticed after a Library rebuild that the shown asset had reverted to the default asset. If I attach features to the default asset, the render passes do what they're supposed to.
I tried reproducing the issue on a laptop but it appears to be specific to my PC. It's not Window's ransome ware protection. Not sure what else might interfere with writing to a settings file...
@@datnade2299 Now that is a strange one! Every once in a while, I do have problems with Unity's library becoming corrupted. It's always annoying to debug!
would love to see other lighting techniques such as blinn phong as well as water shaders or shaders that deal with vertex displacements
All good suggestions! I will add them to my to do list!
@@NedMakesGames how long have you been doing this cause your knowledge is crazyyy
Haha thanks! I've been doing Unity stuff for about eight years!
@@NedMakesGames lol this makes sense
finally !! ty ive beeen looking for something like this 4 ever
Thanks for watching, I hope it's what you've been looking for! Be sure to check out the follow up videos for some extra features and refinements.
@@NedMakesGames ive beem searching for a way 2 make my 2d cartoon in 3d and make it look like 2d..and especially the outlines have been the biggest hurdle with your vids i might be ablte to get close to what i want..ty i will be watching and liking all ur vids in the near future
Hello, sir! I'm using a different version of Unity (2022.2) and was wondering if this could be used for unity's Fullscreen Material on Custom Passes? I can't seem to get it working for it.
Hi! I have not had time to try out that feature, but theoretically it should work. By that I mean the sobel algorithm will definitely give you outlines, but I'm not sure how to hook up depth and blend back to the screen using that method.
@@NedMakesGames
Thank you for the response! I eventually figured out the problem through trial and error, and it didn't have anything to do with the Fullscreen Custom Pass, and, in fact, with unity's new features in 2022, it was easier than ever, as Shadergraph can now output the Scene Colors and Scene Depth using nodes instead of needing to render to a Render Texture first.
Instead, it turned out to be a problem with the orthographic camera, which renders Depth Buffers differently from a Perspective Camera. I had to reduce the far clipping plane of my Orthographic camera to 500, and increase the sensitivity of my outline threshold much higher to compensate for that.
Likewise, I discovered that to get pixel perfect outlines, (Ones that do not look blocky/have corners on a 1 pixel scale), you need to go into the Sobel Script and change the corner values of the number checking grid from 1 and -1 to 0's, as this will make the script ignore corner pixels in its calculations, making for a much crisper look.
I hope this helps anyone who had the same issues that I did!
@@shadestylediabouros2757 I'm glad to hear it works so well in 2022! I hope I can check it out myself soon. Thank you for the detailed write up too, I'm sure it will help future viewers.
Hi, first thanks for this video really informative. However I think I have set it up wrong as if I say set this for one of my prefabs so say trees use this material I thought only those would be outlined but it seems it just renders the enter texture on the screen over what should be displayed. So say I pick a texture of a sword, set that on the blit material, run my project then instead of seeing all the trees for example in the view I just see the sword texture. Any ideas? Thanks
Hi! Thank you, I'm glad it helped you!
Yes, this particular implementation draws outlines over the entire screen. The outline material should only go inside the renderer feature, your objects should just have materials with "normal" shaders.
If you only want outlines on specific objects, try this tutorial: th-cam.com/video/74AS5DmLe8w/w-d-xo.html
@@NedMakesGames Thanks for the reply, actually I do want one that does an outline to everything but when I try adding it to the renderer I just get a white screen. The white screen is because of the Empty (white) Texture. If I drag a texture into it then I get that as the whole screen, nothing else is drawn just the entire texture. Is there something I need to do to tell it to use what is being rendered as the texture? Sorry if I'm being dumb but can't see how the screen image is being used as it just uses the texture in the shader. Thanks again, for any help or pointers!
@@dominiauk Oh sorry for the confusion! It's no problem. Do you mean the main texture in the outlines post process material? You can leave that blank and the system will fill it with the screen's texture. If you don't see any outlines, try changing some of the material settings or moving the camera around. Feel free to take a screenshot of your graph too and I can take a look at it!
@@NedMakesGames Hi Ned thanks for the help, I've got it now rooky mistake! I'd named the Texture _MainTex but not the Reference. So I guess it wasn't being picked up by Unity. Seems to be working fine now. Thanks again for the help, very much appreciated !
@@dominiauk I'm glad it's working! No problem! That's an easy mistake to make
Hey Ned! I wonder if there's a particular reason why the HLSL code is MIT license and the BlitMaterialFeature is GPL.
Hi! Only because I switched licenses after my first few tutorials. Since I wrote BlitMaterialFeature.cs for one of my first tutorials, it's under GPL. I should get around to formally changing that, but for now, I give you permission to use BlitMaterialFeature.cs under the guidlines of the MIT license.
@@NedMakesGames Thanks!
Hey Ned. Great tutorial. Been trying to do an outline shader for single objects for a week now and keep stumbling over things. Could you use the sobel matrix for individual objects with their own shader?
Hi! That's possible. You could use hull outlines, which I detail in this video: th-cam.com/video/1QPA3s0S3Oo/w-d-xo.html. If you want to use edge detection outlines, it's still possible! You would need to modify the graph quite a bit so it runs on a mesh. I think you could still use the same custom function nodes, but you would need to get the screen space UV to feed into it. Then, blend the outlines with the mesh's albedo color. Could also delete the renderer feature at that point.
You could also give this a try. alexanderameye.github.io/jfaoutline.html it uses jump flood algorithm for outlines. It definitely has advantages but also disadvantages.
My depth texture is always black. I'm trying to figure out why.
That is strange! What Unity version are you using? Is depth texture turned on in your URP settings asset? Also make sure the sample depth keyword is enabled on the blit material.
I fixed it but I'm not sure how. Thanks for the reply.
Would it be possible for color edge detection to exclude black edges, and if so how would I implement that?
Hmm, do you mean edges with black on one side? I'm not sure how well it would work, but you could modify the sobel color function to check if any of the samples are black, and if so, set the sobel value to zero.
So how would I avoid the color effect on the skybox?
Hi! You would have to get the skybox not to render to the scene's opaque texture. You might be able to do this by changing the skybox's render queue value to "Transparent."
This method works with models with rigidbody component? Others outline shaders that i have tested don't work on models with rigidbody component
Hi! Yes, it doesn't care what kind of physics you apply to models.
@@NedMakesGames Thanks!!! Your videos are always very useful to my projects!
hi i did everything you said to do and the outlines are there but the color of my whole map is gone. Where is the problem ?
Hi! It seems like either the scene color node isn't working or isn't blending with your outlines. What displays if you route the scene color node directly into base color?
@@NedMakesGames what you mean "scene color node" ? the UV node ? the "color" node ? sorry i'm not used to shader graph 😅
@@bananazzplit Oh I'm sorry, I mispoke. I meant the main texture sample. What happens if you route it directly into base color? I think something wrong might be happening with it.
@@NedMakesGames everything turns white and loses the outline
@@NedMakesGames OH i found the problem ! xD
I left the Main texture reference in _MainTexture and not _MainTex
I didn't think the reference was so important.
Thank you 😁
I get the outlines showing up in the material preview, however not in the scene itself, any idea what the reason for this is? I'm using 2020.3
Hi! I wonder if your renderer feature is set up correctly? Try having your outlines shader graph just output red (route a color node into the base color field) and see if your game screen turns red. If not, then double check your renderer feature. Feel free to post a screenshot if you'd like and I'll take a look at it.
I fixed that problem, but it doesn't look quite right. I get these weird fuzzy visual effects, here is a screenshot. ibb.co/cDRJTZb. The area under the lines. Some of the lines themselves are a bit fuzzy. Thanks for your help.
Works in 2021.3.11f1
Thank you so much !
It works very well with any low poly models.
I'm glad to hear it! Thanks for watching!
How did you make it work? I don't have the Blit material render feature option in the URP.
I created a new URP project, but there is no BlitMaterial when I click "add render feature" in the URP renderer inspector. How do I fix this?
Am using Unity 2020.2.7f1
So sorry, I figured it out. Mea culpa
@@trainsfemme No problem!
@@NedMakesGames Though, I do have an issue - mainly that color attenuation isn't working. The actual outlines work fine, but not color. I tried copy-and-pasting your finished version of the HLSL into the text file, and that didn't fix anything.
@@trainsfemme Do you mean the shading on your mesh? That's actually a toon shader - separate from this outlines shader. I have a series on toon shaders here if you're interested: th-cam.com/play/PLAUha41PUKAasDP7TOMBRramS5mkQ0hIG.html
Hi, I work in Unity 2020.3.30 urp, and followed everything from beginning to end (with the changes in the comments). But the thickness doesn't seem to change no matter how much I change any settings. I checked debug mode and all multiple times, but don't see any difference in thickness. I'm not certain if have to make any changes for Unity 2020.3.30. Does anyone know what could be wrong? Would be a great help.
Hi Robin! It's easy to make little mistakes in you graph, so if you'd like, I can take a look at it. Feel free to take a screenshot and either email me or message me on Discord (you can find links in the video description). You can post here as well, though TH-cam tends to hide posts with links (so I won't get a notification).
@@NedMakesGames Thanks, asked my teacher and he helped me solve it. Love your videos, they are really helpful. 👍 👍
@@Mr.RainySunshine Thank you, I'm happy to hear that! Glad it's fixed!
Hello! Thank you for this amazing tutorial. I have noticed, significant framerate drop while running this shader on a mobile device with decent specs. (snapdragon 855 cpu and adreno 640 gpu), processing depth and color edge calculation for each frame must be taxing and presumably a game with multiple objects in a scene with lower specs device would perform much slower. I understand this wont be a problem for other platforms such as pc or console but could you please explain certain work arounds or optimization on this shader (for a mobile device.)
Hi, thanks for the kind words!
One good thing is these outlines take the same amount of rendering power no matter how many objects are on the screen, since it runs as a post-processing effect.
You could save some power in a couple of ways. If you don't use one, turn off either the depth or opaque textures. That will help a lot. Secondly, you can remove the non-diagonal kernel positions in the HLSL file. This will half the number of texture lookups. Quality will go down but that should help with performance.
Good to know, will experiment further and many Thanks for sharing.
i dont get it.... exactly how are you actually getting the unity depth texture? I understand you made a boolean, and i did that too but its not working i just get pure black color everywhere, please advise, thanks in advance.
Think i realized why, the hlsl script basiaclly has no idea what this is: "SHADERGRAPH_SAMPLE_SCENE_DEPTH"
@@stefanvidev1255 SHADERGRAPH_SAMPLE_SCENE_DEPTH should be defined for URP Shader Graphs. Do you have the depth texture enabled on your URP settings object? What version of Unity are you using? You could try routing a scene depth node into the output node just to see what that looks like.
@@NedMakesGames Oh thanks for your reply man, i actually realized i had made a boolean instead of keyword boolean, my bad man.
Nice video, really informative. I'm currently stuck in 2021.2.10f1 with trying to apply it to the entire scene. The outlines are working fine, as they are present as a lighter color of the base color when placing the material on a object, but outlines aren't visible in screen view. I have no errors on the project so I'm imagining I'm missing something somewhere, the material is in the blit material for the render pipeline and post processing is checked on my main game camera. I'm writing this as I'm about to go to bed so sorry if this question isn't written well. Also thanks for answering a lot of these questions in the comments! it's helped troubleshooting a lot here. if you or anyone else could help me here I would greatly appreciate it!
Still have the problem of it applying through the renderer, but I found a work around with applying it to the object, I was able to get the outlines to appear when changing the material to a transparent mode then multiplying it. So now I have an object in front of the camera view always following around the player character to give the outlines, gonna have a friend look over it tomorrow and give some help to see if there's any other way of doing this as currently there's light changes that happen when moving the mouse that can be annoying.
@@armagedonthe1gamer Hi! Well I'm glad it's sort of working now! There seems to be issues with this outline system and stacked cameras, do you happen to use that system?
@@NedMakesGames I am not currently using stacked cameras, but I believe we will be integrating them for use of hud and ui systems later on.
Hi, I'm using Unity 2022.2.21, I followed the tutorial, and the outlines are showing, but now there is no color except white and black outlines. Any idea on why this is happening? Great tutorial btw :D
Hi thank you! This is usually an issue with the final blend node, which blends outlines with the main screen texture. Try routing each input into the blend node into Base Color and see what it looks like. That should help you see what's going on.
@@NedMakesGames I got it working by using scene color instead of using sample texture 2d :D Thank you!!
Is there anyway i can combine this with the toon shader because I blended this with the sample 2d node and turns the mesh dark. The other method didn't work so I tried this . I am at the point where i am thinking my mesh is to complicated lol
It's a lot like the hull outlines. You put the outline material in the blit material feature, and it will draw on top of everything else. No need to blend the graphs together!
I'm using this in a game, and I've noticed that my reflection probs stopped working when using the Blit material in the Forward Renderer. The baked ones are fine, but the realtime ones are all black. Is there a fix or a way around this?
Hi! It's strange that a screen space blit messes up reflection probes! I'll have to look into this more, but you might try this blit renderer feature: github.com/Cyanilux/URP_BlitRenderFeature
It fixes a few edge cases, and may work better for you.
What version of Unity are you using?
@@NedMakesGames Thank you!
I probably should have mentioned I'm using unity 2019.4.16. If that helps.
@@ecthoart3815 Thank you! I haven’t tried this in 2019, so it could be a Unity issue. I’ll see if I can find something about it.
Heya, awesome tutorial but I'm having an issue with the hlsl code. Visual Studio tells me "Function 'SHADERGRAPH_SAMPLE_SCENE_DEPTH(float2)' is not declared." , and I have everything written out the same way as the tutorial. I'm also pretty certain I've set up my Renderer the same way.
Does anyone know a solution for this problem?
Hi! Visual Studio gives you that error? Does Unity as well? Visual Studio might just be confused because it doesn't know shader graph automatically includes some files, but the code will still work in Unity. To get rid of the error, you could try manually #including the URP ShaderGraphFunctions.hlsl file, which contains the definition for that macro.
If it's a problem in Unity too, you might need to update your URP or shader graph package.
@@NedMakesGames I've made sure that ShaderGraph and the URP are using the latest versions, and the error only shows up in Visual Studio, not Unity. Using #include to add the ShaderGraphFunctions.hlsl file doesn't seem to work, and if I add the code from that file by copy-pasting the shadergraph_LWSampleSceneDepth function and associated #define, it compiles fine but then Shader Graph throws an error on the custom node telling me I've made a "redefinition of _Time".
I can still get some weird results out of the shader so it's not entirely non-functional but nothing like what's in the video. Thankyou for your time!
@@shaunvandermey4305 That's really strange. Do you have the Visual Studio Editor package in the package manager?
If Unity doesn't throw any errors, you could just ignore Visual Studio in this case. Unity does the compiling of your game code, so everything should work OK.
I am having the problem that everything works fine in the editor...also when I hit play, it all works! But when compiling the Game it does not show at all...any ideas?
Hi! I would start by looking at the build’s log files. docs.unity3d.com/Manual/LogFiles.html
Are there any errors in there to give a clue?
@@NedMakesGames Hey, I watched you tutorial again and realized that I forgot to turn on Depth Texture in the URP settings...thanks for making these, they are a great help!! :)
I am having another issue which is not related to you tutorial, but also to post processing...bloom also only works in the editor and not at runtime, could there be a related fix?
@@swannschilling474 Oh good! I'm glad they're helping!
Are you using the bloom included with URP post processing? You could try making sure the opaque texture is enabled in the settings asset, as well as post processing on your camera.
@@NedMakesGames Yes, I am using the bloom inluded in the URP post processing...its the one that came within the URP template! I got post processing enable in my camera and opaque texture is enabled! I am pretty new to the scriptable render pipeline, maybe I messed something up along the way?
@@swannschilling474 Hmm I’m not sure why that’s happening. Are you building for Android by chance? I read some post processing doesn’t work on it: forum.unity.com/threads/bloom-doesnt-work-on-android-build-with-urp.950416/
OMG, so cool! Going to try this
Thank you! I hope you like it in game!
I missed the part where you changed the blend mode and spent two days trying to figure out what went wrong...
Oh no 😧 I wish Unity made that dropdown a little more noticeable!
I finished every step of the tutorial, sadly it's not working and nothing changed. There is an error in the .hlsl file and Rider tells me: Cannot resolve symbol 'SHADERGRAPH_SAMPLE_SCENE_DEPTH'. Could that be a problem - how can I make it work?
Found my mistake: Wrote "REQUIRED_DEPTH_TEXTURE" instead of "REQUIRE_DEPTH_TEXTURE". Thanks for the video! I hope many more will watch your content.
I'm really happy with the result so far.
Wierd thing is, that the outlines are nice if the camera is close, as soon as the camera zooms out the shaders blur out.
After doing the last step it works fine. Only problem left is that if I zoom out the Thickness of the outline stays the same and doesn't get smaller with the mesh. Is that fixable?
@@Nadeloehr1990 Hi, I'm glad everything works now!
Usually that is a feature of these outlines - that they don't change with perspective! I hate to tell you to do this since you just got these working, but your best bet would be to use hull outlines. I have a video about them here: th-cam.com/video/1QPA3s0S3Oo/w-d-xo.html
Alternatively, you could change your graph a bit to shrink thickness for far away objects. Add a scene depth node. Then multiply that with your thickness property before feeding it into your sobel custom function nodes. You could even use a smoothstep to set minimum and maximum depths, or a lerp node to set minimum and maximum thicknesses. I haven't tried this myself, so it might have a few weird artifacts, but it might be worth a try!
Great tutorial! Thanks so much!
Glad to hear that! Thanks for watching!
Hi Ned, I copied the process 1 to 1 on 2019.4.13f1 and my outline is messed up, is it possible for you to upload the shadergraph and ball texture as well to compare those?
or the demo proj? I don't know what I did wrong
@@fangoerbayun2587 Hi! Sorry, I don't have those available, at the moment. The ball texture is nothing special though, it's just vertical rainbow stripes. Can you take a screenshot of your scene and/or graph? I might be able to help out.
@@NedMakesGames Thanks for the reply! I found out that I was missing to set the material in the renderer features, the vid covers it briefly at 1:35 but the material is never set in. I actually thought that this is a material shader applied to each ball. So it's not that useful for my case because I don't want the outline applied to all objects.
Sidenote, do you know how I can make an outline for a 2d texture on a quad? Simple outline, only external, not internal by colors like yours.
I followed this (th-cam.com/video/FvQFhkS90nI/w-d-xo.html&ab_channel=CodeMonkey) tutorial and it works great for a 2d sprite, but I also have a quad mesh that I put a 2d texture (with transparency). I switched the graph node from Sprite Lit Master to PBR Master, and it's broken and shows just a line.
@@fangoerbayun2587 Oops! Looks like I made an editing error there. Sorry about that!
If you want outlines per object, you could check out my hull outlines: th-cam.com/video/1QPA3s0S3Oo/w-d-xo.html (Although looking at your sidenote, I don't think these would work, either)
I'm planning a video to apply edge detection outlines from this video per object, too! Should be out in a few weeks.
As for your sidenote, I haven't played around much with sprites in shader graph, so I can't give much insight. At first glance, I would check the UVs on your quad to make sure they're set up how that graph expects.
Note: Blend node needs to be in overwrite
What settings do you use on your setup? I can't get the outlines to stay when I'm away from an object even when they do look decent.
Hi! It didn't make it into this video, but the follow up ( th-cam.com/video/fW-5srSHDMc/w-d-xo.html ) has a lot of little tweaks which should help with outline stability at different zoom levels. Specifically, jump to 10:25
@@NedMakesGames Thank you, I'll try this out tomorrow. You're a legend!
Hai, Love the tutorial videos!
Have you ever tried creating a pixel perfect line in 3D? Something like the Line renderer, but pixel perfect. Drawing single pixel thick lines in the scene.
Hi, thanks!
I have done something like that using a pixel perfect camera in a low res, pixel art game. It would be an interesting challenge to get working in other settings!
Subscribed!!! These tutorials are simply AMAZING!
I have a road blocker though, in case someone could help me. I'm using Unity 2021.3.26f1 and when I get into Debug mode to change the Shader Keyword to REQUIRE_DEPTH_TEXTURE (7:43) I can't find that field :( Instead I see Valid Keywords Size and Invalid Keywords Size. Does anyone know how to pass this issue? TY!
It should either already be in valid keywords or if not add the keywords to the list. There should be one item for each keyword
really cool tutorial
Your outlines are so crisp and dark, mine are blown out and transparent. Not sure what I did wrong! (I run into this issue with other sobol tutorials too)
Outlines are really tricky! It may just take a lot of tweaking the material properties, especially the thresholds. I found depth outlines are especially difficult to get right. I make a few improvements to them in the video releasing tomorrow, so hopefully that will help!
Great tutorial and explanation! But has anyone had any luck with Unity 2021.2.13? I should say I get no errors and I've triple checked my keywords.
Hi! If you look in the frame debugger, (window -> analysis), do you see your outlines pass show up? It should be near the bottom of the window. If not, something is wrong with your renderer feature. If yes, something is wrong with your shader or material.
@@NedMakesGames Thank you so much for replying. Unfortunately I've still had no luck. The outlines pass shows up in my frame debugger so I'm going to try re-creating the material from scratch again. I have this feeling it's going to be the smallest and simplest issue when I find it.
@@NedMakesGames I've actually just found out I can see the effect of the individual outlines pass by selecting it in the fame debugger. Perhaps there's something wrong with the way I'm applying the effect to the frame. The Outlines pass has no render target as opposed to the other passes in the frame debugger.
@@naeyoo42 Hmm, that would indicate a problem with the renderer feature, I guess. Try using this blit material feature instead of the one in the video: github.com/Cyanilux/URP_BlitRenderFeature Cyanilux's has a few updates which could fix this problem.
@@NedMakesGames Thank you so much, you've just saved my project. The Blit Material Feature from the git project works perfectly!
Is _MainTex the depth texture?
No, _MainTex is the screen texture. You can access the depth texture with a Scene Depth node (or the SHADERGRAPH_SAMPLE_SCENE_DEPTH macro in HLSL code).
unfortunatly doesnt work now :/
Is this optimized???
Pls Reply
Beacuse i am having a bad pc
Half the reason I liked was because there were 665 likes. I've been using shader graph for 2d, so most of this tutorial didn't apply to me, but I skimmed it anyway.
😄 Well thank you for watching!
pls make a video showing only on specific objects not the entire screen and changing its color to maybe red idk, since alot of games have enemy ai that have red shader border on them but in Rinder Pipline its legit hard.
You can change the color of these outlines already. But I am writing a video about applying these to individual objects right now! Should be out in a few weeks
@@NedMakesGames wow! thank man I appreciate it
Can I do this with standard unity?
You mean the built in render pipeline? Outlines are possible, but you can’t use the shader graph or renderer features, so the implementation would be very different. You could use the same sobel algorithm though.
I have black screen
can anyone help??
Hi! Does your screen go black after you turn on the renderer feature? I would guess something is wrong with your shader. Feel free to post a screenshot of your graph and check you script against the references in the video description.
@@NedMakesGames thanks for your reply
I had depth texture off in the URP asset :P
@@getemratan6516 Oh that would do it! I’m glad it was a simple fix.
Supper awesome !!!!! Great
Love you!
Nice video. But what annoys me is that you click too fast, that makes me rewind the video all the time in order to see what you just clicked...
It's too fast. I cannot follow up.
Hi, thanks for the feedback. It's a difficult balancing act for me between going too fast and being too long winded. I will try to do better! Feel free to change the playback speed by clicking the gear in the borrom right corner of the video. I hope that helps a bit.
@@NedMakesGames nice 👍
is it optimized for mobile?
There are probably some optimizations to be made - I usually focus more on clarity for the tutorial's sake. That said, some old mobile devices have problems with the extra memory taken by the depth/opaque textures. I think current hardware can handle it though.
@@NedMakesGames thank you sir.
It's a shame they've overcomplicated image effect shaders so much. All you used to have to do was pass an image effect shader material to Graphics.Blit().
Yeah, I especially miss the camera rendering callbacks
Bad tutorial. It no longer works with newer unity, and the original creator doesn't care or bother to clear up a fix.
The beginning part is also confusing to what to do
Wasted time.
Hey, in the urpasset_renderer inspector there is no option to add the render feature blit material feature. Am I using the wrong version or doing something wrong? On a URP template for 2020.3.2.
Hi! The Blit renderer feature is a custom renderer feature. You can download it from the video description. Add it to your project and it should show in that list.
In newer versions the 'SHADERGRAPH_SAMPLE_SCENE_DEPTH' makes an error, but I dont know how to fix it, do you have a suggestion ?
Same issue for me :(