Skip to content

Instantly share code, notes, and snippets.

@Toinne
Created November 15, 2015 15:28
Show Gist options
  • Save Toinne/7bf029e949de11a9dc3e to your computer and use it in GitHub Desktop.
Save Toinne/7bf029e949de11a9dc3e to your computer and use it in GitHub Desktop.
Flat Surface Shader Earth
<div id="container" class="container">
<div class="planet-bg">
<div class="planet-land"></div>
<div class="planet-shadow"></div>
</div>
<div id="output" class="container">
</div>
<div id="controls" style="display: none;">
</div>
/*
Matthew Wagerfield http://matthew.wagerfield.com/flat-surface-shader/
*/
<script src="http://www.danyuschick.com/codepen/earth/js/prefixfree.min.js"></script>
<script src="http://www.danyuschick.com/codepen/earth/js/dat.gui.min.js"></script>
<script src="http://www.danyuschick.com/codepen/earth/js/fss.js"></script>
<script src="http://www.danyuschick.com/codepen/earth/js/example.js"></script>
body {
-webkit-font-smoothing: antialiased;
padding: 0;
margin: 0;
}
.container {
position: relative;
height: 768px;
width: 1024px;
}
.planet-bg {
position: absolute;
z-index: 2;
height: 768px;
width: 100%;
background: url(http://www.danyuschick.com/codepen/earth/BG.png) no-repeat center center;
}
.planet-land {
width: 100%;
height: 768px;
background: url(http://www.danyuschick.com/codepen/earth/landMass.png) no-repeat center center;
}
.planet-shadow {
position: absolute;
top: 0;
z-index: 2;
width: 100%;
height: 768px;
background: url(http://www.danyuschick.com/codepen/earth/shadow.png) no-repeat center center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment