Jump to content

URP - How to setup second camera to render just Gaia clouds?


MeHowLipa
Go to solution Solved by Peter,

Recommended Posts

I'm trying everything but can't setup 2nd camera to render just clouds. I want to set small Clipping planes on main camera for performance, but then clouds are not visible.

I've duplicated main camera, renamed and put as child of main camera:
spacer.png

- Clouds are using CloudsLayer

I've created two URP renderers:

Main camera's is masking everything except CloudLayer
screenshot-2023-06-29-at-10-13-34-png.12

Clouds Renderer is masking only CloudsLayer:
screenshot-2023-06-29-at-10-14-51-png.12
 

Main camera settings:
Render type: Base
- using MainCamera Renderer
- Culling mask; Everything except Clouds Layer
- Stacked Cameras: CloudsCamera - Overlay

screenshot-2023-06-29-at-10-15-55-png.12

Clouds Camera settings:
Render type: Overlay
Culling Mask: CloudsLayer
Renderer: CloudsRenderer

screenshot-2023-06-29-at-10-17-26-png.12

What I'm doing wrong?
 

Link to comment
Share on other sites

  • Solution

Hi @MeHowLipa I have not tried yet to set this up with two cameras myself yet, but if you have the clouds on their own layers, you could set up a culling distance per layer instead of using multiple cameras.
Unity supports having different culling distances per layer, but does not directly expose this in the camera component anywhere. Luckily Gaia has a tool built in in the player controls for that:


image.png

Maybe this could be an alternative? 

  • Like 1
Link to comment
Share on other sites

19 hours ago, MeHowLipa said:

I'm trying everything but can't setup 2nd camera to render just clouds. I want to set small Clipping planes on main camera for performance, but then clouds are not visible.

I've duplicated main camera, renamed and put as child of main camera:
spacer.png

- Clouds are using CloudsLayer

I've created two URP renderers:

Main camera's is masking everything except CloudLayer
screenshot-2023-06-29-at-10-13-34-png.12

Clouds Renderer is masking only CloudsLayer:
screenshot-2023-06-29-at-10-14-51-png.12
 

Main camera settings:
Render type: Base
- using MainCamera Renderer
- Culling mask; Everything except Clouds Layer
- Stacked Cameras: CloudsCamera - Overlay

screenshot-2023-06-29-at-10-15-55-png.12

Clouds Camera settings:
Render type: Overlay
Culling Mask: CloudsLayer
Renderer: CloudsRenderer

screenshot-2023-06-29-at-10-17-26-png.12

What I'm doing wrong?
 

Hey,

I am not sure on your purpose to have the clouds on another camera, is there any specific reason why you need the clouds to be rendered separately? 

In URP Camera stacking is critical so what you do have here should work but it depends with rendering features when you have the clouds rendering as i think on our shader we rendering differently. 

What Peter has suggested can be another way to handle this by rendering the other layers closer together and the cloud layer very far. This would mean that the main camera would still need a far draw distance. 

Here is a unity tutorial on URP camera stacking maybe there was a step you missed - (9) Camera Stacking in Unity with URP! (Tutorial) - YouTube

Link to comment
Share on other sites

Thank you @Peter! I've been trying to fix this for half of the week and two cameras approach didn't worked well also. I didn't know that there a way to change culling distance per layer - it's such a gem! I'm created simple script to manipulate it on my camera (I'm not using Gaia camera and it's working great).

It's still not working with all Gaia GameObjects (such as Water or Clouds) but it's working on Trees so I can improve performance of rendering.


@Josh I wanted to render clouds on seperate camera to be able to increase culling distance large just for clouds and much smaller one for all the rest. The problem was that camera stacking & culling distance on those seems to not work with some Gaia Elements such as Water or Clouds. Disabling Gaia Planar Reflections was kind of fixing it with camera stacking but it was looking badly.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...