Show a Silhouette When Hidden Using URP Renderer Features (Unity Tutorial)

  Рет қаралды 31,480

Ketra Games

Ketra Games

Күн бұрын

In this Unity game development tutorial we're going to look at how we can use URP Renderer Features to create a silhouette of a character when they're hidden by an obstacle.
We'll start looking at how to remove the rendering of the character completely by assigning it to a layer and removing this layer from the renderer.
Then we'll add two render passes to draw the character.
The first will use a flat material to draw a silhouette for parts of the character that are hidden.
The second will draw the character using the original material for parts that are not hidden.
The project files are available to our patrons here:
► / 55160321
Want to follow along? This project is a good starting point
► / 49571039
Help support our work:
► Patreon: / ketragames
► Ko-fi: ko-fi.com/ketragames
Follow us:
► Ketra Games: www.ketra-games.com
► Patreon: / ketragames
► Twitter: / ketragames
► Facebook: / ketragames
Introduction - 0:00
Creating a material for the silhouette - 0:38
Explanation of Renderer Features - 1:13
Removing the character from the renderer - 1:37
Drawing the silhouette - 2:14
Drawing the rest of the character - 3:34
Summary - 04:00
#KetraGames #LearnUnity #UnityTutorials #UnityTips

Пікірлер: 128
@KetraGames
@KetraGames 2 жыл бұрын
Thanks so much for watching the video. Please feel free to ask any questions in the comments. Also, we'd love to know what other uses for Renderer Features you've found. Thanks again 😊
@Gorbba6632
@Gorbba6632 10 күн бұрын
thank you, this is the best and easiest solution I have found after hours of looking
@MrEljue
@MrEljue Жыл бұрын
Incredible! Looking at tutorials how to make this, it seemed so hard, and in only 5 mins I had it implemented following this tutorial. Also, love the clarity of how everything is explained, very professional
@Chrriiisss945
@Chrriiisss945 2 жыл бұрын
This was a super useful tutorial, completely nailed what I was trying to do, thank you so much!
@KetraGames
@KetraGames 2 жыл бұрын
Great, thanks for this comment 😊
@fredericfox6123
@fredericfox6123 Жыл бұрын
OMG thank you so much, I used this concept for a totally different purpose, but your video was my saviour after 3 days of constant search for a solution! Thank you so much.
@KetraGames
@KetraGames Жыл бұрын
Great, so glad it was useful 😊
@Sycoinc
@Sycoinc 2 жыл бұрын
This is exactly what i was looking for about a week ago and it so simple
@KetraGames
@KetraGames 2 жыл бұрын
Glad to hear this 👍
@Massive-3D
@Massive-3D Жыл бұрын
I've been subscribed for five years!
@Wanderlust_Duo
@Wanderlust_Duo Жыл бұрын
OMG, that's awesome)) I suffered with shader writing )) but it was so easy ) Thank you!
@marcoszanre
@marcoszanre Жыл бұрын
Amazing tutorial, as always! Thank you! 👏👏👏
@KetraGames
@KetraGames Жыл бұрын
Thanks for your support 😊
@ChadGatling
@ChadGatling 2 жыл бұрын
Thank you for a simple video that actually shows the concept and not just copy this code or buy this asset.
@KetraGames
@KetraGames 2 жыл бұрын
Glad it was useful 😊
@Ghillie
@Ghillie Жыл бұрын
Thank you so much this took way too long to figure out and this video make it so much easier to get the effect i wanted.
@KetraGames
@KetraGames Жыл бұрын
Great to hear, thanks 😊
@meglin13
@meglin13 Жыл бұрын
Thank you very much for the tutorial! It really helped out! Love your videos!💚
@KetraGames
@KetraGames Жыл бұрын
Great to hear, thank you 😊
@16rosati
@16rosati 2 жыл бұрын
Thats awesome and well explained, thank you!
@KetraGames
@KetraGames 2 жыл бұрын
Thanks for this comment 😊
@radiocage
@radiocage Жыл бұрын
Thank you, this is hugely important to my project and I was about to be at my wits end trying to figure out the solution
@KetraGames
@KetraGames Жыл бұрын
Really glad to hear it was helpful 😊
@Manas-co8wl
@Manas-co8wl 2 жыл бұрын
Thanks this is a good starting point
@zekiozdemir420
@zekiozdemir420 2 жыл бұрын
nice, quick and simple tutorials thanks
@KetraGames
@KetraGames 2 жыл бұрын
Thanks for this comment 😊
@weckar
@weckar 2 жыл бұрын
The idea of render passes is so useful. Myself I'm trying to create orbcutting by the same means.
@joyoussuccess
@joyoussuccess 2 жыл бұрын
thank you very much!!! i had solution for this in built-in, but i need URP, this got it for me thank you very much!
@KetraGames
@KetraGames 2 жыл бұрын
Great, glad to hear this 😊
@jadonut249
@jadonut249 2 жыл бұрын
Thank you for this video! Greatly appreciated :)
@KetraGames
@KetraGames 2 жыл бұрын
👍🏻😊
@adityahoon6824
@adityahoon6824 7 күн бұрын
Thanks for the help!
@anthonymorales2915
@anthonymorales2915 2 жыл бұрын
thank you i had created my first unity character motion and lanscape using your tutorial
@KetraGames
@KetraGames 2 жыл бұрын
Great to hear 😊
@believer5375
@believer5375 2 жыл бұрын
Cool tutorial! Thank you!
@KetraGames
@KetraGames 2 жыл бұрын
Thanks for this comment 😊
@allanramos6855
@allanramos6855 2 жыл бұрын
Nice video! Helped me a lot
@KetraGames
@KetraGames 2 жыл бұрын
Glad it was useful 😊
@DeathSong9403
@DeathSong9403 Жыл бұрын
Masterful !
@misal-isahabe5281
@misal-isahabe5281 2 жыл бұрын
Thanks was so good tutorial!
@KetraGames
@KetraGames 2 жыл бұрын
Thanks for this comment 😊
@trachinusdraco
@trachinusdraco 2 жыл бұрын
Thank you. Really simple process to follow {3
@KetraGames
@KetraGames 2 жыл бұрын
Great to hear 😊
@dabyain
@dabyain 2 жыл бұрын
Thank You Very Much , You saved My life !
@KetraGames
@KetraGames 2 жыл бұрын
Thanks for this comment 😊
@alexxosborne5051
@alexxosborne5051 2 жыл бұрын
Thank you!!!
@KetraGames
@KetraGames 2 жыл бұрын
👍😊
@ronpepmeyer812
@ronpepmeyer812 4 ай бұрын
If used with SSAO, you'll want to check "After Opaque" for the SSAO or you'll get the SSAO of what's *behind* your player applied *to* your player.
@stefan429
@stefan429 2 жыл бұрын
i didnt realize URP had these extra features, this is a great alternative to shaders
@KetraGames
@KetraGames 2 жыл бұрын
G;ad you found the video useful 😊
@user-nk9dr8kw3i
@user-nk9dr8kw3i 6 ай бұрын
Thank You😊
@KetraGames
@KetraGames 5 ай бұрын
👍😊
@4rtochka
@4rtochka 2 жыл бұрын
Thank you is very cool advise
@KetraGames
@KetraGames 2 жыл бұрын
👍😊
@docuke9525
@docuke9525 2 жыл бұрын
Thank you
@KetraGames
@KetraGames 2 жыл бұрын
👍😊
@dont_smoke_here1188
@dont_smoke_here1188 Жыл бұрын
amazing, thank you
@KetraGames
@KetraGames Жыл бұрын
Thanks very much for this comment 😊😊
@stylie473joker5
@stylie473joker5 2 жыл бұрын
You can even make a cool looking material with shader graph and use it as silhouette thanks for the awesome video
@KetraGames
@KetraGames 2 жыл бұрын
Thanks for this comment 😊
@optimalstate3190
@optimalstate3190 2 жыл бұрын
That's clever!
@KetraGames
@KetraGames 2 жыл бұрын
👍😊
@user-yl9cl8cs4x
@user-yl9cl8cs4x Жыл бұрын
Thanks for your video. Please make a course for Invisibility of all objects between player and camera
@steeltm521
@steeltm521 2 жыл бұрын
Hello again! As always, love your videos, it really helps me learning Unity. I have a question: can you make a tutorial about ground alignment (like in Sonic games, when character normal matches ground normal) with your character controller from previous videos? That would be amazing.
@KetraGames
@KetraGames 2 жыл бұрын
Hi, this is quite a popular request so definitely something we'll look to cover in the future. We'll have to move away from the Character Controller and use a Rigidbody for this as the Character Controller is designed to always be upright. Are you interested in this for a 2D/2.5D game like traditional Sonic or a full 3D game?
@steeltm521
@steeltm521 2 жыл бұрын
@@KetraGames Thanks a lot for answering! No pushing, only if you want to do this tutorial. For 3D, and early Sonic games like Heroes or Adventure, nothing too complicated.
@ronkh7560
@ronkh7560 Жыл бұрын
Hello there! Thanks for the tutorial and the whole channel content. It's brilliant and so useful in bunch of cases. Love it :) A small question here, cant handle it by myself - Can I reach same effect for the surface wich is not opaque but transpanent with alpha channel set to 1? I mean the surface seems opaque but it's transparent. Tried reading docs and playing with settings - no result. Glad if u have an advice for my case. Thank ya and best of luck :)
@albertobalsera2259
@albertobalsera2259 Жыл бұрын
I have the same problem. Surely it can be done by changing the order in which it is executed but I can't find the correct order
@qasimahamad5075
@qasimahamad5075 2 жыл бұрын
WOW
@johanb7314
@johanb7314 Жыл бұрын
Hi, really great and interesting video. Very nice for some games. Is there also a quick URP way to do the opposite: making the objects between camera and player transparant instead of using the silhouette of te player?
@KetraGames
@KetraGames Жыл бұрын
Hi, sorry I'm not aware of any quick tricks to do this. Let us know if you find a way.
@oozcroom
@oozcroom 2 жыл бұрын
Amazing video it works great thank you! I'm wondering if there's a way to exclude certain layers from being affected by the silhouette material though? I want the effect happening only when going behind specific objects
@oozcroom
@oozcroom 2 жыл бұрын
Actually i just realized by adding the layer you want unaffected to the render feature it fixes it!
@KetraGames
@KetraGames 2 жыл бұрын
Glad you found a solution. Thanks for sharing 😊
@youssefderbel3435
@youssefderbel3435 2 жыл бұрын
hi friend , I tried same solution but when I put the see through obstacle in front of blocking obstacle , the object stay visible . do you have solution for that ?
@miaan9374
@miaan9374 2 жыл бұрын
ThanksThank you beautiful 😘
@KetraGames
@KetraGames 2 жыл бұрын
👍😊
@weckar
@weckar 2 жыл бұрын
Silly question - why do we cull the visible player rendering from the main render at all if we are just going to just re-add it? I am not noticing any real difference with just leaving it visible instead? EDIT: I see, it is to prevent shinethrough with the self :)
@thanhatnguyen8137
@thanhatnguyen8137 Жыл бұрын
After follow this tutorial, my model be transparent, i choose on step filtering Opaque Layer mask : Everything. It's work.
@rubpty
@rubpty Жыл бұрын
This is very easy for 3D games. What about for 2D games using URP?
@watercat1248
@watercat1248 Жыл бұрын
ok cool but is ther eny way to make this hiden and unhined to wean the object is behind off spfic objects ?
@Brainyplanet
@Brainyplanet Жыл бұрын
Is this mobile friendly? Does it works fine for low end devices?
@DonDisainer
@DonDisainer 11 ай бұрын
love this tut, but i changed to hdrp, no idea how to do this again!!! help :c
@AssassinateThisEzio
@AssassinateThisEzio 2 жыл бұрын
Hey, for some reason I have a UI Camera just rendering black once I add a feature. Any idea what might be causing this? Thanks.
@ani-gamer320
@ani-gamer320 2 жыл бұрын
Hello Ketra can u please make tutorial on saving image with the help of playerprefs or something else like saving help panel if closed don't show again ❤️❤️👍🏻
@KetraGames
@KetraGames 2 жыл бұрын
Hi, thanks for the suggestion. We definitely have saving and loading game data on the list of future videos.
@Fran-vt9zf
@Fran-vt9zf Жыл бұрын
Hi, when i add the player to the player layer, it doesnt remove from the renderer
@pushingpandas6479
@pushingpandas6479 2 жыл бұрын
will that work with 2d?
@brmgranado
@brmgranado Жыл бұрын
Hi, thanks for the video. Is there any way to do this with transparent walls? It would be very useful. won a subscriber 😊
@KetraGames
@KetraGames Жыл бұрын
Hi, sorry, we've had a play and can't find an easy way to achieve this for transparent walls using the Renderer features. Let us know if you find a way.
@kencessna
@kencessna Жыл бұрын
Hi Bruno, did you find a way for transparent walls=
@Somiaz
@Somiaz 4 ай бұрын
How would I avoid this effect if my player goes behind a semi transparent object?
@maheshnainar8576
@maheshnainar8576 2 жыл бұрын
This works well for obstacles but it doesn't work on particle effects. Is there any other way to show player when player is in particle effect?
@KetraGames
@KetraGames 2 жыл бұрын
Hi, sorry I'm not sure. Have you tried VFX Graph for the particles?
@bradleysmith1839
@bradleysmith1839 2 жыл бұрын
Will this work with sprites against sprites?
@jorrizopnda
@jorrizopnda 2 жыл бұрын
still searching a solution for sprite
@halfbakedc00kie
@halfbakedc00kie Жыл бұрын
Is there a way to make this work with sprites? They don't become invisible when removed from the opaque layers of the render pipeline
@unclefeather22
@unclefeather22 Жыл бұрын
try removing the player from the transparent layer mask (just below the opaque layer mask), and in the Render Objects Override, where it says Queue, select Transparent instead of Opaque
@rib_rob_personal
@rib_rob_personal 2 жыл бұрын
Hey there! I'm doing this in a 3D game where the character is depicted with a sprite renderer. When walking to the right, the sprite render flips on the X axis, but the silhouette won't show when it's flipped. Any ideas on how to fix this? I imagine it's not too complicated but idk what to change to fix this.
@KetraGames
@KetraGames 2 жыл бұрын
Hi, I think it may be because the shader is not set to render both sides. This forum post should hopefully help point you in the right direction - stackoverflow.com/questions/60192970/double-sided-shader-with-shader-graph
@Nirikin
@Nirikin 3 ай бұрын
Does anyone know if there is a way to achieve this effect on Roblox? Having issues with it rn
@1001Bastiano
@1001Bastiano Жыл бұрын
I followed this and it worked perfectly, but then when I went to a different scene, for some reason the player is now invisible the whole time.. I have double checked any everything appears to look the same, with the player being on the correct layer etc but I cannot get it to work, any thoughts?
@stylie473joker5
@stylie473joker5 6 ай бұрын
Did you find a solution ?
@Computerarts100
@Computerarts100 Жыл бұрын
A cool real game example of this effect would be Valorant. Next time, when you jump into a Valorant game, pay good attention to your teammates when you are not able to see them directly.
@user-os6jd8ju7v
@user-os6jd8ju7v 8 ай бұрын
but this not working in android build working in unity
@Bouffeur2Q
@Bouffeur2Q Жыл бұрын
Hi, I'm working with 2D asset, when I remove the layer "Player" from opaque layer mask, my asset is still visible in the scene, is it normal? Thanks a lot for the video!
@KetraGames
@KetraGames Жыл бұрын
Hi, I've not tried it with a 2d asset. Have you set the layer of the object to the Player layer?
@MohanABK
@MohanABK Жыл бұрын
Is there a way to apply the "hidden" material only on certain walls? In my game, there's like small rocks and grass everywhere, and the player's legs are being rendered "hidden" behind the littlest of things. I only want it to do the hidden thing if it's behind tall walls that I can set.
@KetraGames
@KetraGames Жыл бұрын
Hi, you should be able to do this with Layers. If you add all the little things to their own layer, you can exclude this layer when rendering the "hidden" version of the character. You just need to remove the layer from the Opaque Layer Mask. Hope that helps 😊
@user-uq5li3wc4y
@user-uq5li3wc4y 2 ай бұрын
@@KetraGames Suppose I want the 'NOTHIDE' layer to hide the player. Could you please provide a detailed explanation of what I need to do? How can I exclude this layer when rendering the "hidden" version of the character?
@serkanyilmazyesil
@serkanyilmazyesil Жыл бұрын
When I get Build and try it on the phone, I can't see the effect. What setting should I do?
@serkanyilmazyesil
@serkanyilmazyesil Жыл бұрын
I solved my problem by choosing high quality in quality settings. But the performance on the phone has dropped unbelievably.
@milkyywayyyy259
@milkyywayyyy259 28 күн бұрын
Why doesn't this work in WebGL builds?
@matthewbergman6803
@matthewbergman6803 Жыл бұрын
Can you do this in the current non URP version of Unity?
@KetraGames
@KetraGames Жыл бұрын
Hi, sorry not as far as I know
@personmuc943
@personmuc943 Жыл бұрын
Is it possible to do this in Shader Graph instead? What nodes can do it?
@KetraGames
@KetraGames Жыл бұрын
Hi, something similar could probably be created in Shader Graph but not sure which nodes you would need to use. Sorry 😊
@personmuc943
@personmuc943 Жыл бұрын
@@KetraGames Thank you for the response! After so many hours of researching, finally I found a way to create the effect, here it is. - First you need to create a 'Position' node and change its space to 'view' and output it to the 'Split' node, Drag the 'B' from the split node and drop it to the 'Negate' node, Set the outputs of both the 'Negate' and the 'Scene Depth' nodes to a 'Comparison' node, Set the 'Scene Depth' sampling to 'Eye', And set the 'Comparison' to 'Less or Equal', Now link the Comparison output to a 'Branch' node, Create two different colors and link them to the True and False values of the Branch, Now link your branch's output to the fragment's base color, Now go to the Graph inspector and click 'Graph Settings' and change the Depth Test to 'Always', This works for me!
@KetraGames
@KetraGames Жыл бұрын
Glad you worked it out, and thanks for sharing your solution 😊
@Ghillie
@Ghillie Жыл бұрын
I seem to have found an issue with this method, when the wall has a material of surface type "Transparent" the effect stops working, do you know a way around this?
@KetraGames
@KetraGames Жыл бұрын
Hi, you're correct. Unfortunately I've not found a solution to this 😞
@Ghillie
@Ghillie Жыл бұрын
@@KetraGames no worries thank you
@Brainyplanet
@Brainyplanet Жыл бұрын
​@@Ghillie do you find any solution to it
@cutesnitch1156
@cutesnitch1156 4 ай бұрын
I followed this, but now my character is completely invisible when I hit Play? He's visible in the editing scene.... *confused*
@cutesnitch1156
@cutesnitch1156 4 ай бұрын
Turns out I hadn't ticked 'Player' in the Camera's culling mask.
@adalutegames
@adalutegames 2 жыл бұрын
Is there a 2d equivalent to this?
@KetraGames
@KetraGames 2 жыл бұрын
Hi, Sorry I'm not aware of a 2D equivalent
How to use Animation Transitions (Unity Tutorial)
9:59
Ketra Games
Рет қаралды 171 М.
Fade Objects with C# and the Standard URP Shaders | Unity Tutorial
20:30
Дарю Самокат Скейтеру !
00:42
Vlad Samokatchik
Рет қаралды 7 МЛН
Nutella bro sis family Challenge 😋
00:31
Mr. Clabik
Рет қаралды 13 МЛН
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 62 МЛН
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27
I Made a Graphics Engine
6:42
Zyger
Рет қаралды 244 М.
12 Principles of Animation (Official Full Series)
24:03
AlanBeckerTutorials
Рет қаралды 13 МЛН
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 4,2 МЛН
An Aseprite Crash Course In 30 Minutes
31:47
AdamCYounis
Рет қаралды 1 МЛН
What size should your assets be? | HD 2D GAME ART
12:10
Nonsensical 2D
Рет қаралды 111 М.
Unity Grenade Mechanic
4:02
Colton Spruill
Рет қаралды 15
Unity Layers, Layer Mask, Bitmask, Bitwise Operators, Raycasts
14:26
Дарю Самокат Скейтеру !
00:42
Vlad Samokatchik
Рет қаралды 7 МЛН