Exclude Objects From Post Processing - Unity

Поділитися
Вставка
  • Опубліковано 5 вер 2021
  • Remove objects from being affected by your post processing stack by using multiple cameras and layers. Very simple, very quick.
    You can create complex visuals by separating your objects into layers and applying certain effects on each layer.
    ❤️ Become a Tarobro on Patreon: / tarodev
    =========
    🔔 SUBSCRIBE: bit.ly/3eqG1Z6
    🗨️ DISCORD: / discord
    ✅ MORE TUTORIALS: / tarodev

КОМЕНТАРІ • 110

  • @KeeganTawa0
    @KeeganTawa0 2 роки тому +149

    Hey everyone - if you're using URP, you'll notice there's no "clear flags" option, which is critical to making this work. In URP, you can follow all of these same steps - but when you create your child camera, set its "render type" to "overlay." Then, in your Main Camera's "stack" section, add your new overlay camera to the stack; it should combine with the main camera's output.

    • @Drakusman
      @Drakusman 2 роки тому

      You made my day

    • @Tarodev
      @Tarodev  2 роки тому +11

      Pinned!

    • @Tarodev
      @Tarodev  2 роки тому +20

      I was needing to do this in URP just now so I came to my video to realize it's outdated, came down to see your comment. Saved me, lol!

    • @vaepuer2290
      @vaepuer2290 2 роки тому

      This worked for the most part, however some of my 3D UI is being duplicated in the scene by the NoPostCam, wonder if you might have a fix for that?

    • @rajeevxds
      @rajeevxds 2 роки тому +4

      In URP post process component is not working. It needs to use volumes directly(in an empty gameobject). And I am not able to isolate the prefabs I need get out from Post process effects. I wonder if any one had done that. Example Scene : suppose there is a Background and over it 3 game objects, i need 3 gameobjects to have bloom but not the background and game objects should be above the background. "sorry for my English"

  • @PhilippLenssen
    @PhilippLenssen Рік тому +19

    No intro logo, preface, or lengthy setting up of the scene -- short & sweet, thank you!

  • @x_emokid_x
    @x_emokid_x Рік тому +3

    wtf... I searched for the answer on unity forums, on stackoverflow, couldn't find it... bro you're a lifesaver

  • @victoriatrevors1306
    @victoriatrevors1306 Рік тому +14

    Very important that the no-post cam has higher depth than the main cam. It automatically got set to Main Cam Depth+1 when you created it. Just wanted to point this out as some others mentioned too.

  • @narkopraxis602
    @narkopraxis602 2 роки тому +4

    This is awesome. I looked everywhere trying to find this tutorial, and ended up doing exactly this for the blur out vignette effect in my game.
    Glad to know it wasn't as hacky as I felt it was...

  • @tamasorvos8882
    @tamasorvos8882 2 роки тому

    Man, thank you so much for this sweet and short tutorial! Been looking for something like this for days.

  • @Khud0
    @Khud0 2 місяці тому

    Thanks for the video! Additional tip: you need to delete from the second camera.

  • @papshed6546
    @papshed6546 Рік тому +1

    Straight to the point, no missing informations; I thanks you sir.

  • @cugames1676
    @cugames1676 Рік тому +1

    Quick and to the point, great tutorial, thanks

  • @victorh.fagundessantos6774
    @victorh.fagundessantos6774 2 роки тому

    OK. You made my day. I was trying this logic before, but now it's working perfectly. Thank u

  • @RUBALNANDALBIT
    @RUBALNANDALBIT 2 роки тому +2

    Noice dude I was looking for the same and couldn't find the solution with new postprocessing .... and you did it in less than 1:30 min ... Thanks man for this amazing video Keep up the good work ......😊😊

  • @renatodex
    @renatodex Рік тому +1

    That was incredibly useful for me!

  • @Bruce.B
    @Bruce.B 2 роки тому +2

    Wow very useful. Thanks!

  • @androvisuals6863
    @androvisuals6863 Рік тому

    A lifesaver. Amazing to the point and works perfectly

  • @k-6353
    @k-6353 10 місяців тому +1

    My 3 month problem with glowing UI is now solved :) thanks

  • @SuperAshutosh99
    @SuperAshutosh99 2 роки тому +5

    Simple, easy and straight to the point. You deserve more subs and likes. We need guys like you to spread knowledge/information to the world. Keep up the good work. 👍

  • @Gejam_GameDev
    @Gejam_GameDev Рік тому

    wow thanks. helped me a lot

  • @Shahmuradov
    @Shahmuradov 2 роки тому +7

    Lifesaver, thank you!
    Also if some people have some problems when they try to implement this to their already existing big projects, matching "Projection", "Size", "Clipping Planes" to the same as parent cam's and setting "Depth" to 1 fixed my problem.

    • @Kaasbaas1234
      @Kaasbaas1234 2 роки тому

      this fixed it for me

    • @gvittrup
      @gvittrup Рік тому

      I had been scratching my head for a solid hour or two trying to figure out why it simply was not working for me - thank you!

    • @Juleru
      @Juleru Рік тому

      Also don't forget the FOV! My main camera is set to 45° but the new "no post" camera was set to 60° by default and objects that use the new layer were partially invisible while walking around because of it.

  • @ensaladin
    @ensaladin Рік тому

    Thanks for the tutorial!

    • @Tarodev
      @Tarodev  Рік тому

      Thank YOU for watching

  • @starmapsllc
    @starmapsllc 11 місяців тому

    Thank you for this.

  • @tadeuvi
    @tadeuvi 7 місяців тому

    Thank you for this one

  • @ilypavan
    @ilypavan 9 місяців тому +1

    Thank you Tarodev

    • @Tarodev
      @Tarodev  9 місяців тому

      You're welcome buddy ❤️

  • @GlassVaultStudio
    @GlassVaultStudio 7 місяців тому

    Legit, ty!

  • @MiTheMer
    @MiTheMer 2 роки тому +3

    Not bad! Something that would be even cooler (as I believe there is no video tutorial for it yet) is how to exclude everything in a certain 2D area from the posit processing. Or have an object you look through, ignore the post processing. That's useful for example for underwater effects with air pockets or looking into submarines.

    • @Tarodev
      @Tarodev  2 роки тому +4

      Damn! That's a cool idea. I'll need to think about that... If I come up with a good solution I'll make a short

    • @kingbling7571
      @kingbling7571 2 роки тому

      @@Tarodev there's something called a postprocess volume box, I believe anytime the camera is within its bounds you can specify which effects to trigger or not. A scenario where can could be helpful is for eg. When player leaves from a dark cave into a brighter open area, the light intensity shots up

    • @MiTheMer
      @MiTheMer 2 роки тому

      @@kingbling7571 Not exactly what I meant. Volume boxes change the whole screen. I was rather referring to have a part of the image you see, not have the effects applied to. From what I have read, one possible way is to use a stencil buffer with an 2d plane or mesh drawing a fixed value to it where you want to suppress post processing and then selectively apply the processing depending on the stencil buffer with a screen space shader. Haven't got to try this out myself yet but will soon.

    • @kingbling7571
      @kingbling7571 2 роки тому

      @@MiTheMer oh ok, gotcha, sounds like something you can possibly achieve with the help of shaders, I suck at those so cnt really say much about it. Maybe the OP can help

    • @Tarodev
      @Tarodev  2 роки тому +2

      @@kingbling7571 this sounds like the solution, yes. Two cameras, one camera handles the objects which could potentially be in the excluded window, the other camera handles all the rest. The window camera has strategically placed trigger boxes which can be disabled. Good thinking!

  • @joshuamaitland
    @joshuamaitland Рік тому

    Thanks for this anyway. It would helped me as I've had a problem where the world space UI has a bloom thing on. After watching this tutorial, I shall give it a go.

  • @Bluumpuut
    @Bluumpuut Рік тому +2

    Awesome video, Short sweet and straight to the point. I love it. Also question, does this also work the other way around? So instead of disabling post with the tag/camera. Only enable post on certain objects with a tag/camera

  • @BurtBot
    @BurtBot 2 роки тому

    Thanks!

  • @Lhite123
    @Lhite123 3 місяці тому

    thanks!

  • @dohannn5607
    @dohannn5607 Рік тому

    thank you

  • @shauryapsbisht
    @shauryapsbisht Рік тому

    Thank you so much, it worked! Although in the scene view, the bloom is still applied to all the objects

  • @amauryboons
    @amauryboons Рік тому +1

    It works very good, thank you. If it didn't work for some people it may be because you duplicated your main camera (instead of right click new camera like Tarodev shows ) and you forgot to put the depth of your duplicated camera at 0. Be aware that the depth of your main camera must be at -1 and the ignore post camera must be at 0 for this to work. It was my mistake and i had to figure it out.

    • @user-by8fp5uw2o
      @user-by8fp5uw2o Рік тому

      I'm not sure if there's been an update which makes this work differently, but the camera with a higher depth number is the camera used for the game view. Meaning, -1 for main and 0 for no post won't work. It doesn't matter the numbers, just make your main cam have a higher depth

    • @Juleru
      @Juleru Рік тому

      @@user-by8fp5uw2o I'm using -1 for main and 0 for no post and it's working just fine in Unity 2021.2.

    • @riodjajoesman4989
      @riodjajoesman4989 6 місяців тому

      @@Juleru doesnt work for me in 2021.3

  • @Gejam_GameDev
    @Gejam_GameDev Рік тому

    wow thanks

  • @krzysztofparadowski624
    @krzysztofparadowski624 2 роки тому +3

    Is there any way to get the same result with 1 camera? I am developing for vr and using a second cam is not an option.

  • @maxmilianofreitas3063
    @maxmilianofreitas3063 7 місяців тому

    Muito Obrigado amigo!!!! :)

  • @RicoBDFD
    @RicoBDFD Рік тому

    Hi, how do I make the post-processing layer overlap the default layer (no bloom)?

  • @Juleru
    @Juleru Рік тому +1

    Thanks for the video! If you're running into a weird problem that objects that use the new "no post" layer get covered by something invisible while moving around (my main camera is a child of the player object), check if the field of view and clipping plains of both cameras use the same values! If your main camera uses e.g. 45° but your "no post" camera uses 60° (default), then you'll get the weird effect I described.
    Now I only have to find a way to do it the other way around (no bloom except for specific objects with a specific layer) - does anyone know what settings to use for this, do you just put the post processing stuff on the extra camera and still use the "Don't Clear" flags setting?

  • @riodjajoesman4989
    @riodjajoesman4989 6 місяців тому

    for some reason the objects on my no post cam show up in front of the objects of my normal cam. Is there a fix to this?

  • @Chalkcs
    @Chalkcs Рік тому

    So a few problems I'm having is the fact that lights don't interact across the cameras, and occlusion culling isn't working properly - I specifically need the "no post" layer to be on top of my "post" layer since I'm adding a greyscale effect on my main camera.

  • @rafaelospina2569
    @rafaelospina2569 Рік тому +1

    Is it possible to have different objects be affected by different post process layers?

  • @JapanImmersion
    @JapanImmersion Рік тому

    So there's an issue with the ignore post processing camera, it ignores fog on the objects that ignore post processing. Is there a way to fix this?

  • @nguyenviethung7311
    @nguyenviethung7311 Рік тому

    can i do the same thing but reverse, like I only want one thing to be affect by post? is that possible?

  • @AlexanderLoaizaGameDev
    @AlexanderLoaizaGameDev 11 місяців тому

    If your UI is set to Screen Space - Camera, also set the render camera to the No post camera.

  • @stormer268
    @stormer268 2 роки тому

    Thanks! But there have some new problems. For exsample, add a plane under the bloom cuebe. The plane in NonPost layer. Then the bloom on the cube has disappear.

  • @raven_glass
    @raven_glass 2 роки тому

    I'm developing a 2D game with Adventure Creator which has its own camera setup. How do I achieve this using that addon?

  • @ivancarranza2473
    @ivancarranza2473 5 місяців тому

    Is there a way to do this in URP with 2 objects, but selecting a different post processing effect for each object. maybe have one object with bloom, and another object with very low saturation. I have tried, in URP 2022 LTS but it does not work for me. I've tried stacking overlay cameras , with the objects under different layers. It does not work for me, all I can get is whichever object excluded from the post processing or one of the objects having a combined post processing effect. Anyway, I don't know if it can be done or if it's a limitation in Unity. I would appreciate any feedback. Thanks a lot!

    • @Nullscr1pt
      @Nullscr1pt 4 місяці тому

      I don't use URP but basically you would have 2 PP stacks, one would have everything except bloom, the second would have just bloom. things that are using the first stack would have everything (but bloom) so wouldn't glow, the other object would have the bloom stack BUT its additive since its a stack so it would get everything from the first stack. now if you wanted 2 blooms, can't do that... because its post processing, so its all on the same thing, but you can 'creatively' split the stack up and render tings in between which is nice for certain situations

  • @austindovel2139
    @austindovel2139 2 місяці тому

    This great for normal development, Heads up to those using developing for vr chat. It doesn't work.

  • @Fr33zE_YT
    @Fr33zE_YT 3 місяці тому

    FREAKING FINALLY! Thanks, It really helped! Like + Subscribe!

  • @marcelogoycochea8195
    @marcelogoycochea8195 2 роки тому

    how would it work if I'm using StateDriverCamera with multiple cameras?

  • @WelshGuitarDude
    @WelshGuitarDude 2 роки тому

    How do you do the opposite, include some objects but exclude the rest.

  • @Mordaxe
    @Mordaxe 2 місяці тому

    I noticed this kind of tanks the performance though, but I don’t know any better way to achieve the same result

  • @EmilKlingberg
    @EmilKlingberg 8 місяців тому

    Is there a performance impact for this?

  • @williambnull2083
    @williambnull2083 2 роки тому

    Urp doesn't work if both cameras have different effects, f.e., foreground boom, background blur

  • @zanagi
    @zanagi 2 місяці тому

    It seems that it can only Exclude post, not include post. cause Global checked i guess. but i cant even do it with global unchecked

  • @kwea123
    @kwea123 2 роки тому +1

    How to do this in HDRP? There is no Clear flag in HDRP, I'm struggling..

    • @DrFross09
      @DrFross09 2 роки тому

      Yep no clear flags be here either

    • @kwea123
      @kwea123 2 роки тому +1

      I found a not totally working workaround, which is to set another post-processing volume around the object to exclude.

    • @DrFross09
      @DrFross09 2 роки тому

      @@kwea123 I have floating numbers. That might not work… instead what I did was just lessen the time they’re out so they don’t float as high… the short animation makes them look like steam.

    • @user-id1mn7rq5h
      @user-id1mn7rq5h 2 роки тому

      Just now made this for URP (should work in HDRP). In a nutshell you need main cam without PP, also you need attach to man camera stack two overlay type cameras: camera with pp and excluded layer in culling mask (what needed to show without pp) and camera layer without pp with culling mask only excluded previous layer. Good luck)

    • @naheleallan-moon4425
      @naheleallan-moon4425 2 роки тому +1

      @@user-id1mn7rq5h I've tried to do this with URP but couldn't get it to work - can you provide more detail about how you did it? I just get weird multiple rendering issues...

  • @anonyanony7469
    @anonyanony7469 Рік тому

    Thanks, very simple trick.

  • @GurpreetSingh-jz3rx
    @GurpreetSingh-jz3rx 7 місяців тому

    Can this be implemented in 2D?

  • @lordofthe6string
    @lordofthe6string Рік тому

    I did these exact steps before watching, but the bits on the nopost layer are rendering over the the normal camera, then I googled it and it took me to this video lol. I don't get why it works for you but not me.

  • @Saltant
    @Saltant 3 місяці тому

    Not work with TAA, sadly =(

  • @DwipMakwana
    @DwipMakwana Рік тому

    What abut HDRP?

  • @tjgdddfcn
    @tjgdddfcn 2 роки тому +1

    anyone has an idea on how to make this work with Text objects?

    • @DaveSucker
      @DaveSucker Рік тому

      did you found out how

    • @tjgdddfcn
      @tjgdddfcn Рік тому

      @@DaveSucker i stopped making games and completely lost the memory of making this comment or even having this problem

  • @danielcardin4329
    @danielcardin4329 2 роки тому

    Does this work with Unity's internal post processing? The PPv2 stack is not supported in more recent versions of Unity

  • @porky1118
    @porky1118 7 місяців тому

    Doesn't work with rotation. The latter is always rendered in front.

  • @BulletProof_Viking
    @BulletProof_Viking 8 місяців тому +2

    Doesn't work. Something is missing in this set up.

  • @Nekotico
    @Nekotico Рік тому +1

    dam why dont they just put ids for things that will be affected by this instead of making this unnecesary complicated way

  • @felixjely1790
    @felixjely1790 Рік тому

    Doesn't work for VR

  • @youcancallmedoggie
    @youcancallmedoggie 2 роки тому

    Great vid, but one for URP would also be great

  • @mrpotato8196
    @mrpotato8196 Рік тому

    Wont this add lag tho :/

    • @Tarodev
      @Tarodev  Рік тому

      Almost every game uses multiple cameras. Depending on what you're doing though, it's negligible

    • @mrpotato8196
      @mrpotato8196 Рік тому

      @@Tarodev hmmm, maybe you are right

  • @thingies4U
    @thingies4U Рік тому +1

    This hack kills performance on mobile.

    • @Tarodev
      @Tarodev  Рік тому +1

      You shouldn't be using post processing on mobile. What specifically about "this hack" kills performance?

    • @thingies4U
      @thingies4U Рік тому +1

      @@Tarodev True about not using post. But also running two cameras at the same time will really drag down your frame rate. It may be fine on newer iOS devices but Android devices suffer more.
      Not likely to be a problem on PCs though.