another pattern pass

This commit is contained in:
ethan merchant 2023-02-16 18:54:02 -05:00
parent ec3ce24aa2
commit 2150985b35
6 changed files with 40 additions and 60 deletions

View file

@ -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)

View file

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

View file

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

View file

@ -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)

View file

@ -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
# signed distance field compositing
# *spatial culling shader code
_matrix = Matrix.TR(oriel.pos, oriel.rot)
_dim = oriel.dimensions
MAX_STEPS = 256&#177;
MAX_DIST = 100&#177;
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))
...

View file

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