Skip to content

MichaelEGA/Simple-Stochastic-Planet-Shader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Simple-Stochastic-Planet-Shader

A simple procedural planet shader with stochastic texturing

Get it here: https://github.com/michael-evan-allison/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

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

Planets03

Planets01

Planets04

Lights

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

About

Generates a planet texture from a heightmap (includes cloud shader)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages