another pattern pass
This commit is contained in:
parent
ec3ce24aa2
commit
2150985b35
6 changed files with 40 additions and 60 deletions
|
@ -1,14 +1,5 @@
|
||||||
# 2019.05.31 -> 2022.10.06 ->
|
# 2019.05.31 -> 2022.10.06 ->
|
||||||
|
|
||||||
# deprecated format
|
deprecated format
|
||||||
# color.rgb = (pos.x, pos.y, pos.z)
|
color.rgb = (pos.x, pos.y, pos.z)
|
||||||
# Render(outline)
|
Render(outline)
|
||||||
|
|
||||||
# new format *TODO
|
|
||||||
input
|
|
||||||
|
|
||||||
data
|
|
||||||
|
|
||||||
frame
|
|
||||||
|
|
||||||
design
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# 2021.10.18 -> 2023.02.16 ->
|
# 2021.10.18 -> 2023.02.16 ->
|
||||||
|
|
||||||
// 4 independent spatial cursors
|
# 4 independent spatial cursors
|
||||||
p0 = leftHand.pos
|
p0 = leftHand.pos
|
||||||
p1 = leftTwistCursor.pos
|
p1 = leftTwistCursor.pos
|
||||||
p2 = rightTwistCursor.pos
|
p2 = rightTwistCursor.pos
|
||||||
|
|
|
@ -9,7 +9,7 @@ if (mainHand.button.held)
|
||||||
|
|
||||||
lastPos = dragPos
|
lastPos = dragPos
|
||||||
|
|
||||||
// x orbital-view
|
# x orbital-view
|
||||||
dragPos = mainHand.pos // * head.rot
|
dragPos = mainHand.pos // * head.rot
|
||||||
newRot = orielRot * head.rot
|
newRot = orielRot * head.rot
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
oriel.pos = head.rot * fwd
|
oriel.pos = head.rot * fwd
|
||||||
|
|
||||||
// amplified
|
# amplified
|
||||||
oriel.pos = head.rot * fwd
|
oriel.pos = head.rot * fwd
|
||||||
strength = ~4
|
strength = ~4
|
||||||
oriel.rot = rot.euler(0, head.euler.y * -strength, 0)
|
oriel.rot = rot.euler(0, head.euler.y * -strength, 0)
|
|
@ -1,44 +1,34 @@
|
||||||
# 2019.03.14 -> 2022.10.06 ->
|
# 2019.03.14 -> 2022.10.06 ->
|
||||||
|
|
||||||
# deprecated format
|
# signed distance field compositing
|
||||||
# // signed distance field compositing
|
# *spatial culling shader code
|
||||||
# // *spatial culling shader code
|
_matrix = Matrix.TR(oriel.pos, oriel.rot)
|
||||||
# _matrix = Matrix.TR(oriel.pos, oriel.rot)
|
_dim = oriel.dimensions
|
||||||
# _dim = oriel.dimensions
|
MAX_STEPS = 256±
|
||||||
# MAX_STEPS = 256±
|
MAX_DIST = 100±
|
||||||
# MAX_DIST = 100±
|
BoxSD(pos, dim):
|
||||||
# BoxSD(pos, dim):
|
q = abs(pos) - dim
|
||||||
# q = abs(pos) - dim
|
step = length(max(q, 0.0))
|
||||||
# step = length(max(q, 0.0))
|
step += min(max(q.x, max(q.y, q.z)), 0.0)
|
||||||
# step += min(max(q.x, max(q.y, q.z)), 0.0)
|
return step
|
||||||
# return step
|
Raymarch(origin, dir):
|
||||||
# Raymarch(origin, dir):
|
origin = mul(origin, _matrix)
|
||||||
# origin = mul(origin, _matrix)
|
dir = mul(dir, _matrix)
|
||||||
# dir = mul(dir, _matrix)
|
dist = 0.0
|
||||||
# dist = 0.0
|
for (0..MAX_STEPS):
|
||||||
# for (0..MAX_STEPS):
|
pos = origin + dist * dir
|
||||||
# pos = origin + dist * dir
|
step = BoxSD(pos, _dim / 2.0)
|
||||||
# step = BoxSD(pos, _dim / 2.0)
|
if (step < 0.0001 or dist > MAX_DIST):
|
||||||
# if (step < 0.0001 or dist > MAX_DIST):
|
then break loop
|
||||||
# then break loop
|
dist += step
|
||||||
# dist += step
|
return dist
|
||||||
# return dist
|
YourPixelShader():
|
||||||
# YourPixelShader():
|
pos = pixel.worldposition
|
||||||
# pos = pixel.worldposition
|
dir = normalize(pos - cam)
|
||||||
# dir = normalize(pos - cam)
|
// cull around
|
||||||
# // cull around
|
dist = Raymarch(cam, dir)
|
||||||
# dist = Raymarch(cam, dir)
|
clip(100 - (dist + 1))
|
||||||
# clip(100 - (dist + 1))
|
// cull between
|
||||||
# // cull between
|
oriel = cam + dist * dir
|
||||||
# oriel = cam + dist * dir
|
clip(dist(cam, pos) - dist(cam, oriel))
|
||||||
# clip(dist(cam, pos) - dist(cam, oriel))
|
...
|
||||||
# ...
|
|
||||||
|
|
||||||
# new format *TODO
|
|
||||||
input
|
|
||||||
|
|
||||||
data
|
|
||||||
|
|
||||||
frame
|
|
||||||
|
|
||||||
design
|
|
||||||
|
|
|
@ -11,8 +11,7 @@ if (offCon.triggerBtn.held && held != null)
|
||||||
)
|
)
|
||||||
|
|
||||||
spinRot *= spinDelta
|
spinRot *= spinDelta
|
||||||
|
# lower the speed the higher the friction
|
||||||
// lower the speed the higher the friction
|
|
||||||
friction = 1 - Clamp01(
|
friction = 1 - Clamp01(
|
||||||
Angular(spinDelta).magnitude / deltaTime / 15
|
Angular(spinDelta).magnitude / deltaTime / 15
|
||||||
)
|
)
|
||||||
|
@ -25,5 +24,5 @@ spinDelta = Slerp(
|
||||||
heldRotDelta = newRot * Inverse(oldRot)
|
heldRotDelta = newRot * Inverse(oldRot)
|
||||||
|
|
||||||
held.rot = hand.rot * heldRot * spinRot
|
held.rot = hand.rot * heldRot * spinRot
|
||||||
// or
|
# or
|
||||||
held.angularVel = Angular(heldRotDelta) / deltaTime
|
held.angularVel = Angular(heldRotDelta) / deltaTime
|
Loading…
Add table
Reference in a new issue