ray-marching
Version:
Embedding ray marching in html files only
35 lines (27 loc) • 675 B
Markdown
# ray-marching
Embedding ray marching in html files only
## Install
From NPM
```shell
npm i ray-marching
```
or CDN
```html
<script src="https://unpkg.com/ray-marching@latest/lib/ray-marching.js"></script>
```
## Usage
```html
<ray-marching>
<script type="x-shader/x-fragment">
precision mediump float;
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
void main( void ) {
vec2 p = gl_FragCoord.xy / max(resolution.x, resolution.y);
gl_FragColor = vec4(p, mouse.x, 1.0);
}
</script>
</ray-marching>
```
