Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Simple-Stochastic-Planet-Shader [Free on GitHub]

Discussion in 'Assets and Asset Store' started by MichaelEGA, Mar 16, 2023.

  1. MichaelEGA

    MichaelEGA

    Joined:
    Oct 11, 2019
    Posts:
    45
    Simple Stochastic Planet Shader

    A simple procedural planet shader with stochastic texturing

    Get it here: https://github.com/MichaelEGA/Simple-Stochastic-Planet-Shader

    Tested In: Unity URP 2022.2.9f1

    Version History
    17/03/2023 - Initial commit

    Planet Shader Features
    • Generates texture from heightmap (great if your procedurally generate heightmaps with say Libnoise)
    • Looks good from far away to midrange
    • Eight different terrain colours
    • Three different detail textures: ground, water, and lights
    • Control scale of detail textures
    • Control metalic and smoothness of textures
    • Triplanar texturing (so that textures look right regardless of angle)
    • Stochastic texturing (avoids texture repition)
    • Shadow attenuation (so the dark side of the planet is black)
    • Control whether lights appear on the dayside or just on the darkside of the planet
    • Control spread of lights
    • Animate and control speed of water texture
    • Control strength of heightmap and normals
    • Nine example planets to fiddle around and have a look at
    Cloud Shader Features
    • Input detail cloud texture for detail
    • Control scale of cloud detail texture
    • Control alpha threshold of cloud detail texture
    • Stochastic texturing (avoids tiling of cloud detail texture)
    • Shadow attenuation (so that clouds on the dark side of the planet are black)
    • Triplanar texturing (so that textures look right regardless of angle)
    • Animate and control speed of clouds so they move across the planet, unform and reform
    • Control metalic and smoothness of clouds







    How To Use
    • Drag the planet sphere into the scene
    • Drag in your selected heightmap (the higher the resolution the better it looks)
    • Fiddle around with the heightmap strength until it looks right
    • Add in your ground and water and light textures (or just use the samples provided)
    • If your making a desert planet or similar use the ground texture in the water slot and make sure that the water speed is set to 0 so that the ground doesn't appear to move
    • Set the colours for the different heights of the heightmap
    • Set what height you'd like lights to appear from... something above 0.55 is good if you dont want them to appear in the water
    • 'Lights Visibility' controls the degree to which lights appear on the dayside of the planet
    Credits
    All content is licensed under Apache 2.0 unless otherwise stated
     
    Last edited: Mar 16, 2023
    Thygrrr likes this.