Skip to content

Commit

Permalink
hydra pt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
felixroos committed Nov 25, 2024
1 parent 793ea87 commit 1faf689
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions hydra/how2.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ <h2>🌱 how hydra works II</h2>
Continuing <a href="./how.html">how hydra works</a>, let's see how to turn
a hydra style patch into GLSL code. With the help of
<a href="/kabelsalat/graph-compilation.html">graph compilation</a>, we can
treat each function call as a node.
treat each function call as a node. Note that this implementation is
different from the hydra codebase, as it is just my own attempt to
recreate it using graphs.
</p>
<p>
In the last episode, we've seen that hydra has generated code like this:
Expand Down Expand Up @@ -85,8 +87,8 @@ <h2>🌱 how hydra works II</h2>
Here, I've manually de-nested the expression by creating a variable for
each step. This would be the target output of our graph compiler. Let's
take the inverse route and manually morph that into our input language. We
will follow this one rule: <code>a.b(c) = b(a,c)</code>, for example
<code>rotate(st, 0, -0.1) = st.rotate(0, -0.1)</code>. By stupidly
will follow this one rewrite rule: <code>a.b(c) = b(a,c)</code>, for
example <code>rotate(st, 0, -0.1) = st.rotate(0, -0.1)</code>. By stupidly
applying this rule throughout, we end up with this:
</p>
<pre>
Expand Down Expand Up @@ -127,7 +129,8 @@ <h2>🌱 how hydra works II</h2>
</label>
<p>
The now automatically generated GLSL code is structurally identical to our
handishly produced version from earlier.
handishly produced version from earlier. Next up, we need to bridge the
gap between this and actual hydra syntax..
</p>
<details>
<summary>show page source</summary>
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
<h2>🌱 garten.salat.dev</h2>
<!-- <p>day 20:<br/>
<a href="hydra/how3.html">how hydra works III</a>
</p>
</p> -->
<p>day 19:<br/>
<a href="hydra/how2.html">how hydra works II</a>
</p>
<p>day 18:<br/>
<a href="kabelsalat/graph-compilation.html">a graph compiler</a>
</p> -->
</p>
<p>day 17:<br/>
<a href="kabelsalat/graph-language.html">a graph language</a>
</p>
Expand Down

0 comments on commit 1faf689

Please sign in to comment.