HDRP multiple cameras.

I was using second camera for GUI in built in pipeline.
Now I switched my project to HDRP everything worked until I have turned on the fog, resulting in a very buggy result on screen.

Is there a way to use multiple cameras in HDRP ?

No, HDRP only supports one camera, if you add in a second one, your performance will take a dump.

1 Like

The way to handle multiple camera in HDRP is to use graphic compositor:
https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@10.0/manual/Compositor-Main.html

however it isn’t mean for game performance. For GUI we have added a rendering pass “after postprocess” that you can condigure on the material which allow to render UI without extra camera: Surface Type | High Definition RP | 10.0.0-preview.27

2 Likes

What’s the best way currently to render UI to a render texture (for in-game displays etc.). I’m currently using multiple cameras which affects performance really badly.

2 Likes

Did you find an answer to this?

Is it possible to render UGUI and TextMeshPro after postprocess (in a separate camera)?

hi,did you find best way?thanks

No…

hi,did yout try"Graphics Compositor",link–https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@10.0/manual/Compositor-User-Guide.html

i feel this is ok but you try it. search in google.thanks

According to this thread, HDRP compatible shaders for TextMeshPro should be coming out relatively soonish.

1 Like

Graphics Compositor is the only way at the moment, or wait for the updated shaders…

@SebLagarde Hi, in unity 2020.3.3 HDRP , I want to add a camera to let the Lit Shader Mode to Forward and the base camera to Deferred .Is it possible?

In HDRP you can do this under custom frame settings \ rendering (on the camera). This works very well, I am using it.

Have you tried using custom passes?
https://github.com/alelievr/HDRP-Custom-Passes

I need a second camera to enable NPCs to sample light levels at places where player is not even looking. So there is no way around it I believe.

And the performance hit is huge.
Even though the camera is extremely small and has almost all frame settings disabled. I only need it to sample light levels on specific positions (both real-time and baked, lighting and shadows is all that matters).

Can I improve performance any further?

@SebLagarde <3 ?

I’m trying to get FPS weapon camera clipping done in HDRP, If I understand correctly, to have an FPS weapon camera, I need to set the weapons to LayerX and set the Weapon Camera to only render LayerX, while the main camera renders all layers except LayerX, and in the compositor I should add 2 layers (one for main and one for weapon)?

If that is the way, it’s not working for me… for some reason the weapons camera renders the entire frame (I can see it in the compositor preview) even though I set it to render the weapon layer only…

Any help would be appreciated.

Compositor is not intended for games, so that way probably isn’t going to work out for you.

Take a look at this:
https://github.com/alelievr/HDRP-Custom-Passes/blob/master/Assets/CustomPasses/FPS%20Foreground/FPSForeground.cs

Thanks a lot!! That seems to work, there’s only one issue… the object the player carries have nested meshes, with this shader pass the internal meshes are showing on top of each other in a weird way. e.g. a picture frame, the edges of inside picture are not being culled by the wooden frame around it, because all of them are being set to the “AlwaysOnTop” layer. Any suggestions?

Another issue, is that somehow I can see ghost like effect for anything behind the objects rendered on the custom pass

Changing the DepthTestOverride to be writeEnabled and use LessEqual for comparison might help with this. It may also have to do with how your materials are writing to the depth buffer. You’re probably going to have to tweak the Custom Pass to really get the effects you want.

You can try changing the injection point. This is probably SSGI or SSAO rendering after the custom pass is completed, which I haven’t really found a solution for. Another thing you’ll have to fiddle with, I think.

1 Like