Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

HDRP & Multiple Cameras

Discussion in 'Graphics Experimental Previews' started by CortiWins, May 20, 2019.

  1. CortiWins

    CortiWins

    Joined:
    Sep 24, 2018
    Posts:
    150
    So what's the state of art now when it comes to using a gun-camera in an FPS with HDRP?
    • Stacking cams doesn't work anymore.
    • Does a solution exist?
     
    Zipe92, Incar_Jack and Jack31081988 like this.
  2. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    In hdrp 4.10 you can write PP effect for this. In the 5.+ we can't do even that, because PPv3 is not extensible and PPv2 doesn't work, so I see no solution right now.
     
  3. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Was just about to create a thread on this too.

    In some threads, people have mentioned workarounds to camera stacking/multiple cameras, but those workarounds have their own set of problems.

    LWRP is getting its own workflow for camera stacking, but how about HDRP?

    How can we get different post processing with UI vs game world?
     
  4. CortiWins

    CortiWins

    Joined:
    Sep 24, 2018
    Posts:
    150
    So people doing FPS with HDRP have now all their weapons clipping into walls and thinking "oh maybe unity will fix it some day?" There has to be a way. How does the Unity FPS Sample do it?
     
  5. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    FOV change in shader for the hands and weapons
     
    CortiWins likes this.
  6. CortiWins

    CortiWins

    Joined:
    Sep 24, 2018
    Posts:
    150
    Thanks for the answer! I guess i'm not experienced enough to understand what that means and how to replicate it. Does a guide exist for that? Didn't find anything on youtube.
     
  7. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    855
    in the fps project that unity has on github there is a shadergraph for the first person weapon models that changes the fov. its worth checking out as it pretty much negates the need for a second camera solution(for weapons at least).
     
  8. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    The FPS example seems great for overlaying something in front of the view, but what about for far away objects?

    For example, planets and other distant objects in space. This is trivial with camera-stacking and sort order, but how would you accomplish this in HDRP? Objects with huge scale at extreme distances means extremely far clip plane and problems associated with that. Doing it via render textures causes a lot of other problems as well.

    Is there or will there be a method of handling this elegantly in HDRP?
     
  9. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Can any Unity HDRP dev give a suggestion of how to accomplish the above? Thanks.
     
  10. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    Use a skybox
     
  11. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Thanks. The background objects are loaded individually and dynamically based on certain things, and some of them move slightly, so I can't put them in a skybox.

    Anyway, for now I'm able to use a really large far clip plane. This causes problems with shadow flickering, but it's something I can try to minimize by messing with the near clip plane.
     
  12. meikellp

    meikellp

    Joined:
    Apr 6, 2014
    Posts:
    9
  13. Ultroman

    Ultroman

    Joined:
    Mar 10, 2014
    Posts:
    110
  14. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    It is working if you are not using fog on any of them (and maybe with some additional restrictions). But is really expensive.
     
  15. Tornadoally

    Tornadoally

    Joined:
    May 16, 2020
    Posts:
    11
    Anyone have an answer, I just need something working, I don't care if there are 2 cameras or whatnot. I find making it really small and in front of the camera to be weird, seems like there would be a lot of issues (With what I'm making, because I have special interactions involving the location/size) . :D
     
  16. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789

    If you are using HDRP 9.0.0 and Unity 2020.1 or later then you can use the Compositor
    https://docs.unity3d.com/Packages/c...h-definition@10.0/manual/Compositor-Main.html
     
  17. Tornadoally

    Tornadoally

    Joined:
    May 16, 2020
    Posts:
    11