Exclude Objects From Post Processing - Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 พ.ย. 2024

ความคิดเห็น • 116

  • @KeeganTawa0
    @KeeganTawa0 2 ปีที่แล้ว +163

    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 ปีที่แล้ว +24

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

    • @Tarodev
      @Tarodev  2 ปีที่แล้ว +4

      You're welcome

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

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

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

  • @papshed6546
    @papshed6546 ปีที่แล้ว +1

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

  • @Khud0
    @Khud0 5 หลายเดือนก่อน

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

  • @k-6353
    @k-6353 ปีที่แล้ว +1

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

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

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

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

  • @ilypavan
    @ilypavan ปีที่แล้ว +1

    Thank you Tarodev

    • @Tarodev
      @Tarodev  ปีที่แล้ว

      You're welcome buddy ❤️

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

  • @tamasorvos8882
    @tamasorvos8882 2 ปีที่แล้ว

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

  • @victorh.fagundessantos6774
    @victorh.fagundessantos6774 2 ปีที่แล้ว

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

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

  • @Ghost-2079
    @Ghost-2079 วันที่ผ่านมา

    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 ?

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

  • @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 10 หลายเดือนก่อน

      @@Juleru doesnt work for me in 2021.3

  • @reek_games
    @reek_games 2 ปีที่แล้ว +1

    Quick and to the point, great tutorial, thanks

  • @renatodex
    @renatodex 2 ปีที่แล้ว +1

    That was incredibly useful for me!

  • @shauryapsbisht
    @shauryapsbisht ปีที่แล้ว

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

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

  • @androvisuals6863
    @androvisuals6863 ปีที่แล้ว

    A lifesaver. Amazing to the point and works perfectly

  • @michaelcarman6513
    @michaelcarman6513 7 วันที่ผ่านมา

    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.

  • @Bruce.B
    @Bruce.B 3 ปีที่แล้ว +2

    Wow very useful. Thanks!

  • @tadeuvi
    @tadeuvi 11 หลายเดือนก่อน

    Thank you for this one

  • @BulletProof_Viking
    @BulletProof_Viking 11 หลายเดือนก่อน +2

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

  • @rafaelospina2569
    @rafaelospina2569 ปีที่แล้ว +1

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

  • @chntnshrff
    @chntnshrff 2 หลายเดือนก่อน

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

  • @Gejam_GameDev
    @Gejam_GameDev 2 ปีที่แล้ว

    wow thanks. helped me a lot

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

  • @ensaladin
    @ensaladin 2 ปีที่แล้ว

    Thanks for the tutorial!

    • @Tarodev
      @Tarodev  2 ปีที่แล้ว

      Thank YOU for watching

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

  • @RicoBDFD
    @RicoBDFD ปีที่แล้ว

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

  • @ivancarranza2473
    @ivancarranza2473 8 หลายเดือนก่อน

    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 8 หลายเดือนก่อน

      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

  • @BurtBot
    @BurtBot 2 ปีที่แล้ว

    Thanks!

  • @Mordaxe
    @Mordaxe 5 หลายเดือนก่อน

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

  • @riodjajoesman4989
    @riodjajoesman4989 10 หลายเดือนก่อน

    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?

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

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

  • @EmilKlingberg
    @EmilKlingberg ปีที่แล้ว

    Is there a performance impact for this?

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

  • @Fr33zE_YT
    @Fr33zE_YT 7 หลายเดือนก่อน

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

  • @anonyanony7469
    @anonyanony7469 ปีที่แล้ว

    Thanks, very simple trick.

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

  • @marcelogoycochea8195
    @marcelogoycochea8195 2 ปีที่แล้ว

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

  • @GlassVaultStudio
    @GlassVaultStudio 11 หลายเดือนก่อน

    Legit, ty!

  • @AlexanderLoaizaGameDev
    @AlexanderLoaizaGameDev ปีที่แล้ว

    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.

  • @williambnull2083
    @williambnull2083 2 ปีที่แล้ว

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

  • @Gejam_GameDev
    @Gejam_GameDev 2 ปีที่แล้ว

    wow thanks

  • @Lhite123
    @Lhite123 7 หลายเดือนก่อน

    thanks!

  • @dohannn5607
    @dohannn5607 ปีที่แล้ว

    thank you

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

  • @WelshGuitarDude
    @WelshGuitarDude 2 ปีที่แล้ว

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

  • @GurpreetSingh-jz3rx
    @GurpreetSingh-jz3rx 11 หลายเดือนก่อน

    Can this be implemented in 2D?

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

  • @porky1118
    @porky1118 11 หลายเดือนก่อน

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

  • @austindovel2139
    @austindovel2139 6 หลายเดือนก่อน

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

  • @maxmilianofreitas3063
    @maxmilianofreitas3063 11 หลายเดือนก่อน

    Muito Obrigado amigo!!!! :)

  • @Saltant
    @Saltant 7 หลายเดือนก่อน

    Not work with TAA, sadly =(

  • @danielcardin4329
    @danielcardin4329 2 ปีที่แล้ว

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

  • @pinterest-ej3gp
    @pinterest-ej3gp 2 หลายเดือนก่อน

    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

  • @DwipMakwana
    @DwipMakwana 2 ปีที่แล้ว

    What abut HDRP?

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

  • @sebaferrari_tattoo
    @sebaferrari_tattoo หลายเดือนก่อน

    not found in deferred

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

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

  • @starmapsllc
    @starmapsllc ปีที่แล้ว

    Thank you for this.