Decals in URP & HDRP | Unity Tutorial

  Рет қаралды 36,939

LlamAcademy

LlamAcademy

Күн бұрын

New in 2021! URP (URP12) supports a Decal Projector much like HDRP has had since HDRP6!
🚨 Starting with Unity 2022.1 / URP14 Render Layers are supported! docs.unity3d.com/Packages/com...
Many of us who aren't super comfortable writing our own shaders relied on 3rd party tools for decal projections or went with simple quads for decals. As of Unity 2021, URP now has a Decal Projector much like HDRP has had for a while. It's not perfect, but it's a big improvement over the quad-based decal systems I've implemented before. I'm hopeful the URP one continues to get improvements as new URP and Unity releases come out.
In this tutorial I'll show how to enable decals in URP, review all the configuration options in the render asset and what they do, and go over what all the decal projector options do. We'll do the same again for HDRP so you have an informed starting point for adding decals into your game regardless if you're using URP or HDRP.
Unfortunately, the Built-in render pipeline still doesn't support them without custom shaders, so you'll have to write your own or use a 3rd party solution to get a similar result over there.
💸 Ongoing sales 💸
⚫ See all active asset sales on the Asset Store: assetstore.unity.com/?on_sale...
⚫ Save 25% off your first Asset Store Order: prf.hn/click/camref:1101l9QvC...
⚫ Save up to 50% on NEW Assets: assetstore.unity.com/?new_sal...
👨‍💻 As always, all code from this video is available on GitHub:
⚫ URP: github.com/llamacademy/urp-de...
⚫ HDRP: github.com/llamacademy/hdrp-d...
❤ Believe in LlamAcademy's mission and have received value from the videos? Become a Patreon Supporter or KZfaq Member:
⚫ Patreon: / llamacademy
⚫ KZfaq Member: / @llamacademy or click the Join button on any video
📚 Resources 📚
⚫ Decal Rendering in URP 12: docs.unity3d.com/Packages/com...
⚫ Decal Shader in URP12: docs.unity3d.com/Packages/com...
⚫ Decal Projector in HDRP: docs.unity3d.com/Packages/com...
⚫ Decal Shader in HDRP: docs.unity3d.com/Packages/com...
----
Most tutorials come from knowledge gained making survival.llama.software Llama Survival - a top-down zombie survival shooter for Android and iOS.
I also have some Unity Assets (affiliate link): assetstore.unity.com/publishe...
Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.
#unitytutorial #tutorialtuesday #gamedev #tutorial #unity #llamacademy #gamedevelopment #decal #urp #hdrp
Chapters:
00:00 Topic Introduction
01:56 Enabling URP Decals
02:37 URP Decal Configuration Overview
04:26 URP Decal Projector Overview
06:06 URP - The "Shader Graphs/Decal" Shader
07:37 URP Decal Performance & Batching
08:31 Enabling Decals in HDRP & Configuration Overview
09:06 The HDRP/Decal Shader
10:33 HDRP Decal Projector Overview
11:31 HDRP Decal Performance & Batching
11:51 HDRP Decal Projector Bonus Feature
12:57 Final Thoughtsrr

Пікірлер: 61
@crispycube_
@crispycube_ Жыл бұрын
Hey! I'm pretty late to this video, but I wanted to drop in to say that there's an easy fix to the normals problem in URP seen at 6:32. All you have to do is go into the decal shader's graph and switch the "Type" on the normal map's Sample Texture 2D Node from "Default" to "Normal". No idea why this isn't set correctly by default but that'll solve the dark box issue.
@LlamAcademy
@LlamAcademy Жыл бұрын
That is awesome! Thank you for sharing that!
@haochen4826
@haochen4826 Жыл бұрын
How unity make mistakes like this?
@dermaniac5205
@dermaniac5205 Жыл бұрын
Oh my god, that was exactly what I was looking for. What a massive oversight by Unity!
@dreamisover9813
@dreamisover9813 2 жыл бұрын
Thanks for the overview! Your tutorials are really good
@LlamAcademy
@LlamAcademy Жыл бұрын
Starting with Unity 2022.1 / URP14 Render Layers are supported by the Decal Projector: docs.unity3d.com/Packages/com.unity.render-pipelines.universal@14.0/manual/renderer-feature-decal.html which adds the ability to only include/exclude specific layers from the decal projection! This was a big gap on the URP side I’m excited to see supported relatively quickly!
@raventhc8847
@raventhc8847 10 ай бұрын
This is still bugged though. Once you activate the specific layer projection, decal start to disappear.
@durvids474
@durvids474 2 жыл бұрын
Great stuff, thank you for taking the time to post these!
@LlamAcademy
@LlamAcademy 2 жыл бұрын
You’re welcome! 🙌 I really enjoyed this one
@Sylfa
@Sylfa Жыл бұрын
There's a neat undocumented feature of the decal projector, if you use the material it uses on your own geometry you can have it project a wrapped texture. For instance, you can use a cylinder to project an overlay around a pillar, such as adding a decorative ring.
@vasiliysmirnov3922
@vasiliysmirnov3922 4 ай бұрын
3:11 Exactly what I looked for to make projected texture unlit -> DBuffer -> Albedo, ty.
@thepolygonpilgrimage
@thepolygonpilgrimage 2 жыл бұрын
Awesome work sir! Keep it up. Very helpful for many current projects :)
@pourmydrank
@pourmydrank 2 жыл бұрын
I saw a video on Unity’s channel showcasing this in HDRP and at the time it wasn’t in URP yet so thanks for making this video
@LlamAcademy
@LlamAcademy 2 жыл бұрын
You’re welcome! I was excited to see it come out for URP and had some applicable use cases for my game so I thought I’d share it!
@JakeMcNeal
@JakeMcNeal 2 жыл бұрын
Fantastic! Answered every one of my questions and more
@LlamAcademy
@LlamAcademy 2 жыл бұрын
Great to hear!
@vandermunnik
@vandermunnik Жыл бұрын
Amazing! Thanks for sharing!
@nukidoki4966
@nukidoki4966 2 жыл бұрын
Hey I love how detailed your Tutorials are and the general way you talk about problems you encounter and how you solve them ! Your AI series has helped me a lot understanding how the NavMesh works. If you need any Topics for the Series my Ideas/current thoughts would be: -How to get multiple NavmeshAgents to move over the Same NavMeshLink at the same time (like a zombie horde jumping all down a container at the same time) or: -How to display the curve of the NavMeshLink in the Scene Editor with beginning, end and the link curve. Anyways your videos are awesome!
@LlamAcademy
@LlamAcademy 2 жыл бұрын
Hey Nuki, thank you for those kind words and the topic suggestions! For the first one, the built in NavMesh does not support having multiple agents traversing the same link at the same time unfortunately. The best you can do is to set up multiple links with a small width next to one another to give multiple agents the opportunity to jump next to one another. For the second topic, I’ll add it to the list of topics. That sounds cool 😁.
@CaptainBlackSea
@CaptainBlackSea Ай бұрын
thank you
@poobagification
@poobagification 2 жыл бұрын
I have looked for this before and I guess URP just didn't have it at the time. Great to see it's here now and how to use it. Also, I think you've made it big or something. KZfaq showed 3 ads on your video. 😂
@LlamAcademy
@LlamAcademy 2 жыл бұрын
I guess so! Sometimes that happens to me too when I’m watching them
@cargorunner9960
@cargorunner9960 5 ай бұрын
Thanks
@LlamAcademy
@LlamAcademy 5 ай бұрын
Welcome 🙂
@Resolute115
@Resolute115 2 жыл бұрын
Thanks for sharing! What are the similar solutions for the Built-in RP? Decal Projector is not available here.
@LlamAcademy
@LlamAcademy 2 жыл бұрын
Unfortunately there’s no out of the box solution provided by Unity. For built in the only options are to make your own shaders & components, or purchase one like Easy Decal from the asset store
@ronigleydsonvilasnovas8067
@ronigleydsonvilasnovas8067 2 жыл бұрын
I would love that someday we could add decals in Skining mesh maybe to create wounds on enemies, even if it cost us a little more performance, the only solution I have to do this is to use ragdoll colliders to position the decals, isn't it perfect, but if adjusted well, it's not bad.
@LlamAcademy
@LlamAcademy 2 жыл бұрын
I think for that you need some shader magic to dynamically add those decals within the Material that is rendering your Skinned mesh. Otherwise I think the solution you mentioned is the best we can do. Come to think of it, I think the team making Star Citizen outlined how they do damage on their ships which might be an interesting read for figuring out how to apply a similar thing to skinned meshes. They just have the added complexity of moving and needing semi-accurate colliders to tell where you should apply that damage.
@ronigleydsonvilasnovas8067
@ronigleydsonvilasnovas8067 2 жыл бұрын
I will definitely look into Star Citizen. As for Shaders, they can be a great solution, they are capable of doing amazing things. Thank you for the tips.
@P0Omah
@P0Omah 2 жыл бұрын
Is there a simple way to tweak the renderer feature in URP to be able to exclude certain layers from having decals applied to them?
@LlamAcademy
@LlamAcademy 2 жыл бұрын
I’m not sure. I’ll have to get back to you as I integrate it into my game
@haxic
@haxic Жыл бұрын
How do I turn on "Angle Fade"? It says "In ShaderGraph enable Angle Fade option.", but whatever option that is doesn't exist.
@DaveyGame
@DaveyGame Жыл бұрын
for me when i have the Decal renderer added in the renderer data and add a projecter it says "No renderer Has a Decal renderer Feature added." What is going on????
@dcry1003
@dcry1003 Жыл бұрын
can i ask what if theres no decal option? im using unity 2020.3.19 and after using the URP template i still cant see where the decal option is on the settings folder, do i need to like enable something on the project settings?
@LlamAcademy
@LlamAcademy Жыл бұрын
The Decal Projector is only supported in Unity 2021+ / URP12+
@ivankubal6935
@ivankubal6935 2 жыл бұрын
Hello, great video as always! I am struggling with enabling the Decal layers in HDRP thouhg. I have enable Decal Layers in HDRP Asset settings and as well in project setting under Frame - Camera. Both enabled. Yet the Decal Layer Drop Down menu on Decal Projector is still grey saying that I need to enable that in hdrp asset settings. Did this happen to anyone?
@LlamAcademy
@LlamAcademy 2 жыл бұрын
Maybe in your project settings you have not told it to use the correct HDRP render pipeline asset? I had that happen because I was editing the wrong URP/HDRP asset.
@ivankubal6935
@ivankubal6935 2 жыл бұрын
@@LlamAcademy You are the man! Thank you! It shows up the HDRP asset wasnt used at all! The slot in project settings was empty! That explains a lot. Now everything is working :) Live saver! Thank you.
@LlamAcademy
@LlamAcademy 2 жыл бұрын
😅 I spent a fair amount of time with the same problem when I was working on this one! Glad it’s working now!
@ivankubal6935
@ivankubal6935 2 жыл бұрын
@@LlamAcademy I can imagine :D I was ripping my hair out for the past two days.
@CoderMedia
@CoderMedia 4 ай бұрын
Works with Built-in RP?
@random_precision_software
@random_precision_software Жыл бұрын
Ill loking to put a decal on a water shader from the U Store.. but cant fiqure it out lol any ideas?
@LlamAcademy
@LlamAcademy Жыл бұрын
Hmm.....Water shaders can be tricky because they are doing a lot of rendering manipulation. I don't know the ins and outs of them well enough to give too much insight. My approach to figure it out... would be to learn what's going on in the water shader, and how the Decal Projector shader works, and see where the incompatibility is 😨. Kind of defeats the purpose of buying a water shader since you had to learn everything it's doing
@random_precision_software
@random_precision_software Жыл бұрын
@@LlamAcademy haha at the moment thats above my pay grade !! Ive NETHER bothered to use the shader graph !!
@omkarposhatwar5190
@omkarposhatwar5190 Жыл бұрын
Is there a way to project decals on UI (Like on TextMeshPro Text, Image, etc) in HDRP?
@LlamAcademy
@LlamAcademy Жыл бұрын
I'm not sure 🤔 haven't tried it. Seems like that may be a tough use case for the DecalProjector though
@omkarposhatwar5190
@omkarposhatwar5190 Жыл бұрын
@@LlamAcademy Appreciate your response. Do you think there is a way to show texture over a TextMeshPro text?
@dasparadoxon
@dasparadoxon 11 ай бұрын
you, yes you. *gets scared* :)
@Yoctopory
@Yoctopory 2 жыл бұрын
Can it be used with light - like a projector?
@LlamAcademy
@LlamAcademy 2 жыл бұрын
I didn't try it, but for most lights I'd assume you'd just apply a cookie to your Spot light to achieve a light projection.
@fabianobersovszky6987
@fabianobersovszky6987 8 ай бұрын
Can i use this on skinned mesh?
@LlamAcademy
@LlamAcademy 8 ай бұрын
I think so but I didn't try it
@SlothHuntOnYou
@SlothHuntOnYou Жыл бұрын
why 60fps for video like that? =((((
@endasil
@endasil Жыл бұрын
What's wrong with 60 fps here?
@SlothHuntOnYou
@SlothHuntOnYou Жыл бұрын
@@endasil it's not necessary at all for video like that - double internet traffic and power of electricity on servers for each client.
@Michael-lz5cm
@Michael-lz5cm Жыл бұрын
In URP without layer is useless
@LlamAcademy
@LlamAcademy Жыл бұрын
Starting with Unity (edited) 2022.2 / URP14 Render Layers are supported! docs.unity3d.com/Packages/com.unity.render-pipelines.universal@14.0/manual/renderer-feature-decal.html
@Michael-lz5cm
@Michael-lz5cm Жыл бұрын
@@LlamAcademy 2022.1 doesn't have layers. Only in 22.2 beta. URP 14.
@LlamAcademy
@LlamAcademy Жыл бұрын
Thank you for the correction. I will edit the comment and update the link for anyone else who runs across this
@rafertysullivan6085
@rafertysullivan6085 Жыл бұрын
me? really me?
@LlamAcademy
@LlamAcademy Жыл бұрын
YESSSSS YOU!
MAKE YOUR LEVELS PRETTIER with Decals!
12:34
Brackeys
Рет қаралды 202 М.
Decals & Stickers in Unity Shader Graph and URP
9:15
Daniel Ilett
Рет қаралды 28 М.
No empty
00:35
Mamasoboliha
Рет қаралды 10 МЛН
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 69 МЛН
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 43 МЛН
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 113 МЛН
Unlocking The Power Of Unity's Scriptable Render Pipeline
21:05
Game Dev Guide
Рет қаралды 199 М.
Make Scenes Look Amazing with Decals! | Unity Tutorial
6:20
SpeedTutor
Рет қаралды 9 М.
Unity 2018 - Game VFX - Weapon Trails / Slash Tutorial
10:31
Gabriel Aguiar Prod.
Рет қаралды 201 М.
Six Grass Rendering Techniques in Unity
24:10
Daniel Ilett
Рет қаралды 48 М.
Perfecting Shadows in Unity: Introductory Guide with Troubleshooting!
12:44
Fist Full of Shrimp
Рет қаралды 4,8 М.
I tried Unity's new HDRP Water System! The Most Realistic Water?
14:05
Exterior Lighting in URP | Unity 2021.2 (Updated Workflow)
14:59
No empty
00:35
Mamasoboliha
Рет қаралды 10 МЛН