render skybox on a separate camera

Hi All,

In my project I want to apply some effects to various game elements but I dont want those to affect the skybox.

I was reading the unity documentation and had the idea to disable the skybox in the project seetings and add the skybox component directly to the separate camera that I called skybox_camera, then changed the depths of the cameras and all good, one camera renders the map and the objects and the other camera renders the skybox alone.

But here is the problem…
I have for example bloom and glow scripts attached to the MainCamera that renders the maps and everything else, and for some reason those scripts are affecting the other camera that is there only to render the skybox. How come this is happening?
I even put the skybox camera in a separate layer and changed the MainCamera to not render that layer, still same thing happens.

Not all effects I am going to be using should affect the skybox because it wont look so good, so not all FX scripts will be in both cameras, some of them(like bloom and glow) will be only in the main camera, not in the skybox camera.

Thanks in advance :slight_smile:

Can you post a minimal scene with that here?

Just a skybox, and say, a cube, and the two cameras. Using layers should work fine and I can’t find anything really wrong with your description.

Thanks AcidArrow for your insight, I thought the same thing

Im uploading a project right now and will post the link in a few minutes as soon as the upload is finished.
When you check it just try enable and disable the main camera that has the scripts attached and you will see the skybox change when it actually should not.

Download link: http://www.megaupload.com/?d=OC46RAOM

Image effects work on the entire image coming out of a camera. This includes any pixels that were rendered by another camera but not cleared.

To stop glow on objects that should not glow, set their alpha to 0. This should also work for the skybox.

Hi tomvds thanks for your reply.

The only alpha I could change in the skybox was in the material tint, I could not find any other alpha to change, even though it did not prevent from the glow and bloom to affect it, it did decrease the effect on it but did not stop.

Is there another way to do that?

Hi, did you solve the problem?