Search Unity

(Truly) Procedural Planet Generator

Discussion in 'Assets and Asset Store' started by Jazzer008, Sep 1, 2013.

  1. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Hello!
    $NRbanner.jpg
    Web-player Demo : http://slipspace.co.uk/ppgdemo/
    Asset store : https://www.assetstore.unity3d.com/#/content/10716

    Update: Added a C# script version and some editor gradients to create custom coloured planets.

    $D68axk2.jpg

    Update: Added night-lights. As usual, the web-player demo is constantly up to date.

    $9iLLz1v.jpg

    Update: Integrated the cloud shader into the main planet shader. Updated the web-player demo.

    $u27dfAR.jpg

    Update: Added gas giant to default planet types and improved atmospheric lighting.

    $lWlxRL2.jpg

    This is my first asset for the store and I would really appreciate some feedback towards it, including the price...too little, too much? All the code is open source, shaders and all, so I currently feel like $25 is a reasonable target.

    I'm committed to upgrading this package slowly over the coming weeks/months.

    You can see recent updates to the package above, planned updates are listed below:

    - Improved land generation algorithm
    - Improved cloud generation algorithm
    - Color ramp support (gradients)
    - Equatorial color variation
    - Craters
    - Improved surface resolution / detail
    - C# script variant
    - Unity 3.5 support


    The package works by adding a single script to any consistent gameObject on the scene. You can always dynamically add the script as well if you wish.

    Anyway, thanks for reading/viewing/becoming interested, and please, please provide me with some feedback, any features you'd like to see are more than welcome, please check the listed upcoming features list first.

    Thanks a lot,
    Jared

    PS: I'll be adding better images and logos to the asset store soon. :D
     
    Last edited: Jan 21, 2014
  2. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Forgot to mention that the lighting system is an update. It's in the hands of the Unity review team so it could take anything from a couple hours to a couple days, usually the former.

    Edit: To anyone reading this, the update still hasn't gone through! Should really be in the next couple of days though, if you'd like to grab the asset at $15 before it goes up to $25...now's your chance! :p
     
    Last edited: Sep 5, 2013
  3. NandusMasta

    NandusMasta

    Joined:
    Apr 9, 2011
    Posts:
    63
    I was just looking for something like this, there are far too few examples of proceduraly generated content in the asset store. This certainly looks great and if you implement half of what you plan, it will no doubt become awesome and certainly worth of a price bump by the way. I will be watching this one closely for updates.
     
  4. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    It's neat that you have this working procedurally with realtime adjustment.. but in terms of quality if someone wants to use this in a game, it seems (based on the webplayer) that the quality isn't quite there.. do you have maybe a high-res version?
     
  5. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    I'm including this asset within my own game development so the quality is definitely set to increase over the coming weeks. Better lighting, atmospheric scattering and much higher resolution planet surfaces. As well as a greater variety of planet types and color variations.

    My target is something very similar to this (Limit Theory) : http://www.youtube.com/watch?v=t6vVziWb00U

    Thanks for the interest and stay tuned!

    Jared
     
  6. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Yeah, until the quality ramps up quite a bit, I can't see using that even in my hobby game at any price. It's going to be a challenge, since you're going up against some tools that have been out for a while. One of the worst kept secrets in this area is the LunarCell Photoshop plug-in from I think six years ago. I've done some tests with generating textures from that and using the Space Graphics Toolkit planet shaders, and until you can at least get to that level of quality (which still isn't exactly AAA quality, especially as you get close to the planets), I would have to wait and see. That plug-in can generate bump maps for terrain, specular maps for oceans vs land, and even city lights for populated planets (visible on the dark half).

    If you can get to that higher quality level, I'd say you could charge quite a bit more for it!

    Here are my planets so far. In the real game, I wouldn't use the exact same clouds like that for every planet of course!
    http://www.stevetack.com/misc/planets.png

    I suppose for an apples-to-apples comparison, I could turn off the clouds, but you get the idea.
     
  7. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Of course there are many tools available to 'pre-generate' planetary textures and normal maps and these will have a headstart in terms of resolution and graphical quality. I will work really hard to push my tool as far as it will go but the primary benefit of my tech is that it's all generated in code and therefore allows for limitless combinations and variations of planets. To get the same level of variety with 'pre-generated' textures would take up a vast quantity of space and time.

    Even so, as I've said the quality is set to increase, hopefully dramatically. Night lights are fairly simple for me to implement and are on their way soon, all the planets are going to get bump mapping in the next update and I'll be continuously be upgrading the surface texturing tech and lighting.

    I don't expect anyone to purchase until they feel comfortable with the asset itself, no need to believe my promises, but please stay subscribed to this thread if you're interested in the tool and it's potential.

    Thanks a lot!
     
  8. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Right, I guess it's unfair to compare pre-rendered with on-the-fly textures. I can definitely see how dynamically-generated planet textures could be useful for certain types of games.
     
  9. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    really? so why purchase your package? does it require the user to make his project also open source?
    i think what you mean is source is included in the purchased package. right?
    language c#?
    Edit: i have seen in the package contents that it uses js. that is a dealbreaker for me. otherwise i would have been quite interested.

    do i have control over this to make my own types? maybe provide a colorramp?

    do the planets allow craters?
    what noise is used. how many octaves?
    can gas giants be created?

    i'm in need to display a rectangular map of the planet so can i get the texture to achieve this?
     
    Last edited: Sep 4, 2013
  10. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Hello!

    The code can easily be converted to c#, would you like me to include a c# PlanetGenerationScript in the next update?

    What I mean by open source code, is that all my source code, is open. :p

    You do have control over lots of variables. Currently the colours are set using 5 different levels, Peak, 3, 2, 1, Shore and Ocean. I will be updating very soon to allow colour ramps for the land however. Oceans will have a separate ramp as well.

    I haven't thought about craters but that's a pretty good idea! I'll look into adding them soon.

    Perlin noise is used, currently at 4 octaves.

    Gas giants can easily be created with this tech, and are on the list for a future default planet type, this currently also includes moons and 'metal'.

    Hmm, the way the tech currently works wouldn't allow you to grab a 'texture' from it and successfully display the planet how you'd want. But if this is a top requested feature I could look into adding easy functionality for generating 'maps'.

    Thanks for the interest!
     
  11. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Interesting. It is possible to change the color of surfaces?
     
  12. NandusMasta

    NandusMasta

    Joined:
    Apr 9, 2011
    Posts:
    63
    I second the motion for a c# version, it will certainly save us c# programmers the time to convert it and that can only be good. It would be cool to have a flat map of the surface as well, it would surely be great for having ground battles in there as well.
     
    Last edited: Sep 4, 2013
  13. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Hi!

    Yeap, dynamically if you wish. Currently you have to script in color changes but I'll be adding values to the inspector in the next update.

    Also coming in the next update will be color ramps, at the moment there are 5 colours to set, Peak, 3, 2, 1, Shore and Ocean. This will change into two gradients or 'color ramps', one for the ground and one for the ocean. On planets types like rock and moon, only the ground ramp will be used. Of course these are just the defaults, you'll be able to create your own planets as you wish.

    This is my first asset so everything isn't as user friendly as it could be, as time goes by however, each update will make it easier and easier for you to accomplish whatever configuration and planet setup you desire.

    Thanks for your interest.
     
  14. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Hey again Nandus,

    Yeah, a c# script will definitely be included in the next update. (I'm still waiting for Unity to accept my lighting update! They take so long.)

    I still don't know too much about the flat map representation, I will look into it though.

    Thanks!
     
  15. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Just updated the original post with a image showing the new specularity and bump mapping.
     
  16. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    It looks pretty good. For me the main thing that puts me off a bit is the perlin noise... it doesn't really look like a natural, organic planet. I think possibly it might be to do with your color palette partly? Like maybe the blue and green have too much saturation or something? The other issue I have with it is that it doesn't give me an impression of there being lots of subtle colors, it seems like one blue, one green and one brown, and all the clouds look thin and not cloud-like - no swirls or evidence of wind movement, etc. For me it still needs more polishing.
     
  17. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    if you want me to buy it yes ;). if you leave it to every customer in need this is not very userfriendly. and if you have an official version supplied with your package support will be easier for you i guess.

    assuming that 90+% of (non-gasgiant)planets and moons have no ocean the handling of oceans interests me and if it can easily be disabled if not required. you wrote something like this for moons.

    i'm interested in the setup of your planet so what is generated and produced by which "component". so what does the script and the shader, how is your sphere generated, how are your noise coordinates calculated?

    have a look at what i mean. this example shows that the resolution of noise is coarse at the poles as the pixels are much closer together there. so you need to take into account the positions of the pixels for the sampling of your noise. thats why i ask about the setup.

    what about the seed of a planet to reproduce it? do you seed the perlin noise itself or only the positions where the noise is grabbed?
     
  18. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Hello again,

    Yes still lots more polishing to do, and don't worry, planets will become a lot more 'realistic' over time, colours and surface generation algorithms and cloud generation algorithms.
     
  19. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    The way I do oceans is by choosing an ocean colour, take away the bump mapping and ramp up the specularity. :p

    This all works as my shader colours based on 'heights', or fake heights. I use the nosie generated to determine a height, then I colour the planet based on height. For instance, anything below 0.2 is ocean color. :p

    I know what you mean by flat map :p, I just don't know too much about how I would personally implement it using my tool. As I said though, I'll eventually look into it.

    And yes I think I have a seed for each planet, in fact I'm almost positive but I'll make double sure it's there in the next update. :p

    Thanks!
     
  20. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    $sfRIG6s.jpg

    Just a quick fix, used a little more sensible colouring. :p
     
  21. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Now they can! I've added a tool to 'stretch' the planet surfaces.

    $lWlxRL2.jpg

    I've updated the web-player demo as well.
     
    Last edited: Sep 5, 2013
  22. NandusMasta

    NandusMasta

    Joined:
    Apr 9, 2011
    Posts:
    63
    Those are some cool looking shots, specially the terran planet, with bump and specular maps. This is certainly progressing fast enough, if you keep this up, in a few weeks you'll have completed your plans for the asset. Thus I've hardly any doubt that I will be getting this one rather soon. Keep up the great work.
     
    Last edited: Sep 5, 2013
  23. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Thanks a lot!

    The lighting update that I submitted 3 days ago is soon to go live. If you want to purchase for $15 instead of $25 before it updates then be my guest. Otherwise, thanks for your generosity! :D

    I'll keep working hard, stay tuned! :)
     
  24. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Just integrated the cloud shader into the main planet shader, as well as touching up the default colors and adding a GenerateClouds tick box to the wep-player demo.

    The integration gets rid of a a little clutter and means the generated planet is a single gameObject with a single material and shader.

    $u27dfAR.jpg

    I'm not going to try cleaning up the code itself until I've finished adding all the planned features. I'll do the conversion to C# after the cleanup as well as adding comments to all the code, shader included. :p

    Thanks!
     
  25. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    To anyone who's bought this, or the owner himself, what kind of potential does this have to combine with a voxel engine to literally create a planet, like a large scale Spore planet?
     
  26. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Hello!

    Welllll... A year or so ago I was actually making planets with height variations applied to the mesh.

    $NATL8wm.jpg

    The thing is, it took way too long (in my opinion) to generate even a simple planet, it took around 7-15 seconds to do a single planet. However that was my first attempt, and a weak one at that, it's definitely possible for me to do, but not with this tool, and it would take around 2 months to perfect. But it would do what spore did with it's planets and spore did not use voxels, and neither would I.

    Having said that, I could also do a voxel planet generator! But once again, something like that would take extra time. Currently I'm focused on 3D planets with 2D texturing. After I finish this asset I will be moving on to other things almost instantly however, so if there's a big enough demand for a 3D planet with mesh height data, or a voxel planet, then I'm more than happy to invest some time into producing something profitable, it would be a fairly nice project to continue the 'planet' theme with. :p

    As for combining this tool with a spore or voxel like planet generator? Currently not too possible, if someone had some fairly decent scripting/shader knowledge it wouldn't be too hard however.

    And if you're desperate for me to make it work with your favourite planet generator, I could perhaps look into it.

    Anyhow, thanks for the interest!
     
  27. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Hurray!

    Unity finally accepted Planet Generator 1.05, this update brings:

    -Combined Atmosphere and Planet shaders into a single shader.
    -Added a initial version of lighting to shaders.


    Also, the price has finally been brought back up to $25. It may well go up again in the near future as I add more advanced features.

    I'll be submitting another update that will include all the recent changes I've made to the tool. This includes:

    -Integrated the cloud shader into the main planet shader.
    -Added gas giant to default planet types and improved atmospheric lighting.
    -Added specularity and bump mapping.
     
  28. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Hi Jazzer008,
    I'm enjoying seeing how this project is progressing, and i am looking forward to what future updates hold :)

    In the meantime i have a minor / unimportant bug to report. In v1.05 there is an SendMessage error at runtime. Caused at line 252 : gameObject.SendMessage("SetPlanet",Planet);

    I've looked through the script and did not see anywhere that the Planet is assigned a script to be able and receive a message so i just deleted the line.
     
  29. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Hello ForceX,

    Thanks for purchasing the asset! And yes sorry about that, it's for the demo scene script, totally unnecessary for anything else, I'll get that modified for the next update.

    Thanks for letting me know. :)
     
  30. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Added night lights:

    $9iLLz1v.jpg
     
  31. NandusMasta

    NandusMasta

    Joined:
    Apr 9, 2011
    Posts:
    63
    Hey Jared. Awesome progress with the lights, they do look great. A couple of questions though: is there a slider for specifying how dense the lights distribution is? Can we specify the clouds colour and density? How about another slider for how much bumpiness to get for the terrain? Does the latest iteration in the store have the c# script version as well? Sorry for the barrage, your asset is motivating me to go back to a personal project and as such it has me a little excited to tell you the truth ;)
     
  32. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Hello again!

    There is a float for light density, it's called CityLevel and you can find it on the material. The same goes for clouds but at the moment it may not work as simply. Cloud color is available for change and unfortunately I haven't added a bumpiness slider yet, or even a switch to turn it on or off, even though some of my planets use it in different ways, for example the Gas giants don't have any bumpiness. I'll have to put that in the next update.

    And very sorry but there is still no C# script, if you are thoroughly desperate I can whip one up and add it to the next update, but my plan was to finish the asset and all it's extra features and then convert the script, so I do it in a single shot, and get everything.

    Hehe, glad my work is motivating! There is a still a fair way to go with the planet generation. A ton of usability improvements for one, at the moment I wouldn't call it super-easy for someone to integrate the script within their own project...it isn't hard but it isn't super-easy. :p That's something I'm looking forward to fixing.

    By the way, most of what I talked about isn't included within the Asset as of yet, I submitted a new update to the Asset Store a couple of hours ago, that includes all the updates you've seen on this thread. It will probably take Unity a few days to review it however. I really wish they could do it faster, but they're a small team and must handle hundreds of reviews a day!

    Anyway thanks for your interest and stay tuned!
     
  33. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    i'd like to be able to rotate or see shots of the poles. if you do not have pinching and there's no texture trick, i'll have to pick this up..
     
  34. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Sure, will grab one for you in a second. No texture tricks, all perlin based shader generated textures.

    Edit: The "pinching" that you see on some textured spheres is a result of poor normal mapping. Because the normals and textures are generated on the fly this issue isn't present.

    2nd Edit: Forgot to mention that there is a web demo in the original post, you can try it out for yourself.
     
    Last edited: Jan 17, 2014
  35. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    So sorry I've taken so long to get that image. I got distracted by other work.

    $BpQu0sB.jpg

    As you can see in the image, where the mesh pinches the texturing does not. The normals and lighting all work fine as well. :)
     
  36. salex100m

    salex100m

    Joined:
    Mar 13, 2013
    Posts:
    103
    This is fantastic! Just what I was in need of. Congratulations on being my first asset store purchase!

    A few questions:
    1) Are you planning on implementing a bump map generator? If not, could you perhaps assist me in how I might set something like that up?
    2) Are you planning on making some of those hardcoded features editable? (for example, the base coloring of your base planet types)

    A few suggestions about how to improve the package (I haven't gone through the whole code so forgive me if I overlooked something):
    1) C#, C#, C#!
    2) Bump map generator (critical to making distinct planets)
    2a) Random features (like craters/mountains, etc)
    3) Liquid removal toggle (ocean vs no ocean)
    4) Star generator, and Asteroid generator
    5) Multi layered cloud system (would improve the look of Gas giant immensely)
    5a) More weather system effects (think plasma storms, auroas, basic lightning, etc)
    5b) Cloud based shading
    5c) Cloud cloud density, thickness, coloring etc should be easily editable for users
    6) City lighting density
    6a) Place-able city locations
     
  37. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Hi!

    Thanks a lot for the sale and for being so interested in the project! While I do the odd bit of work on the asset it's hard to justify when I only sell a couple a month on average. C# script versions are definitely coming and are actually quite overdue.

    I couldn't say how easy a bump map generator would be, but from first naive glance I wouldn't say it would be too difficult. Do you think there's a market for that in it's own right?

    With concern to planet colouring, I wanted to make colour ramps or gradients available in the editor. It's not too simple however and would require a few days implementation. It's something I have planned though. Otherwise you can always change the base colours in the javascript file.

    With regards to the rest of the suggestions, they are all things I've thought about but unfortunately without greater interest in the package I can't make any promises.

    I do have a working sun/star generator though, it's still fairly simple but it has an animated surface at least. I could eventually work it into the package as well.

    Anyway, thanks again and please don't hesitate to ask any more questions. :)
     
  38. salex100m

    salex100m

    Joined:
    Mar 13, 2013
    Posts:
    103
    I definitely think if you pack in some more of those features, you'd get a few more sales!

    I'm definitely looking forward to that C# version so I can start adding some things myself
     
  39. salex100m

    salex100m

    Joined:
    Mar 13, 2013
    Posts:
    103
    well, i couldn't wait so I ported it to C# myself... took about an hour

    Also I think this is a bug, not sure:
    line 297: Planet.renderer.material.SetColor("_AtmoColor",ShoreColor);
    ....not sure if you intended that.

    Also, when porting to C#, the debugger complains that the if statement starting on line 168 doesn't have a deterministic path for all the variables being set later. You can just fix this by initializing your colors (starting on line 124 to 148). For example the "moon" type doesn't have an atmosphere variable determined (I imagined this was intentional).


     
  40. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    Hi again. I actually just started improving the package. I'm planning on generally improving the whole thing and of course providing a C# version. While it will only take me a few days to add most of the upgrades, it may take up to a week for Unity to review and approve the update.

    I don't really see a bug on that line, there should be no space in ShoreColor but there wasn't one before. If you're talking about getting the Atmosphere color from the shore color, I used it so that atmosphere would be the same colour as the ocean.

    And again, I'm not too sure how you created the second issue. I'm planning on improving the script itself, simplifying and improving it's efficiency so by the time the update comes around, the new C# version may be quite different to yours.

    Either way, if you're still having problems I'll try to help, just let me know.
     
  41. salex100m

    salex100m

    Joined:
    Mar 13, 2013
    Posts:
    103
    Hey, thanks for getting back. Just wanted to update you:

    1) I wasn't sure if it was a bug or intentional, thanks for clearing that up.

    2) Also, the sphere model you provided was rotated oddly and then it looks like you compensated by transforming it in the code. That's fine, but when I tried to use my own bump map ad texture it wouldn't wrap right. I think standard texture sizes for planetary maps are [ 4096 x 2048 ] and you definitely don't want to tile. That's what I used below, on a simple Unity primative sphere (for now). After adjusting the rotation, it looks great, with no seams.

    $example.png

    thanks again
     
  42. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    I see now, you want to use a bump map texture for the entire surface. It does look pretty good. Is there anything I can do specifically to help this?
     
  43. Jazzer008

    Jazzer008

    Joined:
    Jan 16, 2013
    Posts:
    38
    So I've just submitted an update to the package. Should be here within a week hopefully.

    This update adds a C# script version as well as some Gradient editors so you can create custom coloured planets. The ground gradient reads from 4 points, the ocean from 2. So 4 colours for ground and 2 for ocean. I'll make this more dynamic in the future.

    $D68axk2.jpg
     
  44. jharler

    jharler

    Joined:
    Dec 23, 2013
    Posts:
    5
    I just purchased this asset and I'm getting a completely black planet. There are no error messages or anything to indicate what might be wrong. Any help would be appreciated.