Toon Outlines in Unity URP, Shader Graph Using Sobel Edge Detection! ️ 2020.3 | Game Dev Tutorial

Toon Outlines in Unity URP, Shader Graph Using Sobel Edge Detection! ️ 2020.3 | Game Dev Tutorial

Ned Makes Games

3 года назад

64,448 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Navi
Navi - 01.10.2023 04:50

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?

Ответить
Autism Bros. Official
Autism Bros. Official - 21.07.2023 17:01

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!

Ответить
Rohan Patel
Rohan Patel - 15.06.2023 00:36

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:)

Ответить
Devels.
Devels. - 07.06.2023 02:41

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

Ответить
Mira
Mira - 21.05.2023 03:01

unfortunatly doesnt work now :/

Ответить
Shadestyle Diabouros
Shadestyle Diabouros - 19.05.2023 05:49

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).

Ответить
David Gil
David Gil - 02.05.2023 06:11

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 :)

Ответить
Viva-La-Baz
Viva-La-Baz - 18.04.2023 12:39

This doesn't work with 2021.3? Followed the tutorial to the T, but no outlines show up.

Ответить
Pyeco
Pyeco - 07.01.2023 20:43

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

Ответить
SooiV
SooiV - 13.11.2022 05:17

This tutorial helped me a lot in my game development.

Ответить
Chance McLaren
Chance McLaren - 07.11.2022 18:30

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!

Ответить
Stefan Videv
Stefan Videv - 07.11.2022 00:52

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.

Ответить
NPCs
NPCs - 25.10.2022 06:09

Works in 2021.3.11f1
Thank you so much !
It works very well with any low poly models.

Ответить
H2G Kursus Online.
H2G Kursus Online. - 19.10.2022 21:32

Using Unity 2021.3.11f1, the shader keywords text box cant be found in the debug window :(

Ответить
Dat Nade
Dat Nade - 01.10.2022 17:19

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

Ответить
Drogan
Drogan - 06.09.2022 03:06

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

Ответить
Studio Kuketo
Studio Kuketo - 15.08.2022 23:36

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!

Ответить
Shadestyle Diabouros
Shadestyle Diabouros - 30.07.2022 05:24

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.

Ответить
Boogun
Boogun - 25.07.2022 16:12

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

Ответить
Pedro PC
Pedro PC - 11.07.2022 23:32

This method works with models with rigidbody component? Others outline shaders that i have tested don't work on models with rigidbody component

Ответить
BananAzzplit
BananAzzplit - 08.07.2022 20:14

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 ?

Ответить
David
David - 22.06.2022 12:01

OMG, so cool! Going to try this

Ответить
Zach Evans
Zach Evans - 09.06.2022 03:19

For anyone trying this in newer Unity Versions: You have to replace the "UV" Node in the shader graph with the "Screen Position" Node.

Ответить
Downstream01
Downstream01 - 21.05.2022 11:47

So how would I avoid the color effect on the skybox?

Ответить
Downstream01
Downstream01 - 18.05.2022 13:28

Note: Blend node needs to be in overwrite

Ответить
Jules
Jules - 12.05.2022 03:03

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.

Ответить
Lars Maas Animaties
Lars Maas Animaties - 30.04.2022 12:15

it doesnt work for me. it just shows big black vertical lines across the screen

Ответить
Robin
Robin - 13.04.2022 04:30

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.

Ответить
Blazertron
Blazertron - 15.03.2022 00:53

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().

Ответить
Naeyoo
Naeyoo - 03.03.2022 20:34

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.

Ответить
Brian Craig
Brian Craig - 21.02.2022 23:25

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.

Ответить
Greg Galloway
Greg Galloway - 11.02.2022 19:34

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.

Ответить
Dimitri Show
Dimitri Show - 28.12.2021 06:35

finally !! ty ive beeen looking for something like this 4 ever

Ответить
Lucy Boyd-Wilson
Lucy Boyd-Wilson - 20.12.2021 21:18

Great tutorial! Thanks so much!

Ответить
Nitricswight
Nitricswight - 10.12.2021 00:38

hi, I believe I followed every step perfectly but While the material is changing in preview, nothing changes in the game view. Also my material has strange lines going up and down it, almost like a tennis ball texture. Any help is really appreciated!

Ответить
EdgedPixie
EdgedPixie - 01.11.2021 15:03

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.

Ответить
Smash-ter
Smash-ter - 18.10.2021 20:18

Is this possible to replicate for the built in render pipeline and for unity 2019.

Ответить
InsertUsername
InsertUsername - 16.10.2021 02:20

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! :)

Ответить
Getem Ratan
Getem Ratan - 05.10.2021 09:22

I have black screen
can anyone help??

Ответить
Ectho Art
Ectho Art - 03.10.2021 08:17

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?

Ответить
Yesir
Yesir - 26.08.2021 19:57

Great Tutorial Ned!

Ответить
Acidic
Acidic - 16.08.2021 07:03

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.

Ответить
Capybara Capybara
Capybara Capybara - 13.08.2021 16:02

Mine just comes out solid white...

Ответить
Dom O
Dom O - 10.08.2021 19:47

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

Ответить
Ben Smith
Ben Smith - 21.07.2021 16:09

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

Ответить