Search Unity

Skydome

Discussion in 'Editor & General Support' started by Alpha-Loup, Jan 9, 2008.

  1. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    I am currently trying to build a skydome. In small levels it is no problem, but in a large scale scenario the dome is much too big to be seen by the main cam with the desired camera-setting. I dont want a max culling of 15 km just to make sure the dome can be seen from each edge of the terrain... That would definetly ruin performance.

    What can i do?

    Thanks in advance!

    Frank
     
  2. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    If I understand your question correctly, why not just parent your skydome and main camera to an empty game object so it moves (but doesn't rotate) with your camera. Depending on how your camera moves/rotates, you may have to do some fancy coding, but that's the general idea.
     
  3. pete

    pete

    Joined:
    Jul 21, 2005
    Posts:
    1,647
    do you have to use a dome? a camera's skybox doesn't get culled by the far clip setting.
     
  4. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    Yes i do. A skybox uses plenty of textures for a not so good effect at all. A skydome can be modyfied ingame by changing gradients. The result is much cleaner and the whole system gives lots more options.

    I would prefer keeping the dome steady because of the planned cloud simulation... The plan is, to create a simple but convincing environment simulation including day-/night-cycle, and some weather effects so that they can be called during the Game, when they are needed.
     
  5. pete

    pete

    Joined:
    Jul 21, 2005
    Posts:
    1,647
    can you put your sky set up on a different layer and use a second cam?
     
  6. Doug

    Doug

    Joined:
    Oct 19, 2007
    Posts:
    36
    Create another camera. Render the skydome camera before your main camera.

    You can clear the depth buffer without worry on the main camera since the skydome is always behind everything.
     
  7. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    Thanks guys! That did the trick. Exactly the kind of easy solution i was searching for!
     
  8. KlaRo115

    KlaRo115

    Joined:
    Feb 24, 2006
    Posts:
    675
    Or try to create a skybox with movies in place of the textures.
     
  9. KlaRo115

    KlaRo115

    Joined:
    Feb 24, 2006
    Posts:
    675
    Or try to create a skybox with movies in place of the textures.
     
  10. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    Better not. I am trying to use as less resources as possible. And 6 movies at an acceptable resolution could not be considered anywhere near "less"... to create them would be a real pain and the performance drop when playing 6 movies in real time... But thanks anyway. Any idea is welcome.

    On a skydome you can get a nice clean atmospheric gradient effect with a single texture using 64 x 256 pixels or simply use an animatable gradient shader for day/night effects... and you can use projectors on it without getting artefacts you would have when projecting into the corner of a skybox for example...

    Skydomes offer much more control, they are easier to use and consume less resources while presenting better results.
     
  11. KlaRo115

    KlaRo115

    Joined:
    Feb 24, 2006
    Posts:
    675
    That's right, but a skydome is difficulter to create... :)
     
  12. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    Go to your 3D App, create a sphere, cut it in half, turn the normals inward... apply a gradient texture... import to unity, create second camera and set the cam parameters as stated above in this thread... It takes about 15 minutes including texture creation...
    To have clouds, create a mesh with some dozen loose polygons... import to unity, apply a particle mesh emitter and a particle renderer... remove the mesh renderer... and again 15 minutes later you can have controllabe volumetric clouds...
    Add another hour for tweaking the dome texture, cloud particles and cloud mesh. There you go.

    I never created a convincing skybox texture in such a short time... usually it takes many hours and without the correct software packages you can easyly spot the corners of the box, because the textures are not correctly curved...
     
  13. KlaRo115

    KlaRo115

    Joined:
    Feb 24, 2006
    Posts:
    675
    :eek:
    Ok...
    A sphere? No problem... A texture? :? ...
     
  14. omarsr

    omarsr

    Joined:
    Dec 22, 2007
    Posts:
    76
    Why not carry this to the next step? You can leave the whole sphere in place, have it rotate slowly and texture a night portion on it. Then you have a moving sky with sun and moon.
     
  15. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Wow this sounds great, I definitely planned a 'dynamic' weather system as an integral part of my gameplay and I'm not that keen on the cube skybox either - got any screenshots or web players you could show?
    Cheers
    Boxy
     
  16. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    That is the plan. But i will use a changing gradient to achieve that effect.

    @ Gaston - Look at (or just use) the attached texture to color your skydome. Use a cylindrical projection

    @boxy - here you go. I used the enclosed texture on the example skydome and a light that hits the skydome only. The clouds are created from the standard assets smoke particle. The scene took just a few minutes to set up. And it would take only a few more minutes to get the colors right, so it would look like a real sky ;)
    I am currently testing to get more depth into the clouds. Maybe i can use bumpmaps on particles to achieve that. Another option would be a fresnel shader or so... any other ideas are welcome. I will post more results soon.
     

    Attached Files:

  17. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Looks like an interesting idea. I will see if I can follow your instructions :)
    Thanks
    Boxy
     
  18. KlaRo115

    KlaRo115

    Joined:
    Feb 24, 2006
    Posts:
    675
    That's your texture? :)
    Very simple. I'm going to start creating my own skydome now! :p
     
  19. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    I´ll post a little .unitypackage this evening, so you can see how it works.
    Maybe we can get a nice environment simulation from this here together.
    My skills are mainly on graphics, so i will concentrate on creating better effects.

    Is anyone willing to do some coding? F.e. spawn cloud meshes and move them around, change colors, maybe a gradient shader, sunrotation... so we end up with a nice environment wizzard?
     
  20. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Sounds like a nice idea:) Only thing I've noticed is that on my macbook pro there is a definite gradient banding, which isn't serious but means you can tell the sky object isn't as big as a planet :) Maybe that is just down to compression?
    Cheers
    Boxy
     
  21. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    716
    why couldn't you apply a gradient to a sky box. so you would only need 3 textures for that; top, bottom and gradient sides. that way you will have that infinite effect that the sky box does so well.

    then make a skydome for the moving clouds and other effects. so you base you cloud nulls off the sphere curvature. then use a directional light for the sun movement.

    but i agree i would love to see this moved to the collaborative section of the forum and see this turn into a nice little realtime environment modeling project.

    cheers.
     
  22. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    I havent found the time to build a unity-package, but attached you´ll find a webplayer with skydome and moving clouds.

    @thylaxene - i agree that a skybox can do certain things quite well, but again i have to create a gradient with very exact curving. I dont want to do that... painting straight or just do a gradient in photoshop is much easier and of better quality.

    @boxy - I can see that banking effect too here. Maybe i should increase the gradient to 1024 in height for a smoother look.

    The next step will be a texture projection on the skydome for additional atmospheric effects...
     

    Attached Files:

  23. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    Instead of using a light, that illuminates the skydome-layer i used a self-illuminated texture in the attached example... The banking is gone now.
     

    Attached Files:

  24. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Very cool. Its nice to see moving clouds in an environment, works really well. Going to have to find some time to try and learn this one :)
    Cheers
    Boxy
     
  25. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
  26. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69
    Hi. I have the same problem with a Space game. I have a huge SkyDome and some times my spaceship camera doesn't render my skydome although its FAR is larger than the Dome. I really don't understand the solution of this problem. It happend only in my mobile phone, but not in my PC. :(

    Thank you very much for your help.
     
  27. fairchild670

    fairchild670

    Joined:
    Dec 3, 2012
    Posts:
    69
    Just thought I'd chime since I've encountered similar issues - what seems to work so far is using a separate camera at the lowest depth that has a culling mask set to only render a special "skybox" layer. This layer contains the skydome mesh, ships in the sky, clouds, or anything far away. The farClipPlane values can be set to extreme distances and it works with culling as well. Also I just offset the sky texture for movement (w/ careful UVmapping to keep things in proper perspective).
     
  28. ohlin

    ohlin

    Joined:
    Mar 3, 2013
    Posts:
    17
    I'm wonder could you write a special shader. With cull front and fog off.