diff --git a/hydra/how2.html b/hydra/how2.html index 28e6c1a..1457fd8 100644 --- a/hydra/how2.html +++ b/hydra/how2.html @@ -54,7 +54,9 @@

🌱 how hydra works II

Continuing how hydra works, let's see how to turn a hydra style patch into GLSL code. With the help of graph compilation, 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.

In the last episode, we've seen that hydra has generated code like this: @@ -85,8 +87,8 @@

🌱 how hydra works II

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: a.b(c) = b(a,c), for example - rotate(st, 0, -0.1) = st.rotate(0, -0.1). By stupidly + will follow this one rewrite rule: a.b(c) = b(a,c), for + example rotate(st, 0, -0.1) = st.rotate(0, -0.1). By stupidly applying this rule throughout, we end up with this:

@@ -127,7 +129,8 @@ 

🌱 how hydra works II

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..

show page source diff --git a/index.html b/index.html index b9d7188..f2aadc8 100644 --- a/index.html +++ b/index.html @@ -29,13 +29,13 @@

🌱 garten.salat.dev

day 19:
how hydra works II

day 18:
a graph compiler -

--> +

day 17:
a graph language