marching
Version:
Marching.js is a JavaScript library that compiles GLSL ray marchers.
25 lines (22 loc) • 493 B
HTML
<html>
<head>
<script src='./dist/index.js'></script>
<style>
canvas { width:100%; height:100% }
body { margin:0 }
</style>
</head>
<body>
<canvas></canvas>
</body>
<script>
window.onload = function() {
Marching.export( window )
Marching.init( document.querySelector('canvas') )
const s = march( Marching.Sphere() ).render()
window.onresize = function() {
s.resolution( .5 )
}
}
</script>
</html>