<commit_before># Shadertoy for Elm

[Shadertoy](http://shadertoy.com/) is ... elite.

You write your shaders in GLSL, and game logic and physics in Elm.

The Elm code here is forked from 
<NAME>'s [first-person-elm](https://github.com/evancz/first-person-elm) demo.

Make sure you have the latest version of Chrome or Firefox and then click the
following image to try out the **[live demo][demo]**:

[![Live Demo](resources/ScreenShot.png)][demo]

[demo]: http://kfish.github.io/elm-shadertoy/

## Build Locally

After installing [the Elm Platform](https://github.com/elm-lang/elm-platform),
run the following sequence of commands:

```bash
git clone https://github.com/evancz/first-person-elm.git
cd first-person-elm
elm-get install
elm --make --only-js --src-dir=src Main.elm
elm-server
```<commit_msg>README.md: add 'Coding with Shadertoy' setion<commit_after># Shadertoy for Elm

[Shadertoy](http://shadertoy.com/) is ... elite.

You write your shaders in GLSL, and game logic and physics in Elm.

The Elm code here is forked from 
Evan Czaplicki's [first-person-elm](https://github.com/evancz/first-person-elm) demo.

Make sure you have the latest version of Chrome or Firefox and then click the
following image to try out the **[live demo][demo]**:

[![Live Demo](resources/ScreenShot.png)][demo]

[demo]: http://kfish.github.io/elm-shadertoy/

## Coding with Shadertoy

Shadertoy defines various inputs to fragment shaders. elm-shadertoy provides
compatibility for the following:


```glsl
uniform vec3      iResolution;           // viewport resolution (in pixels)
uniform float     iGlobalTime;           // shader playback time in seconds
```

elm-shadertoy additionally defines 'elm_FragCoord'.

```glsl
varying vec2      elm_FragCoord;         // texture-space fragment coordinate
```

Replace all occurrences of `gl_FragCoord.xy / iResolution.xy` with `elm_FragCoord.xy`.


The following Shadertoy inputs are not yet supported by elm-shadertoy:

```
uniform float     iChannelTime[4];       // channel playback time (in seconds)
uniform vec3      iChannelResolution[4]; // channel resolution (in pixels)
uniform vec4      iMouse;                // mouse pixel coords. xy: current (if MLB down), zw: click
uniform samplerXX iChannel0..3;          // input channel. XX=2D/Cube
uniform vec4      iDate;                 // (year, month, day, time in seconds)
```

## Build Locally

After installing [the Elm Platform](https://github.com/elm-lang/elm-platform),
run the following sequence of commands:

```bash
git clone https://github.com/evancz/first-person-elm.git
cd first-person-elm
elm-get install
elm --make --only-js --src-dir=src Main.elm
elm-server
```
{'fraction_non_alphanumeric': 0.11872659176029962, 'fraction_numerical': 0.003745318352059925, 'mean_word_length': 3.613126079447323, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7599230', 'n_tokens_mistral': 865, 'n_tokens_neox': 842, 'n_words': 278}