Search Unity

[RELEASED] Planet Generator Shader (With WEBGL Demo)

Discussion in 'Assets and Asset Store' started by HumanUnit101, Apr 26, 2017.

  1. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    A shader that creates planets in real time, using physical parameters as inputs. See for yourself in web demo!

    PM me if you want to use it, so I could give you a free copy.

    WEBGL DEMO








    Yeah, i know, i messed up store description. It should be fixed anytime soon. I hope.
     
    Mauri likes this.
  2. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Fixed some issues with scaling. Added liquid specularity slider. Added atmospheric emission toggle. Uploaded new version for review. Hope this is enough to bump my own thread
     
  3. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Just wanted to thank you for the big update with gas planets. They look amazing! Love the "flow" slider. And thanks for the ability to toggle sunset. Never had a wishlist come true that fast before!

    I noticed that you mentioned you had also made planetary rings. However, I can't seem find them in the 1.5.2 update. The prefab "Ring" has a purple "missing material", so maybe something is missing? No worries though, I still have more than enough already.

    Here are some screenshots from me playing around in 1.5.2:

    Arctic.jpg Continental2.jpg Jupiter3.jpg Lava_desert.jpg Moon.jpg
     
  4. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Just saw your reply to my review. Thanks for already uploading a fix! I'm in love with this asset :D
     
  5. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Oh yeah, i have a thread for this thing! Forgot about that.
     
  6. Gollunk

    Gollunk

    Joined:
    Oct 19, 2014
    Posts:
    42
    Hi, i have an issue with the shader. Here is a picture (the planet is the prefab into the package). Could you help me ?
     

    Attached Files:

  7. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Sorry, i was away. Does the problem still exist? Can you show me the material in that object? Also, there might be some problems with atmosphere shader if you using orthographic projection.
     
  8. JustMormegil

    JustMormegil

    Joined:
    Aug 12, 2013
    Posts:
    4
    Hi!

    Is there in-built C# API to generate planets based on planet type, seed etc? Think of using this asset in my space theme tbs.

    What kind of backgrounds can be generated? Are there animated effects of comets, flares and other space staff?


    Thanks in advance!
     
    Last edited: Aug 24, 2017
  9. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Backgrounds are just simple cube maps of stars and nebula. It's just something i came up with at random and decided to include it. You can check my star generator for stars, but other than that you really better off with something that designed with it as its primary feature.
    As about API. It's just a material, you can instantiate planet of a type you want from a prefab and change seed float in the material, using material.SetFloat("_RandomSeed",Random.value*100) or something.
    If you also want to generate volumetric atmosphere then you just need to clone your object for which you want to create atmosphere and apply atmosphere shader on it.
     
  10. JustMormegil

    JustMormegil

    Joined:
    Aug 12, 2013
    Posts:
    4
    Ok, thank you! Will play with your asset and integrate it. :)
     
  11. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Be sure to show me what you come up with. My planets are used in the Interstellar Space: Genesis, but i think they are going for minimalistic MoO2 approach and they could look better in your project.
     
  12. tango209

    tango209

    Joined:
    Feb 23, 2011
    Posts:
    378
    Is there a way to get the planets to work with point lights instead of a directional light?
     
  13. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    The planets or the atmosphere? Planets should work with point lights. There might be problems with PBR planet shader, so use nonPBR variant if something goes wrong. They look pretty much the same anyway. As for the atmosphere, i submitted updated atmosphere shader that can work with point lights. I'm gonna give it to you. Check your conversations
     
  14. strife77

    strife77

    Joined:
    May 15, 2014
    Posts:
    21
    Nice job on this. Just wanted to know if it's compatible with Unity 5.5.0? Thanks.
     
  15. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    I checked and there seem to be problems with it. I hope i was on time.
    Why do you use such old version anyway?
     
  16. GhulamJewel

    GhulamJewel

    Joined:
    May 23, 2014
    Posts:
    333
    Does this work with 5.6.1f1? Looks awesome would love to try it.

    *Edit*

    Tested works perfectly.
     
    Last edited: Sep 12, 2017
  17. strife77

    strife77

    Joined:
    May 15, 2014
    Posts:
    21
    Old? Lol. It's less than a year old. About 9 months, actually.. not exactly ancient.

    Because I prioritize stability, and many of the premium assets in the asset store have only been confirmed/tested to work through 5.5.0. Most notably Gaia/Gena.

    Also, because I loathe Unity's new subscription model.
     
  18. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    well, i created this shader in 5.6 and it still works fine with it, GhulamJewel confirmed it in PMs.
    I checked it again in 5.5 and it seems that it works fine but you need to reassign all textures in example materials. I thought there were some problems with shader itself when i tested it for the first time because everything was gray. I will submit the version for 5.5 tomorrow and it should be up soon after that. PM me if you bought it already and i show you which map should be assigned where.
     
  19. strife77

    strife77

    Joined:
    May 15, 2014
    Posts:
    21
    OK, thanks for the reply.
     
  20. Quidam2k

    Quidam2k

    Joined:
    Apr 6, 2015
    Posts:
    4
    I'm having an issue where the desert planet is showing up as flat black if all there is in the scene is a point light. Create a new scene, drag the desert prefab into it. Looks fine. Create a point light and move it near to it, you can see its effect. Delete the scene's default directional light, though, and the planet turns perfectly black.
     
  21. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Change shader to Human Unit/Planet. Without PBR at the end.
    That PBR stuff was a mistake.
     
  22. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,073
    Hi there! I’m using the generator substance to great effect and love it, but it adds like a solid 15 seconds to my scene load time. Is there a way I can bake it or something?
     
  23. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Yeah, you can set substances you use to "bake and keep substance" or "bake and discard substance". That way the textures will be baked on build. Or you can export them by pressing cog icon in top right of the inspector of substance. But that will require you to reassign exported textures to the material.

     
  24. yoonack

    yoonack

    Joined:
    Apr 29, 2016
    Posts:
    14
    Hi,
    I am wondering what's the performance on mobile device?
    thanks
     
  25. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Right now it is not really good, but i am working on the update, where i will try to optimize it for mobile.
     
  26. yoonack

    yoonack

    Joined:
    Apr 29, 2016
    Posts:
    14
    I am wondering if it is possible to turn off certain features to increase performance. Such as, no population and clouds for certain isolated planets. Would that be faster?
     
  27. StardustOveous

    StardustOveous

    Joined:
    Dec 29, 2017
    Posts:
    1
    Just wondering if you can "walk" on the planets you create? Looking to create a game like ksp where you can land on planets and then build stuff on it. Wondering if this would help create planets that are walkable and can input gravity and what not.
     
  28. justinbowes

    justinbowes

    Joined:
    Jan 8, 2015
    Posts:
    1
    Hi @HumanUnit101 . The city lights didn't work unless I added a directional light with intensity >= 0 to the scene (and emissive cracks are probably the same). I can understand why this is so, but my scene has a central point light source (sun) rather than a light of uniform direction.

    I modified the non-PBR shader to add a WorldSpaceLightPos parameter and use that instead of WorldSpaceLightPos0 in all declared passes. That works fine (remember to set W=1).

    Thanks for the great asset!
     
  29. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Hey, that's nice! Thanks!
    I am working on new version. The city lights work with point light there right out of the box. And it also has other things.


    Sorry everyone for being quiet for, like, half of a year. I was going through some rough times.
     
    GhulamJewel likes this.
  30. GhulamJewel

    GhulamJewel

    Joined:
    May 23, 2014
    Posts:
    333
    Hope you are better now. I watched your video really funny and your english is great btw! The new update looks amazing. The clouds look incredible. Really look forward having the lastest version. Few questions

    Will this version be more mobile friendly?
    Have you thought about adding weather?
    Possible to create impact craters on planets on collision with objects?

    Really great asset. Thank you.
     
  31. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Oh, come on man. Do not flatter me. That was cringy and you know it.

    I had a guy who tried it on mobile. And it is better, but still not enough. I need to make a simpler version for mobiles, but i doubt that that guy will want to do any business with me to test it out. I don't have a phone that can run anything on unity.

    Can you even see weather from space? I guess you can see lightning sparks. That's an interesting idea. I just need to feed random positions trough script, and then light them up with some noise.

    For craters, i guess you will be better off with sprites. Use alpha blended shader and use "Sphere cap" mesh, if craters are really big. You can also use cutout shader if you need shadows.
     
  32. Vladerc

    Vladerc

    Joined:
    Sep 27, 2017
    Posts:
    1
    Hoping the rough times are all behind you as I really enjoy this asset and it would be bad if the maintainer went away.

    Any way I can get my hands on the new build you're working on? Could really use the point light feature.
     
  33. Crystan

    Crystan

    Joined:
    Oct 11, 2014
    Posts:
    20
    So chances for mobile support in the near future are not so good? :( I just discovered this awesome looking asset and hoped I could use the planets for the space backgrounds of my shoot em up game.
     
  34. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Sure. Write me your invoice in private, and i send you what is done. Wich is everything except demoscene.

    Sorry, dude. I will keep trying, though. So check back from time to time.
     
  35. Blubberfisch

    Blubberfisch

    Joined:
    Mar 31, 2013
    Posts:
    5
    Hi there :)
    This asset looks like precisely what I need, although I plan to release my game for Android.

    Some questions:
    • Do I understand this correctly that you have several input textures and for each planet you offline-bake output textures? In the video I have seen 4 textures named "XXX_output".
    • How are textures mapped to planets? Just a cylinder mapping? What happens at the poles? Do the textures (e.g. heightmaps) have to be distorted/warped when I generate them?
    • Are the textures used at runtime suitable for the use of hardware texture compression? If there are just RGB and normal maps, that should be fine. However, there is no compression format suitable for plain grayscale textures, there are just RGB and RGBA formats.
    • I would be willing to try this on Android, if you are promising me to give me a refund in case this doesn't work out. I'm quite certain that it should work, though, maybe with some minor modifications. That you can't render a zillion planets fullscreen on mobile should be clear. I have a Nexus 5X phone and a Pixel C tablet to try on. It probably make sense if I try the not yet released new version?

    // Blubberfisch
     
    Last edited: Feb 16, 2018
  36. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Hi.
    Not exactly. More like you bake several input textures for several types of planets, and even that is not entirely true. For example:

    These three planets have the same input textures (except for clouds on one of them). The amount of textures you need depends on the variety you aim.

    Textures are mapped using triplanar projection. You can use completely flat, square and not warped textures, as long as they are tileable. There is no warping at the poles, as you can see in the video and in the demo.
    That is not true for the clouds trough. Clouds are layered with cylindrical mapping. Or whatever you used when making UV's. I still used projection, to get rid of pole problems.

    That is the thing i need to address. For some reason grayscale outputs of substances still show as RGBA Compressed (i set the outputs in the designer as grayscale with 8 bit luminance format), but there are no artifacts that are typical for that, and the resulting size and look are identical to exported textures that i set to single channel with alpha from grayscale and normal compression. If you will be experiencing some kind of problems you can just export generated textures and set the compression you desire.
    Also, the looks of the planets are not really sensitive to the resolution of some maps. For example, height map resolution change will only be really noticeable by the slight change in complexity of shores. Same goes for fertility map.

    I am pretty sure that it will work, but the question is will it perform at the suitable levels for you? I still have some gift codes left, so if you can help me with testing it for mobile i can just give it to you. Email me if you interested.
     
    Last edited: Feb 16, 2018
  37. Blubberfisch

    Blubberfisch

    Joined:
    Mar 31, 2013
    Posts:
    5
    Thanks for your quick and elaborate response. Send you an email.

    Note that my question about which textures are used was not only aimed at the memory requirement, but also the amount of texture-lookups the shader has to do for each pixel. So a list of textures and number of color channels would be nice. That would allow a guess at the shader performance.
     
  38. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    So every one would know i will answer in the thread.
    There are 7 input textures, all of them except for normal map are greyscale. There are also 2 gradient maps that are generated in runtime. All of them can be reused for different planets. You can also make a different planet of the same kind, using the same textures but change the random seed parameter in the material.
     
  39. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    What kind of errors? Are you using it with star generator? I reused some of the demo scripts from there and they are conflicting with each other. I already uploaded the new version for review. The issue is fixed in that one. In the meantime, you can just delete scripts from planet generator. They are used only in the demo scene.
    Speaking of. Heare the web demo for the new version:
    https://humanunit101.github.io/NewPlanetGenerator/
    To hide UI click on the selected option in the toolbar.
     
  40. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,122
    Hi, loving this asset so far, but I have an issue where the normal maps appear to reverse(?) from certain angles, and look like crevices instead of mountains. If it looks correct in the southern hemisphere, it can seem inverted in the northern hemisphere (and vice versa)…

    Could this be an issue with tri-planer normals and distance lighting?
     
    Last edited: Feb 22, 2018
  41. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Could be. I mean it is certainly is. Just odd. That kind of issue was present in the old versions, but i thought i'm dealt with it. Nevermind, i see you are using the old version. I had a major update just now. Download the new version. It should be ok with that,
     
  42. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,122
    :oops: oh… that was fast. Fixed!

    FIVE STARS! :D:cool:
     
    Last edited: Feb 21, 2018
  43. Crystan

    Crystan

    Joined:
    Oct 11, 2014
    Posts:
    20
    @Blubberfisch
    Since you're testing the asset on mobile, do you think you can report how well the asset runs on mobile? :) (Like how much 1 planet stresses the performance - drawcalls, polycount etc.)

    I've also noticed that the planet sphere seems to be quite "hight poly". Is it possible to use a less detailed model to improve performance?
     
    Last edited: Feb 21, 2018
  44. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,122
    Thank you for the help, yesterday. New shader is AMAZING.

    planet01-_7124.png
     
  45. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Earth.png Another update is coming. Hope constant updates are not too tiresome.
    Added more optimization, but can't say anything about mobile performance until the guy can test it.
     
    Crystan likes this.
  46. Crystan

    Crystan

    Joined:
    Oct 11, 2014
    Posts:
    20
    Have you heard any news from the test guy? If he's MIA and if you're interested you can send me a test version via mail or pm and I'll test it on my setup (Wiko Slide Phone) right away. Of course I wouldn't use the test version in a release without buying your asset.
     
  47. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Replied you in the PM.

    I am just saying it for everyone else, so no one would think that i ignored you : P
     
    Crystan likes this.
  48. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,122
    I have a feature request: could we get rivers on our continents?
     
  49. HumanUnit101

    HumanUnit101

    Joined:
    May 1, 2016
    Posts:
    31
    Rivers kinda hard to generate with just noise. I maybe have some ideas on how to make that with pixel processors to generate major rivers. The kind you can see from the moon (the fake kind i guess) and use a combination of noises to create those spider webby looking rivers that go from mountains to oceans.
    We'll see, right now optimization is my top priority, regarding this asset.
     
    wetcircuit likes this.
  50. joshua_42

    joshua_42

    Joined:
    Jun 23, 2016
    Posts:
    79
    Does it generate textures and normal maps etc? If so, can they be edited outside of unity?