Unlocking The Power Of Unity's Scriptable Render Pipeline

Sdílet
Vložit
  • čas přidán 6. 06. 2024
  • Inspired by the release of Hi-Fi Rush by Bethesda, I wanted to see if I could get a similar vibrant and stylized aesthetic in Unity. Little did I know, it would swiftly lead me down a rabbit hole of custom rendering in Unity and, in turn, completely overhaul my entire perception of Unity's Scriptable Render Pipelines. This video is a showcase of that journey... so let's take a look at how we can use Scriptable Renderer Features, and Scriptable Render Passes to completely overhaul our rendering in Unity and replicate some of the techniques on show in Hi-Fi Rush.
    Chapters:
    00:00 - Intro
    01:42 - Coming Up
    02:23 - The Communication Problem
    03:38 - How Bloom Started It All
    05:10 - The Bloom Approach
    05:51 - Volume Component
    07:11 - Creating A Renderer Feature
    09:55 - Setting Up The Bloom Pass
    15:33 - Adding Ben-Day Dots
    17:05 - Outline Multi-Pass
    19:35 - Cross-Hatching Ambient Occlusion
    20:12 - Outro
    • Outline Post-Processing in Built-In - • Creating an Outline Ef...
    • Unity Graphics Library - github.com/Unity-Technologies...
    • Custom Renderer Feature Docs - docs.unity3d.com/Packages/com...
    • Full Screen Pass - docs.unity3d.com/Packages/com...
    • RTHandles - docs.unity3d.com/Packages/com...
    • Toon Shading- blog.unity.com/engine-platfor...
    roystan.net/articles/toon-sha...
    --------------------------------------------------------------------------------
    Want to support the channel?
    ▶️ Help fund new episodes by joining the Patreon - / gamedevguide
    💡 Get One-Month Free of Skillshare Premium - skl.sh/MKR826
    Use these links to grab some cool assets from the asset store:
    Get the Must Have Assets! - assetstore.unity.com/top-asse...
    Free Unity Assets! - assetstore.unity.com/top-asse...
    New on the Asset Store! - assetstore.unity.com/top-asse...
    Top Paid Asset Store Packages - assetstore.unity.com/top-asse...
    Asset Store Partners - assetstore.unity.com/lists/as...
    --------------------------------------------------------------------------------
    Socials and Other Stuff:
    • Subscribe - czcams.com/users/gamedevguide?...
    • Join the Discord - / discord
    • Twitter - / gamedevguideyt
    • Facebook - / gamedevguideyt
    • Instagram - / gamedevguideyt

Komentáře • 263

  • @PixelDough
    @PixelDough Před rokem +326

    This is exactly what Unity has needed. The SRP has been in a really unstable state for a while so tutorials are often outdated. Now that it's a lot more stable, we need more clean and informative content surrounding how it can be used by developers

    • @GameDevGuide
      @GameDevGuide  Před rokem +43

      Thank you so much, I absolutely agree. So many people (including myself) have absolutely no idea how they work, or why they're actually better than the Built-In pipeline. So hopefully this video sheds some light on it!

    • @erikm9768
      @erikm9768 Před rokem

      Yes agree! great tutorial, hopefully its not too different for HDRP

    • @MuffinManProductions3D
      @MuffinManProductions3D Před rokem

      Hey fancy meeting you here

    • @NaviYT
      @NaviYT Před rokem +1

      Even Unity brings this up. I think they’re doing new Unite videos about it and they’re creating a new sample scene that really showcases the power of URP.

    • @theman3282
      @theman3282 Před rokem +1

      post processing volume please

  • @AunShiLord
    @AunShiLord Před rokem +129

    After watching this video I could say that this is EXACTLY how hard it is, just as I imagined.

    • @rapho8539
      @rapho8539 Před rokem +22

      I been a dev for 20 years and i dont understand any of this. Lol

    • @overthinkerapexx7845
      @overthinkerapexx7845 Před rokem +3

      @@rapho8539 I dont understand, are your 20 years aren't rendering-related?

    • @rapho8539
      @rapho8539 Před rokem +3

      @@overthinkerapexx7845 no. Never been a game dev. Thats why.

    • @cheezenuts2357
      @cheezenuts2357 Před 11 měsíci

      @@rapho8539 ad dev of what then??!?!?!

    • @rapho8539
      @rapho8539 Před 11 měsíci +1

      ​@@cheezenuts2357 C# and javascript for websites and databases, 'interfacing' with machines,... i think they call it an application dev.

  • @GamesPlusShow
    @GamesPlusShow Před rokem +57

    For those of you following along and wondering about m_pass and the Descriptor.. m_pass should be m_customPass and the descriptors declaration is: RenderTextureDescriptor m_Descriptor;

    • @grantmilner8908
      @grantmilner8908 Před 10 měsíci +1

      Thanks! I was so confused

    • @dechin6144
      @dechin6144 Před 10 měsíci

      thank you! also what about the Dispose void? it says i cant access modifiers from a protected class?

    • @A_Reaper23
      @A_Reaper23 Před 8 měsíci

      thankkk you

    • @A_Reaper23
      @A_Reaper23 Před 8 měsíci

      i can access that without a hassel, might be something worng with the urp version, i am using 14.0.8
      @@dechin6144

    • @guybrush3000
      @guybrush3000 Před 4 měsíci

      THANK YOU

  • @tmoneygamestudio
    @tmoneygamestudio Před rokem +1

    This is the best, most thorough video about the render pipelines. I was trying to create custom shaders in Amplify Shader to achieve this effect. I was so lost following videos for Amplify that I was going to stop. And then your video showed on my feed, and now I understand them better. Thank you for the video.

  • @aidanhobler
    @aidanhobler Před rokem +11

    Wow, this is the exact type of Unity content that I want to see, can't believe I hadn't seen your channel already. Instantly subscribed!

  • @threemr01
    @threemr01 Před rokem +1

    Matt, this tutorial was even better than your usually very high quality ones. Thank you for putting it together!! It’s going to be very useful to my workflow.

  • @ChristinaCreatesGames
    @ChristinaCreatesGames Před rokem +42

    Oh, this is awesome. I had stumbled upon custom render features two or three weeks ago and I was super stumped. The tutorial I used back then was already a bit outdated and I got more and more lost the longer I tried to follow it and needed to find ways to do it in this current iteration. You explained very well, I'm super looking forward to tinkering with it now 💛 (But I think this will take a few more repeats to make it stick for me :D) Thank you for posting the corresponding docs as well :) (and hey, if it's too much for one video? I'd be happy to watch more on the topic!)

    • @HansPeter-gx9ew
      @HansPeter-gx9ew Před 7 měsíci

      the video is useless like the whole SRP. I got stuck wanting to do most simple things, which shows how stupid this framework got

  • @oldshamen
    @oldshamen Před rokem +5

    Awesome video on the SRP .. You are correct. There is a lack of quality information about the use of the SRP/URP from Unity, and the quality of the tutorials online are often limited to "how to do this one thing with the SRP" without actually showing how it fits into the SRP. Really well explained here so I hope you will do more tutorials on URP in the future because this one is awesome.

  • @yuushi_s
    @yuushi_s Před rokem +1

    Great Job! Exactly what I've been looking for

  • @erfanjamshidi6228
    @erfanjamshidi6228 Před rokem +2

    great video ... i always wanted to learn about this but there wasn't any good videos this video gave me some good understanding about how it works now i can learn bit more over time... thank you

  • @TurboMakesGames
    @TurboMakesGames Před rokem +2

    Nice work Matt, this project and video came out great!!

    • @GameDevGuide
      @GameDevGuide  Před rokem +1

      Thank you so much! Appreciate your input when I was figuring out which direction to go with it hahaha

  • @f11bot
    @f11bot Před rokem +11

    I’ve not finished watching the video yet, but this has been the best video explaining SRPs! It’s so difficult to find information online, this is super useful! Unity definitely should try to explain this better, first time they explained I straight up didn’t even want to try to mess with it XD
    More documentation and examples of videos and projects from Unity are really crucial for people to start looking at this, like you said!

  • @Novacification
    @Novacification Před rokem +3

    I just started learning Unity, so this subject is of very little value to me other than it's great knowing I can have this level of control far down the line.
    However, it's obvious that your videos are very clear, informative and super well put together. I can already tell that your channel is a great learning resource and I'll definitely check out more of your stuff.

  • @xkittencatx
    @xkittencatx Před rokem +2

    I have missed you GDG :3 happy to see a new upload

  • @RamunatorGames
    @RamunatorGames Před rokem +2

    Wanted to learn about this but found no videos now i have yours Thank you

  • @f11bot
    @f11bot Před rokem

    I’ve just contributed to your future 100k subs, awesome video!! Keep it going!

  • @somestrangeperson
    @somestrangeperson Před rokem

    This is some much fun. It's cool stuff really. Thank you for you video.

  • @mittensandsnowdrop
    @mittensandsnowdrop Před rokem +2

    I have been working on this exact thing for the past week! This video couldn't have been timed better. Thank you so much the the in depth look at this stuff. I have been picking through the frame debugger trying to find the shadow pass so I can customise it. Found it now thanks to this video. Also your post-processing video has been a life saver for me. Thanks buddy!

  • @segue2ant395
    @segue2ant395 Před rokem

    Incredible video - more than enough information to get started without being overwhelming. I've used most of these features just enough to get a taste of what they're capable of, but never managed more thanks to documentation that is either missing, out-of-date, or just flat-out incorrect. I'd honestly assumed that there was something wrong with either my brain or my Unity install, the number of times I've butted heads with it and lost. I'm glad to hear someone who actually worked for Unity admit that this topic is mostly just badly documented, when it's documented at all.

  • @btarg1
    @btarg1 Před rokem

    I was very recently looking for how to replicate Hi Fi Rush in Unity, great timing!

  • @mattkaiser8984
    @mattkaiser8984 Před rokem

    Thank you from the bottom of my heart for this video.

  • @ruslan6435
    @ruslan6435 Před rokem

    You don't release videos often, but they are the best. I would like to know more about the URP.

  • @mario_actually
    @mario_actually Před rokem +19

    This is really really awesome.
    I really hope unity gets better at exposing their actual cool features. Until then, great job of stepping in for them.

  • @HieuTran-iv7ow
    @HieuTran-iv7ow Před rokem

    Very interesting video. Thank you for sharing

  • @feyakut
    @feyakut Před rokem

    Always a great day when Game Dev Guide uploads

  • @-nickdev
    @-nickdev Před rokem +9

    Seriously good video, this type of content is really lacking for URP. I've stayed with built in/amplify shader editor since there's such a lack of documentation about this stuff, but you've shown how powerful it can be.

    • @GameDevGuide
      @GameDevGuide  Před rokem +5

      I've felt exactly the same way up until now. I really hope Unity put work into documenting more of this stuff!

  • @coolsai
    @coolsai Před rokem +3

    great tutorial ! i was wondering how they achieve this type of rendering in the sable game , But you cleared my doubt thanks : )

  • @ludologian
    @ludologian Před rokem

    Omg the timing!! I just searched grab pass in urp and wanted to learn more about srp .

  • @ZiplawDev
    @ZiplawDev Před rokem +16

    i think a more in depth video about the RTHandles stuff, with dome diagrams about how textures are created, blitted and the like would be much appreciated. Personally its been really difficult to get into it lately, as the API has changed so much

  • @consuminhelium3346
    @consuminhelium3346 Před rokem +1

    Been put off from dabbling in the render pipeline, but this gave me good insight into how it works! Thank you + awesome video

  • @syn2142
    @syn2142 Před rokem

    Great Video! Thank you.
    I'm currently stuck with URP 10 😢. The new Blitter API looks promising.

  • @fhccardoso9487
    @fhccardoso9487 Před rokem

    This is awesome! Please, bring us more tech content about the URP... i believe it is very powerfull but it needs more quality information on how to use it! THANKS!

  • @martinfinch5011
    @martinfinch5011 Před 11 měsíci

    Great video 🎉

  • @maxbas2018
    @maxbas2018 Před rokem

    congrats to 100.000 \o/

  • @RobertMaximVerdes
    @RobertMaximVerdes Před 8 měsíci

    A breath of fresh air.

  • @GameDevBox
    @GameDevBox Před rokem

    great video 💙

  • @ULTRADARKSETH
    @ULTRADARKSETH Před rokem +1

    Brilliant. Been playing with this. But no one jas been able to do this with the 2D Render pipeline. Give that a bash please!!

  • @lewisgads6432
    @lewisgads6432 Před 4 měsíci +2

    For those who have a blank grey/white screen when following along, make sure the Bloom Texture in the shader graph has 'Exposed' set to off on the BloomTexture property in shadergraph. This stops it being overwritten to a blank white texture as its expecting to be set in a material.

    • @TheFerruccio
      @TheFerruccio Před 3 měsíci

      You are a LIFE SAVER! Thanks for pointing that out! I am able to get the bloom effect working, though if I dare switch to the “scene” view, I get a ton of null reference exception in reference to the SetupBloom() method, in the BlitCameraTexture() method right before the line “var lastDown = …” but I’ve been unable to debug this.

  • @graig2558
    @graig2558 Před rokem +1

    This is amazing and what I've been looking for for so long. Do you think its possible to make a Depth Of Field blur post process that works with sprites using this method? This is needed by pretty much any serious 2D game and it's baffling why there is no 2D version available. I understand its related to the depth buffer etc and transparents dont work with it but can it not be set up to work off of say Zpos, or even sorting layer? If you could work this out it would be a HUGE help to the Unity community. I'll give it a shot now that I understand this a bit better but I doubt I have the skills to pull it off as well as you could. Anyway thanks heaps honestly this is such a great video.

  • @nosh247
    @nosh247 Před rokem +1

    would love to see a toon shader tutorial from you O.O applied in a renderer feature like you do in this tutorial

  • @shrimpindustries
    @shrimpindustries Před rokem +6

    My dude, that is perfect!
    Ever since Unity has switched from working on the engine as a whole to working on hundreds of different modules simultaneously, they have neglected documentation so much. As every one of these modules is pretty much always in "development" state, they don't bother to document it well.
    And that really pisses me off, cause there is so much potential, yet so much time wasted on plain experimentation on how to get things working.

  • @prod.scrtchout
    @prod.scrtchout Před 11 měsíci

    I'm love this channel! Can you please make a video on coding a custom text component that uses sprites instead of font files? If it's possible of course. Thank you!

  • @MrZtapp
    @MrZtapp Před rokem

    Great video

  • @bluzenkk
    @bluzenkk Před rokem +5

    my head exploded.... its wayyyy out of my ability at this time.. i wish i'll understand it in the future... but nontheless, great job on the video. at least finally someone tries to explain the use case of scriptable render pipeline in such detail.

  • @uncleg1214
    @uncleg1214 Před rokem

    Excellent and informative tutorial, can you please make a terrain toon shader tutorial that also handles trees and foilage

  • @lando6583
    @lando6583 Před rokem

    thank you for making this video. I personally tried to work with SRP in the past, but failed because this were so confusing and undocumented.

  • @maxsmietana4837
    @maxsmietana4837 Před rokem +8

    Hi, i am still a little bit confused about the code @12:00. It references 'm_pass' which was not defined in the code previously. Was that supposed to be 'm_customPass' in the CustomPostProcessRendererFeature?

  • @csgocondom8372
    @csgocondom8372 Před rokem +18

    Hello, I am having some trouble following the tutorial from minute 12:20 onward. There is a very big jump in complexity and pacing when it comes to explaining the code. I tried looking for the Post Processing Pass inside of the package, but cannot find it.
    Inside of the CustomPostProcessPass.cs script:
    -The variable m_BloomEffect is never declared as far as I am aware.
    -''ProfilingScope'' gives me errors, changing it to ''UnityEngine.Rendering.ProfilingScope'' seems to fix it, though
    -m_CameraColorTarget is not declared
    -m_Descriptor is not declared. I tried declaring it as a ''private RenderTextureDescriptor m_Descriptor''
    Inside of the CustomPostProcessRenderFeature.cs script:
    -m_pass is never declared
    I am trying to wrap my head around it, but I cannot fully understand how to fix the missing links to make the code work. Any help would be apprecciated. Thanks in advance.

    • @csgocondom8372
      @csgocondom8372 Před rokem +6

      Update:
      - I have managed to fix the m_Bloomeffect by creating a ''private BenDayBloomEffect m_BloomEffect'' variable. I don't know if this is correct, though
      -The Profilingscope now works. I probbaly made a mistake on my part earlier
      - I fixed m_CameraColorTarget and CameraDepthTarget by creating two ''private RTHandle'' variables
      - I fixed m_Descriptor by creating a ''private RenderTextureDescripture m_Descriptor'' variable
      I have no idea if any of this is corret, but I hope it can help anyone stumbling across this problem. I still cannot get the effect to work.
      I see at 14:47 that an ''internal void SetTarget'' is used. But this gives me errors because of ''public void SetTarget'' (which was implemented previously and can be seen shortly after). Is the video correct or am I missing something?
      Just a quick update.

    • @5daydreams
      @5daydreams Před 8 měsíci

      @@csgocondom8372I'm having some struggles with the cameraColorTarget being null. Did you run into anything similar?

    • @TheGameLecturer
      @TheGameLecturer Před 8 měsíci

      having the same issue I did the same as you did...@@csgocondom8372 Did you ever get it to work ? Me I'm having a a permanent blackscreen and an infinity of nullref exception and "Texture creation failed" errors.
      [Edit] because the tuto goes too fast I skipped the part that shows you "const FormatUsage usage". But let's be honest, this was waaay to much to pack into 20 minutes.
      Also, I'm not done yet as my shader is just rendering though the hole screen instead of the bloom pass.

    • @csgocondom8372
      @csgocondom8372 Před 8 měsíci +1

      @@5daydreams From what I remember I had no issues with it, but I was planning on giving this another try sometime in the future. I will let you know how it goes and if I run in the same issue!

    • @Nightmareinfos
      @Nightmareinfos Před 23 dny

      @@5daydreams Yes, No idea what to do with it.

  • @haileef7234
    @haileef7234 Před rokem +7

    For people who can't find the Bloom shader in packages you need to click the crossed out eye to reveal it.

  • @JackAllpikeMusic
    @JackAllpikeMusic Před rokem +1

    Hey! I really love these videos - there is one thing I have been struggling with - something I thought would be so simple, but I'd greatly appreciate a tutorial on if you know of a way to do it.
    While using URP, I am trying to get bloom on just certain objects. It's a real pain - because there's no such thing as a post processing volume for certain layers, even using camera stacking. It seems almost like a no-brainer when trying to achieve the effect of just some things glowing - but I have spent days now trying to find resources which can help me achieve this.
    On a side note - I'd also love to see a break down of the Shader Graph.
    Thanks for reading. :)

    • @foundtexas5424
      @foundtexas5424 Před rokem +1

      Maybe emission maps could help and setting the treshold to be greater or equal to 1 that will only apply the bloom to the bright areas you define.

  • @AurelioProvedo
    @AurelioProvedo Před rokem

    Thanks for the best documentation out there on SRPs!

  • @4aqha250
    @4aqha250 Před rokem

    welcome back

  • @stefkeegan4391
    @stefkeegan4391 Před rokem +9

    bummer this starts out so very promising, but there is no way anyone without deeper coding knowledge could follow this because there are several errors and it jumps all over the place! I've tried diggin through the comments for fixes, but it would be good if you could confirm what we should do in the description or something! Otherwise it's a really great video, it's just not possible to follow along with sadly.

    • @smokydave
      @smokydave Před 9 měsíci +1

      I'm also having trouble. He forgets to mention declaring the m_BloomEffect, it switches between calling the CustomPostProcessPass variable m_pass and m_customPass. And the jumping around instead of completing one function at a time makes it extremely hard to follow. He clearly knows what he's doing but he's terrible at explaining it. I'm stuck at 13mins in with a white screen and i've gone through the tutorial 5x now trying to find what is causing it with no luck.

    • @danieles6684
      @danieles6684 Před 9 měsíci +1

      Yeah, huge bummer. If nothing else, just throwing the project / scripts on github would have gone a long way toward papering over these issues. Now I'm 70% of the way done implementing and judging from the other comments wondering if I should even continue, since it's riddled with errors.

  • @Kronnect
    @Kronnect Před rokem +2

    There's an issue at 12.00: when calling ConfigureInput, use the "|" (OR bitwise operand) to specify which inputs buffers are used, for example:
    m_pass.ConfigureInput(ScriptableRenderPassInput.Depth | ScriptableRenderPassInput.Color)

  • @JunkerJames
    @JunkerJames Před rokem +1

    Just wanted to thank you so much for this! I've had several stabs at URP NPR effects on my weekends, and it's been super frustrating on many fronts (apis changing, tutorials for older versions). I've managed to leak gpu memory and totally hang my computer a few times because it's been unclear how and when to dealloc RTHandles etc. It has not been for the feint of heart! I hope you do more examples, but this on is great at getting the concepts across more holistically. Finally feels like I can make some progress on my side work!

    • @JunkerJames
      @JunkerJames Před rokem

      I'm about half way through - got the blurred elements coming through and about to get into the shader node part. I can't tell you how grateful I am - I felt like I was never going to break the back of this, despite being relatively adept. But by following the tutorial to the letter, and not going off script, everything seemed to work! There was a little bit of a breakage when I had hadn't yet executed the command buffer (since I guess the RTs get reallocated but never actually used?) but that was informative in of itself. It's about the 8th weekend I've thown myself at pipeline code and I'm finally getting a sense of the psycho-geography of where everything lives, how to use the debugger etc.
      I'm gonna head over to the patreon!

    • @JunkerJames
      @JunkerJames Před rokem +1

      One issue i ran into was an error when i was editing in the Shader Node editor.
      "AddRenderPasses" must have been called for the MainPreviewWindow - I had not wrapped the enqueue call with a check to see if it was the game window. Needs to be this:
      public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
      {
      if (renderingData.cameraData.cameraType == CameraType.Game)
      {
      renderer.EnqueuePass(m_customPass);
      }
      }
      Hope this helps others!

    • @JunkerJames
      @JunkerJames Před rokem

      I also hit an issue with the URP Sample Buffer Node. It seems to render just one time when I hit save, but after that it seems to be black. Feels like it could be a number of things. The video says you may have to blit this yourself if your urp package is older (mine seems to be 14.0.7... which i thought was up to date?) (i assume in the same way as we blit the bloom targets and then give it a global shader name - except we just borrow the bloom material's first pass which is a simple copy).

    • @JunkerJames
      @JunkerJames Před rokem +1

      Me again!
      20:00 I tried adding the SSAO feature so that i could snipe the "_ScreenSpaceOcclusionTexture" and pull it into the composit shader as "_SSAOTexture" after calling SetGlobalTexture.
      And it seemed to work, partially. Like, it'd work for one frame then go to grey. Seems to flicker when the mouse moves/updates the screen. Maybe something in the renderer is rendering it really sparingly. Maybe it's because i have lots of checks to see if it's the game camera only. Investigating.

    • @narenjj
      @narenjj Před 11 měsíci

      ​@@JunkerJames Did you make Ambient Occlusion at 20:06? How to mask in composite? I couldnt get it done :/

  • @LM-cc7qz
    @LM-cc7qz Před rokem +10

    Can someone please tell me if "GetCompatibleDescriptor" at 13:56 is also giving them an error and possibly how to fix it? I am on the same version of unity as the tutorial and I can't figure this out.
    Edit: he calls it before actually showing us the code for it which is at 14:35, would be nice if this was structured in a way so that we knew this instead of spending huge amounts of time thinking I was missing a using statement.
    Another edit, make sure that for your bloom texture parameter in shader graph that it "Exposed" is not checked. this will cause your composite shader texture to not actually be assigned the bloom texture.

    • @smokydave
      @smokydave Před 9 měsíci

      I had the same problem, and then he showed the code, but now I'm stuck at 15:26 with a white screen.

    • @LM-cc7qz
      @LM-cc7qz Před 9 měsíci +1

      @@smokydaveYo man, make sure you don't have your bloomTexture variable in shader graph set to "exposed".

    • @5daydreams
      @5daydreams Před 8 měsíci

      Having properties exposed breaking this effect is a REALLY big deal to forget emphasizing imo - this took me a couple forevers to go through...

  • @mikecu2249
    @mikecu2249 Před 9 měsíci +2

    What is happening at 12:00 ?
    What is the purpose of "ConfigureInput" , what does it do and how can i use it ?
    What is "SetTarget" , what targets can i set, what cna this be used for?

  • @noisecrime
    @noisecrime Před rokem

    Is there a way to minimise all those ResolveAA instances in the frameDebugger? There is at least 3 or 4 of them, maybe more and they are very costly. They are caused by using MSAA, so in theory could all be removed by disabling it, however if they are simply resolving the same renderTarget each time ( hard to tell without looking at the project ), surely there must be a way in SRP to store or access that resolved texture for effects instead of triggering another resolveAA?

  • @mraland2022
    @mraland2022 Před rokem

    Good Job

  • @Lantertronics
    @Lantertronics Před 11 měsíci

    Excellent tutorial on the SRP! Although... it's not clear to me what you're doing here that could be done with a custom post processing effect in the original Built-In Pipeline. I must be overlooking something.

  • @LockTheMage
    @LockTheMage Před 7 měsíci

    Awesome

  • @thedeliverguy879
    @thedeliverguy879 Před rokem

    Is blitting the only way to get rendering results to other textures? I tried to reset the render target to other textures before draw call but no luck with that at all.

  • @nemonzvsworld3967
    @nemonzvsworld3967 Před 3 měsíci

    I was pretty excited to unlock the full power...
    But then the tutorial just kinda fizzled out at the end.
    I wish i could make the tutorial you showed glimpses of in this tutorial work.
    That looked like the best solution, post processing outlines per object

  • @daggerone3370
    @daggerone3370 Před rokem +1

    Like number 2520 and you deserve even more!

  • @ttrudeau83
    @ttrudeau83 Před rokem

    Really cool. I didn't understand much of this at all though.

  • @greywolf7849
    @greywolf7849 Před 6 měsíci +4

    For anyone not able to get this working, try blitting camera color to a temp handle first, and then blit it back to camera color through the composite material. It seems like blitting from src to dst when they are the same handle (ie. camera target) as shown in the video is not working for me (Frame debugger will show the _blittexture as black).

    • @vrclckd-zz3pv
      @vrclckd-zz3pv Před 5 měsíci

      I can't seem to get it to work. Could you share your code?
      I have:
      using (new ProfilingScope(cmd, new ProfilingSampler("Custom process pass event"))){
      RTHandle tempHandle;
      tempHandle = RTHandles.Alloc(Vector2.one, depthBufferBits: DepthBits.Depth32, dimension: TextureDimension.Tex2D, name: "__tempHandle__");
      Blitter.BlitCameraTexture(cmd, m_cameraColourTarget, tempHandle);
      Blitter.BlitCameraTexture(cmd, tempHandle, tempHandle, m_testMat, 0);
      Blitter.BlitCameraTexture(cmd, tempHandle, m_cameraColourTarget);
      tempHandle.Release();
      }
      I still get strange graphical artefacts doing this though

    • @greywolf7849
      @greywolf7849 Před 5 měsíci

      @@vrclckd-zz3pv I think it's because your rthandle is allocated as a depth buffer but not a color buffer.
      Here is my code:
      First allocate in OnCameraSetup:
      public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData)
      {
      m_Descriptor = renderingData.cameraData.cameraTargetDescriptor;
      m_Descriptor.depthBufferBits = (int)DepthBits.None;
      RenderingUtils.ReAllocateIfNeeded(ref m_CopiedColor, m_Descriptor, name: "_ColorCopy");
      }
      Then blit in Execute:
      Blitter.BlitCameraTexture(cmd, cameraTargetHandle, m_CopiedColor);
      Blitter.BlitCameraTexture(cmd, m_CopiedColor, cameraTargetHandle, _compositeMaterial, 0);

  • @Husmanmusic
    @Husmanmusic Před rokem

    Is the toon shader also used as a renderer feature? I always wanted to add a toon look but have so much different shaders on object that I never could afford to change all of those to toon shaders

    • @GameDevGuide
      @GameDevGuide  Před rokem +1

      No, that's just the default unlit shader my object materials use.

  • @camerona1512
    @camerona1512 Před 5 měsíci

    I have been desperately trying to make a custom fog effect using a fog shader I created, which works fine when a material is created and placed on objects, but when trying any of the custom render features tutorials it never seems to work. I am confused by all of the shader specific (ben day bloom effect) things added into the code here and can't find any resources to help with my scenario. Do you have any advice?

  • @AleksanderFimreite
    @AleksanderFimreite Před rokem +3

    There is still a lot of fundimentals which are foreign to me about rendering and shaders in general.
    I can quite easily understand everything that happens within the shader graphs, but the entire code that wraps around it just to assign it to work was still confusing to me.
    Would be great if Unity just made a render pipeline which just had an array of shader graph assets to assign and then they all happen in order.
    But I suppose that might introduce some limits to people who wants more advanced access? (Or somehow be technically difficult)

  • @jgurien
    @jgurien Před 9 měsíci +1

    has anyone been getting an issue when they try to connect add the bloom texture to the blit texture? for some reason my blit texture is black, so when i add them together it doesn't do anything...

  • @lucutes2936
    @lucutes2936 Před 2 měsíci

    That's a lot of work

  • @frogmasto1316
    @frogmasto1316 Před 4 měsíci

    can you make a video about compute shaders rendering to the screen in URP?

  • @KandyMan90
    @KandyMan90 Před rokem

    Does the custom renderer feature created in this video replace the custom renderer feature you made in previous videos? I only ask as since 2022.2 the previous custom renderer feature you did doesn't work for full screen effects. I tried using Unity's full screen feature in my 2D pixel perfect game, however if the UI is set to screen space camera then it doesn't work. Been bashing my head off a wall for months trying to solve this now

    • @GameDevGuide
      @GameDevGuide  Před rokem

      This is the only video I've ever made about renderer features so far.
      The outline video was a custom post-process made using the built-in renderer. But, you could use the techniques shown in this video to port the effects over from that one into the render pass.

  • @dimashutama9378
    @dimashutama9378 Před 3 měsíci

    hi, i wonder can we use full screen graph to achieve this effect?

  • @pa_de_queijo
    @pa_de_queijo Před rokem +12

    Really good video, but it would be nice if you provide the source code in the description, such big scripts can be confusing to follow in the way you edit the video.
    I'm at 15:33 but my screen is all black and I have no Idea why 😅
    I also got some problems that other people in the comments are also having.

    • @alpagateau8236
      @alpagateau8236 Před rokem +1

      mine is all white, no idea why either

    • @NMe6667
      @NMe6667 Před 11 měsíci

      Did you ever manage to figure it out?

    • @pa_de_queijo
      @pa_de_queijo Před 11 měsíci

      @@NMe6667 nope

    • @ConcerninglyWiseAlligator
      @ConcerninglyWiseAlligator Před 11 měsíci +2

      SOLVED!
      (kinda)
      Had the same Issue following along.
      I just said "f*@k it" and assigned it to the material directly like he does in 15:10, instead of using the Command Buffer.
      You can do that with:
      m_compositeMaterial.SetTexture("_Bloom_Texture", m_BloomMipUp[0]);
      Still, I would love for someone to explain why the Command Buffer didn't work.

  • @FlashBash64
    @FlashBash64 Před rokem +2

    I got it to work finally, but now I have an issue where the scene view looks like it has no light at all except for the bloom when I have the render feature enabled, so I'm no sure what to do about that. besides re-enabling it every time I want to see it.

    • @trashcaster
      @trashcaster Před rokem

      Did you end up getting a bunch of NullReferenceException as well in the console during scene view? It seems like m_CameraColorTarget is not getting assigned because the cameraType isn't always Game. If I add a bypass to it (just using else and passing the same functions/values through) I get a scene that is pretty much all black, other than the gizmos/grid, but no more issue with NullReferenceException spam
      Edit:
      I finally got it working. The trick was to replace "Params" with "_Params". The vector never got filled because the wrong property name was referenced.
      Edit 2:
      My dots just appear black, so its as if the BlitSource isnt showing under the Ben Day effect. At least it works this way in Scene view. In Game View it works mostly okay. But I have been noticing that my emissive colors on my materials, the intensity is going wonky on its own. I set it to 2, and then edit it again later and it's up to 9, and it seems like as you adjust it, it is growing exponentially (it stops at a certain point, it's not infinite).
      Edit 3:
      I've learned from adding a Debug log that the source is sometimes null in SetupBloom (which is m_CameraColorTarget in Execute). I think it is related to the Scene view, because the Execute function doesn't check if the rendering data camera type is game, while the SetupRenderPasses does check for game view. So the solution is to add a guard clause to Execute which prevents it from running in Scene view, or to remove the check from Setup so it initializes in all views

    • @guillem99
      @guillem99 Před 11 měsíci

      @@trashcaster Do you know how to display the effect in the scene view as well?

  • @joe-the-cannon
    @joe-the-cannon Před měsícem

    To anyone confused about what is happening at 12:00:
    In the *CustomPostProcessRenderFeature.cs* script, use _m_customPass_ instead of _m_pass_
    In the *CustomPostProcessPass.cs* script, declare following values at the top:
    RenderTextureDescriptor m_Descriptor;
    RTHandle m_CameraColorTarget;
    RTHandle m_CameraDepthTarget;
    Hope this helps!

  • @Nightmareinfos
    @Nightmareinfos Před 23 dny

    When I need to see blurred image, I have just white screen (default texture from composite shader). Rechecked everything many times. Any ideas why it could be?

  • @Adam-cb3gx
    @Adam-cb3gx Před 9 měsíci

    I cant seem to get my custom post process pass to render to the screen or show up in the frame debuger at 14:50. What does he mean by "Enable render feature in the settings"? Do I need to change something in the project settings or what? Ive gone through the code multiple times but cant seem to find any problems, any ideas?

    • @smokydave
      @smokydave Před 9 měsíci

      He kinda skips over it quickly so it's easy to miss, but the Execute method should end with these 3 lines after the profiling scope call:
      context.ExecuteCommandBuffer(cmd);
      cmd.Clear();

      CommandBufferPool.Release(cmd);

  • @bovineox1111
    @bovineox1111 Před 2 měsíci

    I mean I was looking at multi-pass today and found it incredibly annoying tbh. I can use both the light mode tags you mention or I can add a renderer feature, which I think is what you’re doing here, or maybe you’re doing your own custom SRP but is this really any better than duplicating the object and rendering the same mesh with a different material, ensuring it renderers first?

  • @brammutje15
    @brammutje15 Před rokem

    makes me think of sunset overdrive. that game was kind of a banger

  • @nickybakes
    @nickybakes Před rokem

    I really appreciate your tutorial and work here! I've actually been doing something similar in Unreal, trying to grab their bloom texture so I could apply the halftone dots effect to it, and then also apply the hatching AO effect too, all in an effort to simulate Hi-Fi Rush's style. In Unity I make my own shaders and have used Shader Graph so many times, but how Unity specifically sets up its passes and the render features have always been a little confusing to me. Your video explains it really well and I will definitely be referencing it in my future work. Great job!!

  • @erikm9768
    @erikm9768 Před rokem

    I wish i'd know how to do toon shaders with multiple lights. Most tutorials ive seen are just main light only which makes them quite limited

  • @zoot.589
    @zoot.589 Před rokem +1

    Honestly, The thing that confuses me the most is knowing what the different rendering stages are useful for in the pipeline.
    The order seems to matter completely and Idk much about what each stage does or the order of it.
    The best thing that has helped me start to understand so far is just learning OpenGL on it's own. It's alot to take in but it eases you into it a little more imo because It's a fundamental part of using OpenGL. When your using unity. Unity takes care of all of that inbetween stuff for you. You can choose to skip past it and focus on other stuff. (Which is the purpose of unity to begin with). It's just easier for me to lead into it rather than go back and tweak pre-existing systems personally.

  • @bdenix1997
    @bdenix1997 Před rokem

    how different is this than doing it the normal way?
    if i want to add some fog, i'll just add it using a post process shader then graphics.blit.
    then lets say i want to have bloom too. then ill write a shader that blurs the pixels then bring the whites up and stuff.
    then graphics.blit.
    is this way of doing things any different than what i do?

  • @5daydreams
    @5daydreams Před 8 měsíci

    I don't know what I have wrong or different to your scripts, I have rechecked line by line several times over the course of three hours now:
    I noticed a null reference regarding the camera color target. Is there some sort of editor setup which is necessary to retrieve the camera color target from the bloom shader?
    My result applies the ben day dots, but it doesn't render literally anything from the scene - I also had to force my post processing to check for both the ingame camera and the editor camera, otherwise nothing gets rendered at all in either the viewport or the game screen.
    I know for a fact that I messed up. I just can't see where and when, and I do have a feeling that the issue could be within the shadergraph settings or the scriptable objects for the URP setup.

    • @5daydreams
      @5daydreams Před 8 měsíci +4

      Yeah, after a few days hopping in and out of this, I can only say the tutorial does bring great content to light, and should very much serve as a good template for the SRP workflow, and I have learned a lot thanks to the information provided.
      However, as several other commenters have pointed out - one issue here is the sudden burst of information from the 12:00 timestamp and onwards. This could have been alleviated by easing the viewer into the usage of the Render Pass and Features through a simpler effect, and then going into the BenDay effect.
      Another issue is I noticed is the quick cuts around the codebase without ever showing the full content - these issues are weird, as at some point the best approach to this is done, at around 14:00 - where the shader code is presented fully on the left, while zooming into the relevant parts on the right. I'm not saying this makes the tutorial bad, but it does make me question why are there so many different styles of code presentation being tossed around - it was incredibly easy to follow the thought process, but very hard to follow most of the syntax used and the overall structure of the project.
      These are points that I saw brought up by some other commenters, that I'd just agreeing with and adding my proposed solutions, however, I'd say my main gripe was the quick shuffling through the editor without emphasizing the really necessary steps, such as toggling the "exposed" boolean off within the shadergraph and other very unity-specific things which will completely break your workflow. Spending a few seconds just to highlight or at least mention that some of the editor setups will conflict with the code being written should have been a paramount priority - as these issues are the hardest to debug/detect.
      With all of that being said - I'm stil struggling to get the exact same effect happening, and still following this tutorial's guidelines. I do think the content here is great, and presented with a good audience and reach for exposure, but I still am not convinced this is the most instructive approach to this.

    • @HansPeter-gx9ew
      @HansPeter-gx9ew Před 7 měsíci +3

      @@5daydreams I think the tutorial is *garbage* bc of the reasons you mentioned. The effect he shows is extremely simple, but the problem is just how to do it with Unity, it's just know-how. There is not much to understand here.
      This is no complicated linear algebra for shaders, but just: click this, write that. If he doesn't show it, doesn't provide the code it has almost no worth.
      I don't know why these game dev guys always skip half of the code, it#s then more of a show off then any help.

  • @Btomaek
    @Btomaek Před rokem

    that's cool, how do make the shadows cartoony?

    • @Noideagsd0
      @Noideagsd0 Před 10 měsíci

      Haven't tried myself yet, but if I understand correctly it would probably be something like: write a custom render pass that duplicates the behaviour of the classic MainLightShadow pass, isolate the shadows, run that to a texture, then to a custom shader, then back to screen space, similar to how the bloom and AO effects are dealt with.

  • @foundtexas5424
    @foundtexas5424 Před rokem

    the bloom pass only works with the full screen shader? if so I asume it is only available on the 2022 verson right?

    • @GameDevGuide
      @GameDevGuide  Před rokem

      Not really... The whole point of the video is that you're writing your own pass, and bypassing URP's limitations via your own renderer.
      While it's true that the Shadergraph used in this video would be compiled to a full-screen shader, I do not see why you couldn't just write your own composite shader outside of Shadergraph for earlier versions of the SRP Package.

  • @amac333
    @amac333 Před 7 měsíci

    Outline and outline two seem to magically work, could of used a bit more info there.. otherwise a nice primer for custom features

  • @danielcardin4329
    @danielcardin4329 Před rokem

    Wonderful I get to relearn scriptable render passes because URP changed AGAIN

  • @ReneSteenNielsen
    @ReneSteenNielsen Před 3 měsíci

    Game Dev Guide: Your material is truly amazing!
    Also, if you or anybody else mind; please try to download the latest Unity 2023 023.2.10f1 (not beta)
    Now select the "URP core" template, and when the project finally launches, click any of the render pipeline files in the project view.
    I now see multiple random errors, without actually doing _anything_ besides selecting a template -.-'
    Pretty frustrating.

  • @shotoutgames8823
    @shotoutgames8823 Před rokem

    I don't see the outline shader in the package so I can test the multipass.

  • @RoboYak
    @RoboYak Před 7 měsíci

    I am so lost when it comes to the Node Settings > Bloom Texture reference. I don't see any Reference field show up in Node Settings no matter what I am clicking on in the shader graph.

  • @TheFerruccio
    @TheFerruccio Před 3 měsíci

    Several things regarding the “Ben Day Dots” effect:
    1: Why do you have the “mode” set to “tiled” for “Screen Position”? Keeping it as “Default” eliminates the seams.
    2: Why do you have a time parameter in the composite node group?
    3: I needed a screen node to calculate the ratio to get the dots to remain circular for any aspect ratio. There might be a better way of doing this.
    4: _BloomIntensity will not work unless its exposure in the node settings is disabled, as it’s been set via SetGlobalFloat() in the command buffer, and exposing it would override the buffer value.

    • @McSpjuver
      @McSpjuver Před 2 měsíci +1

      Tiled actually tiles the UVs uniformly around the center, which automatically deals with aspect ratio.

    • @TheFerruccio
      @TheFerruccio Před 2 měsíci

      @@McSpjuver Ahh that makes sense, it was an aspect ratio issue! Instead of stretching to the aspect ratio, it simply maintains the (ratio of the input image)?

  • @subarnapokharel2218
    @subarnapokharel2218 Před rokem

    I also want to become a unity game developer can you suggest what course tutorial to follow to become a game developer if i know some basic of c#

  • @narenjj
    @narenjj Před 11 měsíci

    I am not good in shader graph. Could someone help how to mask SSAO during the compositing? as @20:06?

  • @azzaeuh
    @azzaeuh Před rokem +2

    Great tutorial but I feel like the new Full Screen Pass is mostly what we needed to avoid the "Scriptable" part

  • @juicedup14
    @juicedup14 Před rokem +3

    idk it seems like there's still a lot of boilerplate needed to just get something to draw on the screen :(

  • @muuubiee
    @muuubiee Před rokem +2

    Was gonna drop a subscribe.... but already had.

  • @romainparizot1054
    @romainparizot1054 Před rokem +1

    To those who can't make it work, you need Unity 2022 and URP 14. RTHandle doesn't appear in ScriptableRenderer before URP 14, and SetupRenderPasses doesn't show up until Unity 2022. GDG mentions that he uses Unity 2022, but it's really critical here.