Exclude Objects From Post Processing - Unity

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 119

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

    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 роки тому +1

      You made my day

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

      Pinned!

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

      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 2 роки тому +25

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

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

      You're welcome

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

    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.

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

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

  • @narkopraxis602
    @narkopraxis602 3 роки тому +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...

  • @SuperAshutosh99
    @SuperAshutosh99 3 роки тому +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. 👍

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

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

  • @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 2 роки тому

      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.

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

    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.

  • @k-6353
    @k-6353 Рік тому +1

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

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

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

  • @MiTheMer
    @MiTheMer 3 роки тому +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  3 роки тому +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 3 роки тому

      @@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 3 роки тому

      @@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 3 роки тому

      @@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  3 роки тому +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!

  • @michaelcarman6513
    @michaelcarman6513 29 днів тому

    To people still having issues with it not working: It was not working for me, meaning the second camera was overriding my post processing effects on main camera. To fix this you have to go in the main camera and uncheck the box: Directly to Camera Target. This allowed my post processing to show again on main camera. This will introduce a little more overhead, but I cannot find another way to make it work.

  • @RUBALNANDALBIT
    @RUBALNANDALBIT 3 роки тому +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 ......😊😊

  • @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

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

    Thank you Tarodev

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

      You're welcome buddy ❤️

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

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

  • @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.

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

      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 Рік тому

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

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

      @@Juleru doesnt work for me in 2021.3

  • @MagnusRazer
    @MagnusRazer 14 днів тому

    ¿Como puedo aplicar varios post-procesados a diferentes objetos?. Esta buena tu explicacion, sirve para "denegar" o ignorar objetos. Pero para darle a distintos objetos "Bloom" diferentes? al mismo tiempo?

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

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

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

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

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

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

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

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

  • @Ghost-2079
    @Ghost-2079 23 дні тому

    ok so, first of all thanks for ur video, second, i want to do the same in HDRP and it is possible but the point is it wont affect the volumetric fogs and stuff, like lets say, i have emissive lights of objects, they need to be effected by the environment but not the bloom! , im guessing that i need to make my own post prossecing shader or code over here ?

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

    Quick and to the point, great tutorial, thanks

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

    Hi, it seems to work until I hit the play button. then everything gets affected by the PP volume. Any suggestions please?

  • @JessicaLeMarbre
    @JessicaLeMarbre 14 днів тому

    Saved my bacon! Many many thanks!!!!

  • @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.

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

    That was incredibly useful for me!

  • @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?

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

    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.

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

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

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

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

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

    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?

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

    Is there a performance impact for this?

  • @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?

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

    Wow very useful. Thanks!

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

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

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

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

  • @pinterest-ej3gp
    @pinterest-ej3gp 3 місяці тому

    if u want ur overlay to exclude an effect, u need to have all the other effects enabled in the overlay cam, and the excluded effect on the base camera

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

    A lifesaver. Amazing to the point and works perfectly

  • @GurpreetSingh-jz3rx
    @GurpreetSingh-jz3rx Рік тому

    Can this be implemented in 2D?

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

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

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

    Thank you for this.

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

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

  • @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.

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

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

  • @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?

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

    wow thanks. helped me a lot

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

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

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

    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

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

    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.

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

    Thanks for the tutorial!

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

      Thank YOU for watching

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

    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 9 місяців тому

      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

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

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

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

      Yep no clear flags be here either

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

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

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

      @@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.

    • @ВадимАронах
      @ВадимАронах 3 роки тому

      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)

    • @Moondog-j7b
      @Moondog-j7b 3 роки тому +1

      @@ВадимАронах 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...

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

    What abut HDRP?

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

    Not work with TAA, sadly =(

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

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

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

    not found in deferred

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

    Thanks!

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

    Legit, ty!

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

    Muito Obrigado amigo!!!! :)

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

    Thanks, very simple trick.

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

    thanks!

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

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

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

    thank you

  • @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

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

    wow thanks

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

    Doesn't work for VR

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

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

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

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

  • @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

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

    Great vid, but one for URP would also be great

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

    This hack kills performance on mobile.

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

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

    • @thingies4U
      @thingies4U 2 роки тому +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.

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

    Thank you for this one