diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | credits.txt | 1 | ||||
-rw-r--r-- | index.html | 12 | ||||
-rw-r--r-- | pugl.js | 28 | ||||
-rw-r--r-- | style.css | 8 |
5 files changed, 39 insertions, 12 deletions
@@ -2,6 +2,8 @@ online shader thingamabob +the main files of interest are `index.html` and `pugl.js`. + ### JS features i have been pretty liberal about using modern javascript; diff --git a/credits.txt b/credits.txt deleted file mode 100644 index 94ffb57..0000000 --- a/credits.txt +++ /dev/null @@ -1 +0,0 @@ -https://commons.wikimedia.org/wiki/File:Long-beakedEchidna.jpg @@ -9,8 +9,8 @@ <link rel="stylesheet" href="style.css"> </head> -<body> -<script src="pugl.js"></script> +<body class="no-margin overflow-hidden"> +<script src="pugl.js" async></script> <noscript> <p> This page requires JavaScript to function.<br> @@ -80,14 +80,16 @@ <h2>about pugl</h2> <hr> <p> - Lorem ipsum dolor sit amet + pugl is a tool that lets you create & share shaders without writing any code. + </p> + <p> + to learn how to use pugl, check out <a href="guide/index.html" target="_blank">the guide</a>. </p> <h3>credits</h3> <hr> <p> icon based on - <a href="https://commons.wikimedia.org/wiki/File:Long-beakedEchidna.jpg -">Long-beakedEchidna.jpg from WikiMedia</a> + <a href="https://commons.wikimedia.org/wiki/File:Long-beakedEchidna.jpg" target="_blank">Long-beakedEchidna.jpg from WikiMedia</a> CC BY-SA 3.0. </p> <p> @@ -3,10 +3,6 @@ /* TODO: - guide -- about dialog -- widgets: - - min - - max */ const APP_ID = 'dh3YgVZQdX1Q'; @@ -911,6 +907,30 @@ float worley(vec3 p, vec3 freq) { return sqrt(sqd); } `, + ` +//! .name: Minimum +//! .description: minimum of two values +//! .category: math +//! .id: min +` + + GLSL_FLOAT_TYPES.map( + (type) => ` +${type} _min(${type} x, ${type} y) { + return min(x, y); +}`, + ).join('\n'), + ` +//! .name: Maximum +//! .description: maximum of two values +//! .category: math +//! .id: max +` + + GLSL_FLOAT_TYPES.map( + (type) => ` +${type} _max(${type} x, ${type} y) { + return max(x, y); +}`, + ).join('\n'), ]; function auto_update_enabled() { @@ -5,9 +5,7 @@ body { font-family: sans-serif; - margin: 0; padding: 0; - overflow: hidden; } body, dialog { @@ -254,3 +252,9 @@ input[type='number'] { .no-wrap { whitespace: no-wrap; } +.no-margin { + margin: 0; +} +.overflow-hidden { + overflow: hidden; +} |