glsl-earth
Quickly get a spinning Earth-like planet on a black background in GLSL. This is not distance field rendering, just a 2D effect.
precision mediump float; uniform float iGlobalTime;uniform vec3 iResolution; # planet = require('glsl-earth') void
PRs welcome for improvements/optimizations.
Usage
vec3 color = planet(vec2 uv, vec2 resolution, float size, vec2 rotation)
Gets a planet based on the screen uv
and resolution
. The size
is how big the planet shoul be, where 1.0 fits the screen. rotation
is how much to rotate the planet.
vec3 color = planet(vec2 uv, vec2 resolution, float size)
The same as above but with no rotation.
vec3 color = planet(vec2 uv, vec2 resolution)
The same as above but with no rotation and a default size of 1.0
License
MIT, see LICENSE.md for details.