diff --git a/app/dofs/color-cube/pattern.txt b/app/dofs/color-cube/pattern.txt index 0fc3b03..2e71ca9 100644 --- a/app/dofs/color-cube/pattern.txt +++ b/app/dofs/color-cube/pattern.txt @@ -1,14 +1,5 @@ # 2019.05.31 -> 2022.10.06 -> -# deprecated format -# color.rgb = (pos.x, pos.y, pos.z) -# Render(outline) - -# new format *TODO -input - -data - -frame - -design +deprecated format +color.rgb = (pos.x, pos.y, pos.z) +Render(outline) diff --git a/app/dofs/cubic-flow/pattern.txt b/app/dofs/cubic-flow/pattern.txt index 41f0707..a102dad 100644 --- a/app/dofs/cubic-flow/pattern.txt +++ b/app/dofs/cubic-flow/pattern.txt @@ -1,6 +1,6 @@ # 2021.10.18 -> 2023.02.16 -> -// 4 independent spatial cursors +# 4 independent spatial cursors p0 = leftHand.pos p1 = leftTwistCursor.pos p2 = rightTwistCursor.pos diff --git a/app/dofs/offset-cursor/pattern.txt b/app/dofs/offset-cursor/pattern.txt index 0aafb5b..aae6dca 100644 --- a/app/dofs/offset-cursor/pattern.txt +++ b/app/dofs/offset-cursor/pattern.txt @@ -9,7 +9,7 @@ if (mainHand.button.held) lastPos = dragPos -// x orbital-view +# x orbital-view dragPos = mainHand.pos // * head.rot newRot = orielRot * head.rot diff --git a/app/dofs/orbital-view/pattern.txt b/app/dofs/orbital-view/pattern.txt index 657f45a..60998a8 100644 --- a/app/dofs/orbital-view/pattern.txt +++ b/app/dofs/orbital-view/pattern.txt @@ -2,7 +2,7 @@ oriel.pos = head.rot * fwd -// amplified +# amplified oriel.pos = head.rot * fwd strength = ~4 oriel.rot = rot.euler(0, head.euler.y * -strength, 0) \ No newline at end of file diff --git a/app/dofs/oriel/pattern.txt b/app/dofs/oriel/pattern.txt index e4a48ed..c2465b1 100644 --- a/app/dofs/oriel/pattern.txt +++ b/app/dofs/oriel/pattern.txt @@ -1,44 +1,34 @@ # 2019.03.14 -> 2022.10.06 -> -# deprecated format -# // signed distance field compositing -# // *spatial culling shader code -# _matrix = Matrix.TR(oriel.pos, oriel.rot) -# _dim = oriel.dimensions -# MAX_STEPS = 256± -# MAX_DIST = 100± -# BoxSD(pos, dim): -# q = abs(pos) - dim -# step = length(max(q, 0.0)) -# step += min(max(q.x, max(q.y, q.z)), 0.0) -# return step -# Raymarch(origin, dir): -# origin = mul(origin, _matrix) -# dir = mul(dir, _matrix) -# dist = 0.0 -# for (0..MAX_STEPS): -# pos = origin + dist * dir -# step = BoxSD(pos, _dim / 2.0) -# if (step < 0.0001 or dist > MAX_DIST): -# then break loop -# dist += step -# return dist -# YourPixelShader(): -# pos = pixel.worldposition -# dir = normalize(pos - cam) -# // cull around -# dist = Raymarch(cam, dir) -# clip(100 - (dist + 1)) -# // cull between -# oriel = cam + dist * dir -# clip(dist(cam, pos) - dist(cam, oriel)) -# ... - -# new format *TODO -input - -data - -frame - -design \ No newline at end of file +# signed distance field compositing +# *spatial culling shader code +_matrix = Matrix.TR(oriel.pos, oriel.rot) +_dim = oriel.dimensions +MAX_STEPS = 256± +MAX_DIST = 100± +BoxSD(pos, dim): + q = abs(pos) - dim + step = length(max(q, 0.0)) + step += min(max(q.x, max(q.y, q.z)), 0.0) + return step +Raymarch(origin, dir): + origin = mul(origin, _matrix) + dir = mul(dir, _matrix) + dist = 0.0 + for (0..MAX_STEPS): + pos = origin + dist * dir + step = BoxSD(pos, _dim / 2.0) + if (step < 0.0001 or dist > MAX_DIST): + then break loop + dist += step + return dist +YourPixelShader(): + pos = pixel.worldposition + dir = normalize(pos - cam) + // cull around + dist = Raymarch(cam, dir) + clip(100 - (dist + 1)) + // cull between + oriel = cam + dist * dir + clip(dist(cam, pos) - dist(cam, oriel)) + ... diff --git a/app/dofs/trackballer/pattern.txt b/app/dofs/trackballer/pattern.txt index a129264..1750f5b 100644 --- a/app/dofs/trackballer/pattern.txt +++ b/app/dofs/trackballer/pattern.txt @@ -11,8 +11,7 @@ if (offCon.triggerBtn.held && held != null) ) spinRot *= spinDelta - -// lower the speed the higher the friction +# lower the speed the higher the friction friction = 1 - Clamp01( Angular(spinDelta).magnitude / deltaTime / 15 ) @@ -25,5 +24,5 @@ spinDelta = Slerp( heldRotDelta = newRot * Inverse(oldRot) held.rot = hand.rot * heldRot * spinRot -// or +# or held.angularVel = Angular(heldRotDelta) / deltaTime \ No newline at end of file