Coder Social home page Coder Social logo

simple-stochastic-planet-shader's Introduction

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

simple-stochastic-planet-shader's People

Contributors

michaelega avatar

Stargazers

Daniel S. avatar Trent avatar Baris avatar Jean-Philippe Deblonde avatar Enrico Speranza avatar mika avatar  avatar Michael Mauderer avatar

Watchers

 avatar

Forkers

unitycoder

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.