[Advanced] Rendering a Scene Using 2 Cameras W/Different Clipping Planes?

Looking for some good discussion and ideas on this one folks!

So we have a very nice visualization of earth as part of out game now, and a nice Satellite and some debris objects to go with it. Now we realise that we’re going to have to breach reality ‘a bit’ in terms of the scale of the orbiting objects relative to the Earth, but we’d like to make the objects considerably smaller than they currently are, but still be able to get close to them. Unfortunately, the issue with the clipping planes prevents us having objects we can get close to that are so different in scale to one another, unless we want to start seeing some huge visual glitches or clipping.

We’re in a situation where we would have to render the Earth and surrounding environment using one camera with a more distant clipping plane, and the satellites and closer objects with a different clipping plane. I can’t imagine that Unreal has an easy way to do this by default, but if anybody has a good idea on where to start, I’d like to hear more, even external resources if anybody knows of anything!

TL;DR - Can I render an actor on screen using a different camera with different near/far clipping planes to allow it to be tiny in comparison to other scene objects?


Bacon Butty Bump!

Heya - I’ve tried doing something similar a few months ago, wanting a space scene miniature rendered by a “background” camera and my player etc. renderer full size with another camera on top… Unfortunately Unreal doesn’t support that kind of workflow as only a single camera can be active at times. A few things you can try are:

  1. Making your planet… well, gargantuan.
  2. Rendering the planet to a render texture and projecting it onto a plane
  3. Dynamically switch to the “close up” camera as you near objects that need to be displayed with it.

Unfortunately, other than that I am not sure how you’d be able to achieve the effect you need.

It definitely doesn’t seem like anything that’s been done before as far as I can tell, so whatever we try I think we’ll have to go deep into engine code if we want to pull it off. There are a couple of issues with the suggestions you had though for us specifically, though I imagine they’d work for others:

  1. Unfortunately making the planet enormous is a problem in itself, as the calculations we perform in code start to lose precision quite significantly when objects orbit at larger radius’, which can make for very jumpy and inaccurate results.
  2. We need to be able to zoom in and out and see the planet in the background (it’s visual fidelity is one of the selling points of the project). They really need to behave as if they’re in the same place.
  3. Could work, but we’d likely get distortion on meshes that are very far away. As I understand it the clipping planes exist because everything must be in a 0-1 range, and floating-point precision makes the distances… well, weird as the range gets bigger.

Thanks for the ideas though, we’ll just have to brainstorm a bit more! Where there’s a will there’s a way…