Can this be done? If so how?

I think this is possible… But I am not sure… This is the scenario.

I have a large sky bubble which I want in a fixed position away from the player. However have a much shorter distance on the clip plane. Say the bubble is 1000 but the far clip plane on the camera is say 450. Is it possible to still render the skybubble and have the Far clip shorter? If so which shader(s) would work?

Thanks for your time.

Sincerely,

Gary Haus

You can use one camera for the bubble, which only renders the bubble and which has a large far clip plane. And another camera for everything else, with a small far clip plane.

–Eric

Eric,

Thanks for the tip. Is this possible on Unity iPhone Advanced? If so, how? I apologize about the lack of knowledge on my part in regards to ‘layering’ of cameras.

Sincerely,

Gary

Yes, use two cameras with the camera “on top” having a higher depth and clear flags set to depth only, and the culling masks for the cameras should be set for the appropriate layers.

–Eric

Eric,
Thanks. I am trying to find a tutorial on this concept. I have done what you suggested, but now I am at the point of not understanding how to ‘combine’ those cameras in the rendering pipeline to get them display their respective ‘rendered’ parts to the player. I have no clue how to move forward.

If you have a link to an assemblage like this or further information, that would be greatly appreciated.

Sincerely,

Gary

The only other thing I can think of is that the two cameras need to move the same way. So, for example, if your main camera was the child of the player then, using this technique, both cameras need to be the child of the player and should have the same position and rotation. Other than that, aside from what I’ve posted, there isn’t anything else to do.

–Eric

Here’s what you want to do:

  1. Duplicate your existing camera, and make the duplicate a child of the original. Call the child SkyboxCam or something.
  2. Set the depth on the original camera to something higher, so that it renders after the skybox camera.
  3. Set the clear flags of the original camera to “depth only”
  4. Adjust the near and far clipping planes of both cameras so that they fit the things you want them to render.
  5. Now put the skybox on its own layer, and set the skybox camera to only render that layer, and the regular camera to render everything but that layer.

Gentlemen,

Thank you very much! I have the concept down now.

Sincerely,

Gary Haus

Holy god that looks amazing. :]

Looking forward to experimenting with multi cams.