Minor changes and documentation

This commit is contained in:
schmelczerandras 2020-10-12 16:11:55 +02:00
parent cdcac35b68
commit 25c112f0e5
22 changed files with 376 additions and 244 deletions

View file

@ -3,8 +3,8 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Droplet | SDF-2D - v0.4.0</title>
<meta name="description" content="Documentation for SDF-2D - v0.4.0">
<title>Droplet | SDF-2D - v0.4.1</title>
<meta name="description" content="Documentation for SDF-2D - v0.4.1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<link rel="icon" href="../favicon.ico" />
@ -23,7 +23,7 @@
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">SDF-2D - v0.4.0</a>
<a href="../index.html" class="title">SDF-2D - v0.4.1</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
@ -127,7 +127,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L60">drawables/shapes/droplet.ts:60</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L55">drawables/shapes/droplet.ts:55</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -158,7 +158,7 @@
<div class="tsd-signature tsd-kind-icon">from<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">vec2</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L63">drawables/shapes/droplet.ts:63</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L58">drawables/shapes/droplet.ts:58</a></li>
</ul>
</aside>
</section>
@ -168,7 +168,7 @@
<div class="tsd-signature tsd-kind-icon">from<wbr>Radius<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L65">drawables/shapes/droplet.ts:65</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L60">drawables/shapes/droplet.ts:60</a></li>
</ul>
</aside>
</section>
@ -178,7 +178,7 @@
<div class="tsd-signature tsd-kind-icon">to<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">vec2</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L64">drawables/shapes/droplet.ts:64</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L59">drawables/shapes/droplet.ts:59</a></li>
</ul>
</aside>
</section>
@ -188,7 +188,7 @@
<div class="tsd-signature tsd-kind-icon">to<wbr>Radius<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L66">drawables/shapes/droplet.ts:66</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L61">drawables/shapes/droplet.ts:61</a></li>
</ul>
</aside>
</section>
@ -206,7 +206,7 @@
<aside class="tsd-sources">
<p>Overrides <a href="drawable.html">Drawable</a>.<a href="drawable.html#getobjecttoserialize">getObjectToSerialize</a></p>
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L85">drawables/shapes/droplet.ts:85</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L80">drawables/shapes/droplet.ts:80</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -233,7 +233,7 @@
<aside class="tsd-sources">
<p>Overrides <a href="drawable.html">Drawable</a>.<a href="drawable.html#mindistance">minDistance</a></p>
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L71">drawables/shapes/droplet.ts:71</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L66">drawables/shapes/droplet.ts:66</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -256,16 +256,16 @@
<aside class="tsd-sources">
<p>Overrides <a href="drawable.html">Drawable</a>.<a href="drawable.html#descriptor">descriptor</a></p>
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L11">drawables/shapes/droplet.ts:11</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L11">drawables/shapes/droplet.ts:11</a></li>
</ul>
</aside>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
<a name="descriptor.empty" class="tsd-anchor"></a>
<h3>empty</h3>
<div class="tsd-signature tsd-kind-icon">empty<span class="tsd-signature-symbol">:</span> <a href="droplet.html" class="tsd-signature-type">Droplet</a><span class="tsd-signature-symbol"> = new Droplet(vec2.fromValues(-100000, -100000),vec2.fromValues(-100000, -100000),0,0)</span></div>
<div class="tsd-signature tsd-kind-icon">empty<span class="tsd-signature-symbol">:</span> <a href="droplet.html" class="tsd-signature-type">Droplet</a><span class="tsd-signature-symbol"> = new Droplet(vec2.create(), vec2.create(), 0, 0)</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L54">drawables/shapes/droplet.ts:54</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L54">drawables/shapes/droplet.ts:54</a></li>
</ul>
</aside>
</section>
@ -275,7 +275,7 @@
<div class="tsd-signature tsd-kind-icon">shader<wbr>Combination<wbr>Steps<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = [0, 1, 4, 16, 32]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L53">drawables/shapes/droplet.ts:53</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L53">drawables/shapes/droplet.ts:53</a></li>
</ul>
</aside>
</section>
@ -285,7 +285,7 @@
<div class="tsd-signature tsd-kind-icon">uniform<wbr>Count<wbr>Macro<wbr>Name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;DROPLET_COUNT&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L52">drawables/shapes/droplet.ts:52</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L52">drawables/shapes/droplet.ts:52</a></li>
</ul>
</aside>
</section>
@ -295,7 +295,7 @@
<div class="tsd-signature tsd-kind-icon">property<wbr>Uniform<wbr>Mapping<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L46">drawables/shapes/droplet.ts:46</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L46">drawables/shapes/droplet.ts:46</a></li>
</ul>
</aside>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
@ -304,7 +304,7 @@
<div class="tsd-signature tsd-kind-icon">from<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;froms&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L47">drawables/shapes/droplet.ts:47</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L47">drawables/shapes/droplet.ts:47</a></li>
</ul>
</aside>
</section>
@ -314,7 +314,7 @@
<div class="tsd-signature tsd-kind-icon">from<wbr>Radius<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;fromRadii&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L49">drawables/shapes/droplet.ts:49</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L49">drawables/shapes/droplet.ts:49</a></li>
</ul>
</aside>
</section>
@ -324,7 +324,7 @@
<div class="tsd-signature tsd-kind-icon">to<wbr>From<wbr>Delta<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;toFromDeltas&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L48">drawables/shapes/droplet.ts:48</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L48">drawables/shapes/droplet.ts:48</a></li>
</ul>
</aside>
</section>
@ -334,7 +334,7 @@
<div class="tsd-signature tsd-kind-icon">to<wbr>Radius<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;toRadii&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L50">drawables/shapes/droplet.ts:50</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L50">drawables/shapes/droplet.ts:50</a></li>
</ul>
</aside>
</section>
@ -345,7 +345,7 @@
<div class="tsd-signature tsd-kind-icon">sdf<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L12">drawables/shapes/droplet.ts:12</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L12">drawables/shapes/droplet.ts:12</a></li>
</ul>
</aside>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
@ -354,7 +354,7 @@
<div class="tsd-signature tsd-kind-icon">distance<wbr>Function<wbr>Name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;dropletMinDistance&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L44">drawables/shapes/droplet.ts:44</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L44">drawables/shapes/droplet.ts:44</a></li>
</ul>
</aside>
</section>
@ -364,7 +364,7 @@
<div class="tsd-signature tsd-kind-icon">shader<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &#x60;uniform vec2 froms[DROPLET_COUNT];uniform vec2 toFromDeltas[DROPLET_COUNT];uniform float fromRadii[DROPLET_COUNT];uniform float toRadii[DROPLET_COUNT];float dropletMinDistance(vec2 target, out float colorIndex) {colorIndex &#x3D; 1.0;float minDistance &#x3D; 1000.0;for (int i &#x3D; 0; i &lt; DROPLET_COUNT; i++) {vec2 targetFromDelta &#x3D; target - froms[i];float h &#x3D; clamp(dot(targetFromDelta, toFromDeltas[i])/ dot(toFromDeltas[i], toFromDeltas[i]),0.0, 1.0);float currentDistance &#x3D; -mix(fromRadii[i], toRadii[i], h) + distance(targetFromDelta, toFromDeltas[i] * h);minDistance &#x3D; min(minDistance, currentDistance);}return minDistance;}&#x60;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/7bfad87/src/drawables/shapes/droplet.ts#L13">drawables/shapes/droplet.ts:13</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/cdcac35/src/drawables/shapes/droplet.ts#L13">drawables/shapes/droplet.ts:13</a></li>
</ul>
</aside>
</section>
@ -460,6 +460,9 @@
<li class=" tsd-kind-type-alias">
<a href="../globals.html#texturewithoptions" class="tsd-kind-icon">Texture<wbr>With<wbr>Options</a>
</li>
<li class=" tsd-kind-function">
<a href="../globals.html#polygonfactory" class="tsd-kind-icon">Polygon<wbr>Factory</a>
</li>
<li class=" tsd-kind-function">
<a href="../globals.html#compile" class="tsd-kind-icon">compile</a>
</li>