Search Unity

Planet Generator - fast and flexible tool for runtime and static planet creation

Discussion in 'Assets and Asset Store' started by GrUm, Apr 16, 2019.

  1. GrUm

    GrUm

    Joined:
    Apr 5, 2012
    Posts:
    5
    A thread for questions and discussions about that ASSET
    https://assetstore.unity.com/packages/tools/modeling/planet-generator-143223




    Planet Surface Generator
    (c) Sergey Sychov, 2019
    This product is distributed under Unity Asset Store Licence. All rights reserved, Illegal copying is prohibited.

    Hello. This is Planet Surface generator - an ultimate tool to create planets.

    Contents

    - Editor window tool to generate textures and materials during development.
    - Scripts to create planet surfaces at runtime.
    - Few demo colormap textures for tree types of planets.
    - Shaders:
    - "PlanetGenerator/Planet", to render planet surface faster.
    - "PlanetGenerator/Planet Normal", to render planet with normals.
    - "PlanetGenerator/Atmosphere", to render a atmospheric glow around planet. Commonly used as second material on sphere mesh. See example scene.
    - Two optimized sphere meshes with more precise polar uv-mapping.
    - Clouds texture, to create animated clouds on planet surfce.
    - Example scene demonstrating both pregenerated and runtime-generated planets.

    Basic concept

    PSG tool uses simple colormaps and fractal noise algorithms to generate random landscape. Colormap is simple piece of texture wich define how to color a pixel of surface knowing it's local height (x-axis of colormap) and polar altitude from the planet's Equator (y-axis of colormap).

    For example, if we're going to create Earth-type living planet, on the left side of color map we should draw a color of deep sea. At the middle draw a colors of shores and plains, and at the right side should be the mountains and heights. At the bottom of color map will be equatorial biomes while at the top will be a north/south pole.

    description.png

    You might notice, that there are two color maps. Second one is actually a colormap for glossiness. It will produce gloss-map for planet. Seas and oceans must reflect suns even if we viewing from space.


    NOTE!!! Import options for color maps!

    For better visualisation and artifact avoidence please use following import settings for any custom created color maps!
    - Wrap mode: Clamp
    - Filter mode: Bilinear or Trilinear (Any but Point)
    - Compression: None


    Surface Options

    There are few basic options besides colormaps defining how surface will look like:
    - Seed is simple 32 bit integer, defining pseudo-random sequence of numbers that will generate map. Using same Seed with same settings you will achieve same surface each time.
    - Resolution is a height of surface textures in pixels.
    - Sea level defines average height level of surface. Than higher this value is, than more mountains you'll get and vice versa. Normal value is 0.5.
    - Scale defines how small will be the biggest recognisable structure on surface. Will there be a continents or myriades of isles.
    - Scale cascade defines "fuzzyness" of visible structures or how curvy a shores will be.
    - Weight is initial height of biggest structures/continents.
    - Weight cascade is how high are a smaller structures such as mountains, isles, valleys etc.
    - Crater amount defines how many impact craters surface will have.
    - Max Crater Radius is maximal possible radius for random crater set. This value is relative where 1 means radius of planet.
    - Max Crater Height is maximal possible random height. NOTE that height of crater is simply added to height of surface. If sea level, weight and crater height is high enough it can easily go over the top value (1.0) and create unpleasant artifacts.


    Using Editor Window

    To create a surface in editor open window at "Window/Planet surface generator".
    Choose color map to define albedo of surface and optionally gloss map to define how glossy surface will be.
    Once setup is over, click "Generate" button to see results.
    To save and apply results click "Save" or "Save As" button.
    "Reset" button drops set up to defaults.


    Scripting API

    To use generator at runtime first create HeightMapOptions object. Use it to define a setup similar to described above.


    Code (CSharp):
    1. HeightMapOptions options = new HeightMapOptions();
    2. options.CraterAmount = 5;
    3. options.MaxCraterRadius = 0.3f;
    4. options.MaxCraterHeight = 0.34f;
    5. options.SeaLevel = 0.45f;
    Then put seed, options and colormaps into Generate method and get the texture pack:

    Code (CSharp):
    1.  
    2. PlanetTextures textures = TextureProcessing.Generate(seed, options, _template.ColorMap, _template.GlossMap);
    3. Texture2D albedoTexture = textures.Albedo;
    4. Texture2D effectsTexture = textures.Effects;
    5. Texture2D normalMap  = textures.Normals;
     
  2. crazymahone

    crazymahone

    Joined:
    Mar 17, 2017
    Posts:
    7
    Can you tell me what the compatibility is with more recent versions of Unity such as 2018 or 2019? Because there are a lot of material assets that seem to break in 2018.
     
    Last edited: Aug 24, 2019
  3. GrUm

    GrUm

    Joined:
    Apr 5, 2012
    Posts:
    5
    Hmm, just checked it in 2018, looks fine. Can you describe problems little more precisely?
     
  4. shirley_unity512

    shirley_unity512

    Joined:
    Aug 12, 2020
    Posts:
    2
    upload_2022-2-14_17-23-2.png upload_2022-2-14_17-24-51.png
    Hi:
    I am trying out your generator, but where is the save/save as button described on step 5 of the Quickstart.txt? I like what it generated, but I would like to save the planets out too.
    Thank you,
     
  5. shirley_unity512

    shirley_unity512

    Joined:
    Aug 12, 2020
    Posts:
    2
    ok I figured it out.. You might want to point out the save/save as button is in the editor window, not the example scene. :)