Render Object at any Distance?

I have a number of objects that I want to serve as visual landmarks in an open world game; I think I understand how I would have them appear at any distance using two nested cameras and some different layers, but I can’t get it to work using cinemachine…

Help?

Can you give a bit more detail about your setup? Can you explain exactly what isn’t working? What do you expect, and what do you get?

Absolutely, I’m trying to set two render ranges, one for the foreground/landscape, and one for landscape elements to render.

Here’s a screenshot of the visual landmark I was talking about;

I have two CM freelook cameras, A and B and each of them has a camera, A and B, attached.

Camera A’s settings are as follows;

And camera B is:

The island itself is about 8km^2

As it is, Camera B doesn’t seem to render the sword at all, even though I have it on the culling Mask “Infinite Range” and Camera A has Infinite Range disabled.

I think I’m beginning to understand your difficulty.

Virtual cameras are not cameras - they’re just game objects that the Camera uses (via the CinemachineBrain) to position itself. There is only one Camera, and it only has one layer mask. Setting the layers of the vcams just puts them on the layers - it doesn’t affect the Camera’s layer mask.

You don’t attach Cameras to virtual cameras - I’m not really sure what you mean when you say you have Cameras A and B attached. You should just have one Camera, with a Brain on it, as a separate game object (no parental or child relationship to the vcams).

Note that the CinemachineBrain will only consider vcams on layers that the Camera can see (i.e. not filtered out by the mask). That’s how you would “attach” a camera to a virtuual camera.

If you want to set up a second Camera with a different mask, you can do that. You may or may not choose to use Cinemachine to control that camera as well. If you do, you can give it a CMBrain. In that case, you’ll have to put the vcams that control the second camera on a layer that the second camera can see, and not on a layer that the first Camera can see.

Does that make sense?

1 Like

So I have a CM FreeLook object, and it’s the parent of a Camera with the Cinemachine Brain on it. I don’t need these to have any parent-child relationship?

I’ll try and report back, thanks!

Yeah, I’m not understanding something here. How does the CM FreeLook know which Camera to focus on? It seems to set clipping planes for both Cameras…

5017709--491327--upload_2019-9-30_17-53-15.png

The brain filters the vcams by using the camera’s culling mask. Put FreeLook A on layer A, and have Camera A’s culling mask include layer A but not layer B. Do the corresponding thing for FreeLook/Camera/Layer B.

Described in a little more detail here: Can I use 2 camera with Cinemachine Brain?

I looked at that thread, as far as I can tell I’ve set it up, but it still doesn’t work.
5017892--491348--upload_2019-9-30_19-10-23.png

5017892--491351--upload_2019-9-30_19-10-43.png



I have the sword on layer B, and everything else on Layer A. The sword still won’t render…

The culling mask on Camera A is Layer A, and Camera B is layer B… Camera A’s layer renders.

Are both cameras rendering? Where does the output go? Can you, as an experiment, adjust the viewports so that each camera renders on a different half of the screen? I notice that FreeLook A is not live in its brain.

Both cameras are able to render.

I adjusted them so they render a different half of the screen, also set them to different culling layers, and it works in split screen mode;

When I change the viewport to go back to 1 camera view, however, I lose all rendering of the sword again… Aaaaaa

Where do you mean FreeLook A is not live?

Thanks!

It’s good that the sword is rendering.
At this point I don’t understand what you’re expecting to see when you make the top camera occupy the whole screen, other than the top camera’s output. Where are you wanting to see the sword?

I’m also making the bottom camera occupy the whole screen.

I’m looking to get the sword to render at any distance. It should be rendering in the distance regardless of how far away the player is because it’s on a separate render layer that would be dedicated to far away objects/terrain that are large enough to matter visually.

Does that make sense?

All Cinemachine does is to position the cameras. If you put the cameras in their respective positions and disable CinemachineBrains, does it render as you want it to? If not, then the problem is in your layering setup.