Search Unity

Question Creating a space skybox with moving dust clouds and glowing stars

Discussion in 'General Graphics' started by Cato11, Oct 14, 2022.

  1. Cato11

    Cato11

    Joined:
    Jan 5, 2021
    Posts:
    233
    I was hoping for some advice on how to go about creating a space skybox for my mobile game. I already know how to create the basic skybox itself with the six textures forming a cube etc., I already have something like this set-up, but now I want to take it to the next level. I'm quite a novice on graphics so I would appreciate some advice on:

    1. What is the best way to go about adding dynamic effects to the skybox? Things like dust clouds and fog, as you can see here:

      Screenshot 2022-10-14 at 19.47.44.png

      As you can see I want these effects to be subtle, i.e. clouds smoothly fading in and out across the screen.

    2. If the best way is to use a shader, please can you give me some practical tips on how to implement it? Where should the shader file be applied? It is a material added to the camera? Or the skybox itself? How should I implement the dust and fog effects? Should I take a some sort of cloud texture and use that as the basis to displace vertices in the vert function? What would the vertices even be for a skybox?

    3. How could I include other effects like stars faintly glowing in and out in the background? In the same shader, or a different one? How can it be implemented? I would like to have an occasional shooting star too.

    4. How can I ensure that performance is high on mobile? The game is a top-down endless runner style game, so I need the effects only to be active where the camera is pointing (orthographic and generally fixed). It's not an open world where the player can look around freely in any direction. I am targeting high frame rates so these factors should make it easier to achieve a high frame rate, right?

    If someone could give me some advice on the above I would really appreciate it. I'm quite surprised how few tutorials and guides there are online about how to do the above. It seems quite standard but I can't seem to find any advice. If you know of any articles please do link them here.
     
  2. Cato11

    Cato11

    Joined:
    Jan 5, 2021
    Posts:
    233
    Hi All, I've made some progress on points 3 and 4. I was wondering if someone could offer advice on points 1 and 2? Since I need to move a fog/smoke effect across the skybox, how should I do it? Normally I would use a material attached to a gameobject, where the shader displaces a smoke texture. But since the skybox is not a gameobject in the hierarchy, I am not sure how to go about this.

    Here is a clearer picture of what I am aiming for. You can see the fog and clouds in front of the stars, I want to gently move those across the camera.

    devon-mackay-zG4l0ZydhRk-unsplash 2.jpeg

    Any tips would be really appreciated.
     
  3. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    use camera stacking, set one camera to draw depth only, set the other cameras depth lower. Make some stuff that only renders to one camera using layers.
     
  4. Cato11

    Cato11

    Joined:
    Jan 5, 2021
    Posts:
    233
    Thanks for the advice.. but when you say “make some stuff”, can you offer any advice on that? That’s the bit I actually need help with.
     
  5. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    thats the bit no one can do for you ;)

    If you have the camera stacking working, you are 90% of the way there. The realtime skybox contents are up to you.