Search Unity

Multiple skyboxes/suns in one scene?

Discussion in 'Unity 5 Pre-order Beta' started by Psycho-Designs, Feb 24, 2015.

  1. Psycho-Designs

    Psycho-Designs

    Joined:
    Oct 9, 2013
    Posts:
    13
    Hi all,

    I'm trying to have 1 scene with two areas. I want each area to have its own skybox, main directional light (sun) So I can go from one to the other with a portal. I want to make sure that I can see the sky of the other area through the portal.

    If I can do this with multiple scenes and some sort of streaming solution, that'd be great, but I don't think it's possible. Any ideas?
     
  2. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    10,176




    I have an idea of how it could be done.

    In the next version of Sky Master i will have a sky box mode for my sky system, for full Unity 5 integration and maximum performance (no script calculation for harmonics etc, since it will act as a skybox and grab everything from the included system)

    The dome system will remain intact though and could be used to separate the two environments.

    For example one would show the Sky box version and the other the dome version. It would need some extra scripting to control both skies separately, but should be possible.

    The shader is almost ready too, as seen in the pics above (these use a skybox and not the dome of the current Sky Master version)
     
  3. Psycho-Designs

    Psycho-Designs

    Joined:
    Oct 9, 2013
    Posts:
    13
    I just checked out Sky Master, it looks pretty cool! Do you have a blog or a newsletter where I can keep up to date with the progress?
     
  4. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    10,176
    Thanks :). I keep updates mainly in the WIP thread

    http://forum.unity3d.com/threads/sk...ays-particles-gi-unity-free-pro.277618/page-3

    And this is the thread i post a summary of updates and all discounts for my packs

    http://forum.unity3d.com/threads/sa...-creator-giproxy-skymaster-infinitree.291088/

    I have now finished the sky box shader version and is working great and i will integrate to my main script tomorrow. This will use a different material then the dome sky, so the script will be able to update both skies at the same time, with different options.

    Then these will be tweaked to work with the new scatter fog system, which is also in an advanced state of development.

    Here is pics of the result in Unity 5, this is the skybo shader (no dome used)


     
  5. Psycho-Designs

    Psycho-Designs

    Joined:
    Oct 9, 2013
    Posts:
    13
    Oh wow, they look great! I look forward to trying it out when it's ready!
     
  6. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    10,176
    Thanks :), the new shader based skybox does integrate a lot better with everything in Unity and especially in Unity 5. The current dome solution would require sampling to get the same result in Unity 5.

    I am trying to make a demo too, but the GI baking is getting stuck in my laptop (or is a bug, since i have seen similar reports here).

    What system is used for the portals ? It would be great to create a demo with such an arrangement and if a solution from the store is used, i could make it compatible and offer a scene to be used with that asset.
     
  7. Psycho-Designs

    Psycho-Designs

    Joined:
    Oct 9, 2013
    Posts:
    13
    That'd be cool! For the portals, we're using the render to texture feature with a camera that mirror's the player's camera and a volume that teleports the player. We'll be happy to set up a demo with you!
    The portals are functional but not perfect yet. They should be ready in a week or so.

    Drop me an email at Mohannad@Anamorphine.com
     
  8. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    10,176
    Great, a demo would be nice so i can adjust and test the system with something tangible. I will send an email.

    EDIT: Ok, message sent :), will definitly be a very cool application if it works out well
     
    Last edited: Feb 25, 2015
  9. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,847
    I don't want to interrupt this guys sales pitch, but if all you want is two different skies in the same scene, you can put a skybox component on the camera and change the skybox for that specific camera.
     
  10. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    10,176
    That is interesting, i had no idea you could do that. Will the Global Illumination and IBL be calculated separately for each camera's skybox in this case ?

    I suppose the camera without that component will use the globally defined skybox.
     
  11. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,847
    I'm assuming that the lighting would all be calculated correctly, but I haven't tried it. Doesn't take more than a minute or two to setup though, I know it works, as I just tried it. :)

    And yes, the one without the skybox component used the default sky.
     
  12. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    10,176
    How do you give different sun positioning in each skybox ? The technique seems very usefull. I just got to use Unity Pro through the asset developer's version and some of these techniques are brand new to me.

    The closest i got to using two cameras is the sprite creation module in my new Toon Effects Maker pack :) and that is not for real time use either.
     
  13. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,847
    I don't want to sound like I'm an expert on this, especially with beta software. But if I were to try to do it, I would hook into the OnPreRender and just change it. Honestly, from here on out I don't have a lot of advice, just that you can do the two skyboxes just fine. :)
     
  14. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    10,176
    So i gather there is no direct way to separately control the two skyboxes. If the OP means that needs a separate sun (like watching a sunset in another planet while on your own) i would still suggest a look at Sky Master that will support two completly controllable skies (either as sky dome - skybox or skybox - skybox with the method you mentioned).

    Your method would work even better with Sky Master, since it would allow a completly separate weather and clouds system as well in the other place.

    A major issue is directional lights from the two suns that would light everything, this could be solved with layers maybe ?
     
    Last edited: Feb 26, 2015
unityunity