Outlines on One Object in Unity URP Shader Graph with Edge Detection! ✔️ 2020.3 | Game Dev Tutorial

preview_player
Показать описание
✔️ Works in 2020.1 ➕ 2020.2 ➕ 2020.3 🩹 Fixes:

Outlines are a great way to add polish and style to a variety of games! In this tutorial, I apply depth and normal outlines to single objects, allowing different outline colors. This technique also skips the post processing step, which can be a big performance boost for lightweight platforms!

👋 Subscribe for weekly game development videos!

👑 Join my Patreon for extra influence over topics, early access to videos, and downloadable project files!

🎬 Previous videos

✨Follow up videos

💬 Video transcript

📜 Required scripts

⏲️ Timestamps:
0:00 Intro
1:00 Theory
2:06 Project Setup
2:53 Outlines graph
5:49 Simple outlined shader
7:19 Outlines in unlit graphs
7:30 Outlines in lit graphs
9:35 Conflict with AO
9:57 Wrap up and credits

🎖️ Credits and references:

#GameDev #IndieDev #Unity
Рекомендации по теме
Комментарии
Автор

What an interesting technique for achieving outlines! Will be giving this a go next time I need an outline shader, A+ tutorial

astridwilde
Автор

i def needed this in more ways than one. Love your tutorials

tvoyager
Автор

Your tutorials are always awesome, waiting for this channel to blow up

vimaladit
Автор

Uff, one left to go - optimizing. I didn't even initially intended to do these in particular (I mean outlines) but they are just too well thought and presented. Thanks!

adamodimattia
Автор

Hello Ned, Amazing tutorial. For other people that use the render feature with the transparent material make the render feature process after rendering transparents instead of after Opaque or you'll get an Outline that is rendered based on Last Frame Depth. Much Love !

louisdeveze
Автор

if you apply black outlines in the diffuse node and then the corect outline color in emissive, you<ll get outlines on lit materials

mykaelboyte-coutu
Автор

Had to do a bit of extra work to get this working with my setup (URP, OpenVR+SteamVR, Unity 2019.4.18f1). In my case, the shader was working in the scene view, but not in the game view. For some reason, the depth texture wasn't enabled on my camera, even though it's enabled on the render pipeline feature. To get it to work, I had to manually set Depth Texture to Enabled on my Camera.

xzXRequestXzx
Автор

Amazing tutorials, I'm learning so much. Would there be a way to do color outlining even without the camera being ready ? For example if I'm using textures made of two color, could we do the outline color algorithm on this texture only and blend it to the other part of the shader ?

zakku_
Автор

Is there any way to make the lines look consistent between camera angles? My outline looks really good upclose, but if i pull the camera back, it starts filling in more parts of the model with black

JenerikEt
Автор

Add OutlinesInclude Scripts have a error.Undeclared line 203.idon't know what happen?Thank you are vedio.my english is bad.

zn
Автор

I got the error: "Shader error in 'Master': undeclared identifier 'DepthSobel_half' at line 269 (on d3d11)" is there a way to solve this?

GustafGJames
Автор

Hey Ned thanks for all your tutorials !

I tried this in unity 2022 and I get an error when compiling the OutlinesInclude hlsl in a custom fonction in shader graph that said I have undeclared identifier (NormalSobel_half), any ideas how to fix ?

elkandarart
Автор

I don't have "New Depth Normals Feature" in UniversalRenderPipelineAsset_Renderer, only Screen Space Ambient and Render Objects. What did I do wrong?

And how to create .hlsl file in Unity?

Kollobok
Автор

This tutorial is great, but i would really like and really need a new tutorial with this kind of outline if it is possible to be improved, like the visibility of the outlines from the interior in some angles or the clear visibility of small objects from distance etc.

PhoenixFireRo
Автор

Works like a charm, thank you!
However, is there any way to make the base colour transparent? I tried changing the final graph to use alpha, but that seems to remove most of the outlines.

andiburki
Автор

I have some trouble with the front edges not showing up but I'm pretty sure it has nothing to do with the graphs themselves. Any idea where my problem could lie? Aside from that everything looks fine but anything normal related doesn't do anything

luciany
Автор

Hello, Ned. This isn't quite what I'm looking for, unfortunately =/ I have a randomly generated mesh for terrain. This terrain is 99% rock and I want to follow the edge with grass. There's other ways I could go about it, but I was wondering if you knew of any way to do this with shader graph. I was able to make a shader graph with both elements, but they tile horizontally and the grass does not follow the edge. Thanks!

bagboybrown
Автор

Running into some trouble getting this to work in my hdrp project. I'm getting the error that unity_CameraProjection in OutlinesInclude.hlsl isn't declared... New to hlsl files, but isn't that a built-in unity shader graph variable? Including UnityShaderVariables.cginc isn't fixing it either

thetotorotree
Автор

Thanks for the tutorial. I've been trying to follow along but my shapes are just the solid colour of my outline. Tweaking the thickness doesn't appear to be helping. Any thoughts of the top of your head?

pseudobardic
Автор

I'm trying to get these outlines on objects that are transparent but as soon as I set "Surface Type" to "Transparent" the outlines stop appearing no matter what inputs I try—also the outline layers flow works for me but as soon as I add transparency to the lit shader it stops rendering the outlines. Any ideas why this is happening? Otherwise I'll just hope you continue this series with a transparent outline video like you mentioned in another comment—thanks for the great tutorial!

michaelturenne
welcome to shbcf.ru