Search Unity

Blender Skybox Generator (!Screenshot!)

Discussion in 'Made With Unity' started by AndrewGrayGames, Dec 18, 2009.

  1. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,821
    Blender Skybox Generator
    Current Version: 1.0

    [About]:
    The SkyBox Generator was a reaction I had to the built-in skyboxes that ship with Unity. While the premade skyboxes are great, I did want something that was completely my own. Since I am awful at art, I figured I would let Blender do it for me. After a couple of hours of tweaking, with finally a nice skybox as a result, it dawned on me that this may be useful to other indie developers.

    Oh - and it's free. :) My contribution to fellow indie developers everywhere.

    [Versions/Files]:
    v1.0 - Download
    This is the most basic version of the SkyBox Generator. It's pretty much the scene from the Noob-To-Pro Tutorial that outlines creating one's own skyboxes, except it's already done for you.

    [Controls]:
    -Azimuth/Zenith Blend: Select the "SkyMapper" dome (the top one). Select the Materials->Textures->Gradientizer texture. Hit the Color button, and play with the color band to change how the azimuth and zenith blend.

    -Clouds: Select the "SkyMapper" dome (the top one). Select the Materials->Textures->SkyMapper texture. Hit the Color button to play with cloud sizes and color. Change the NoiseValue to get different cloud densities.

    -Rendering: Render the scene (F5), then select the "CubeMapGenerator" cube (in the center of the scene). Select Materials->Textures, the cube only has the EnvMap texture on it. In the neighboring pane, there is a button labeled "Save EnvMap". Select a location (preferably inside your game project) and save the jpeg file.

    [Using Your Skybox in Unity]:
    In Unity, create a new Material->RenderFX/Skybox. Put your Skybox image as the image in all six slots. Blender's EnvMap rendering outputs in the following format (this courtesy of the Noob-to-Pro Tutorial:)

    Code (csharp):
    1. Left  | Back  | Right
    2. Down  | Up    | Front
    Unity detects tiles starting at the bottom left corner, so your settings will look like this:

    TileX (all faces): 0.333
    TileY (all faces): 0.50

    Offsets:
    Down: (0,0)
    Up: (0.34,0)
    Front: (0.67,0)
    Back: (0.34,0.5)
    Left: (0,0.5)
    Right: (0.67,0.5)

    I suggest playing with all of these values to secure a perfect fit. Editing the skybox image file may be necessary, too.

    [Screenshots]:

    This is a sample skybox. The artifact is my error - I mapped it on the cube wrong. Told you I suck at art, almost instinctively.


    This is a more recent addition - now, starfields and nebulae have been implemented in the SkyBox generator - some great nighttime skyboxes are only clicks away!

    [Updates]:
    Version 2.0 is going to streamline this. I'm creating a Python interface in Blender, so that it's more centralized and user-friendly. I'm also considering adding additional features like aurorae and nebulae.

    If you have any suggestions or question, please send me a private message!

    Enjoy my evil(e) creation!
     
    Arkade likes this.
  2. scarpelius

    scarpelius

    Joined:
    Aug 19, 2007
    Posts:
    966
    Very nice. One more thing to know about blender, ty :)
     
  3. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,821
    Heehee, no problem.

    The update to 2.0 is going well - I've got the GUI set down, now I just have to link the sliders to the scene.

    :)

    I'll edit this, and my signature, when I've got 2.0 ready to roll!
     
  4. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    This looks like a cool project. I haven't created any skyboxes in Blender yet but have thought about it more than once. I remember seeing threads on BlenderArtists for adding a realistic sun and particle clouds which I think would be a very nice addition to your project.

    Edit: I see how you're doing this now, an environment map on a cube instead of 6 different cameras, pretty clever! :)
     
  5. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,821
    Thanks, BigKahuna! I personally find it interesting I'm creating something art-oriented. If only there were a low-poly human generator...I should get cracking on that (but only after this is workable, of course!)

    Yeah, I was impressed with the method when I looked it up. I've played with colorbands before, just playing with noise-generated textures, and remembered that and that I can layer multiple textures together. I also enjoy taking walks, so I do pay attention to nature.

    What I would like to use this technology (so to speak) for is to create some really otherworldly skyboxes - we're talking Outland in WoW, for instance. I'm not sure how that will work, but all in good time! 2.0 is still very much a WIP.

    And I'm looking up those clouds and sun effects. I'm not sure that for Unity the sun effect is so important because that can be simulated via a lensflare linked to a light source.
     
  6. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
  7. Discord

    Discord

    Joined:
    Mar 19, 2009
    Posts:
    1,008
    http://blenderartists.org/forum/showthread.php?t=164884
     
  8. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,821
    Discord and BigKahuna, I want to marry you two. Nao. :p

    Seriously, that's pretty awesome, and gives me some serious hope with what I can accomplish with the SkyBox Generator!

    EDIT: So, I downloaded UniHuman and started using it - but there are no sliders, at least none showing in 2.48.

    :(

    I can still mess with this - it's an actual decent human model! I'm just sad that the customization is apparently left for my artistic judgement. Still, thanks for the link!

    RE-EDIT: Never mind. A little reading does the mind good. Figured out how to view the sliders - which is still more clever as that's also a python-free solution. I'm still gonna mess with Python for the Skybox Generator UI, though, because I'm a programmer and I do silly stuff like that.
     
  9. dbryson

    dbryson

    Joined:
    Nov 9, 2009
    Posts:
    269
    Thanks for this great blender file.

    This must be a stupid question, but how do you use the envmap directly on a skybox? The only way I have found to do it is to cut the envmap image into the separate images.
     
  10. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,821
    Directions on using the skybox have been placed in the original post!

    :D
     
  11. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    NEAT. This is awesome.
     
  12. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,821
    New screenshot added - starfields have been added! More features coming soon, along with the python interface!
     
  13. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Looks cool, so are stars in the version in the link? If so I can't find it. This is looking very nice!
     
  14. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,821
    Nope, haven't uploaded that one to my webspace yet. I've almost got nebulas working, and then I'll start on auroras. When I've got all that done, I'll get cracking on the Python interface again...when that gets done, I'm posting 2.0.

    All this, except perhaps the Python hooks, shouldn't take long.

    EDIT: I have nebulae in a more workable shape. The thing with nebulae is it takes a measure of art to pull them off really well, not just noise generators.

    EDIT the second: Upon seeing my nebulas hours after implementing them...they're really crappy, aren't they? No matter. I have a *snip* cut just for them. If Auroras wind up going down the same way, I'll just code the Python interface, and call that 2.0, and include the Nebulae and Aurorae in sub-version updates.
     
  15. Framklin

    Framklin

    Joined:
    Apr 3, 2011
    Posts:
    3
    Very nice man!

    I have some problems when i use it in unity though. The tiling settings for the skybox material doesn't seem to work, is there any settings for the texture file i need to change? Right now the skybox behaves like its not tiling at all so the whole picture is set up in every side of the skybox.
     
  16. LaurieAnnis

    LaurieAnnis

    Joined:
    Jan 24, 2010
    Posts:
    63
    Thank you so much for this generator! I'm having a lot of fun playing with it in Blender. I'm having the same issues as the person who posted above me however, with trying to get it to work in Unity. I was also unable to get ANY material texture tiling and offsets to work on any mesh inside Unity before I even tried this though, and before I saw this post I was thinking that I was the problem! Now I'm wondering if it could actually be a bug and have submitted a bug report.
     
  17. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Thank you, Kittycat astronaut Halo helmet kitty cat dude! :p
    I shall try it out as soon as I get a new laptop! :D
     
  18. zDemonhunter99

    zDemonhunter99

    Joined:
    Apr 23, 2014
    Posts:
    478
    This ... Was ... Posted ... 5 years ago....
     
  19. softwizz

    softwizz

    Joined:
    Mar 12, 2011
    Posts:
    793
    Yes ... but ... it ... still ... works ... (sort of)