Skip to content

Improve depth-precision - #81

Merged
HailToDodongo merged 31 commits into
mainfrom
depth_fix
Sep 28, 2026
Merged

HailToDodongo merged 31 commits into
mainfrom
depth_fix

Conversation

@HailToDodongo

Copy link
Copy Markdown
Owner

No description provided.

@HailToDodongo
HailToDodongo marked this pull request as ready for review September 28, 2026 21:35
@HailToDodongo HailToDodongo changed the title Depth fix Improve depth-precision Sep 28, 2026
@HailToDodongo
HailToDodongo merged commit e14ff48 into main Sep 28, 2026
2 of 4 checks passed
@HailToDodongo
HailToDodongo deleted the depth_fix branch October 15, 2026 21:57
ottj added a commit to ottj/tiny3d that referenced this pull request Oct 22, 2026
…on the sr64 fork

Cherry-picked from upstream 1029791 (Max Bebök, 2026-10-06): keyframes
stream from ROM by DMA through a small double buffer per animation
instead of a FILE, T3DBone keeps a 4x3 matrix (96 B, 16-aligned), and the
skeleton/animation update paths are faster. Only HailToDodongo#84 — the precision fix
(HailToDodongo#81) and the RSPL microcode port stay for the full upstream update, so
upstream's breakingChanges.md (which documents both) is left out.

Conflicts with the fork, resolved:
- The fork's memory keyframe source (dataPtr) is replaced by upstream's
  ROM stream. sr64 builds its animations by hand around its own
  T3DChunkAnim, so a new t3d_anim_set_source_rom() starts the stream from
  a ROM address with a CALLER-supplied buffer; T3DAnim.ownsBuffer tells
  t3d_anim_destroy / _destroy_free whether tiny3d allocated the buffer
  (and frees it) or the caller did (and keeps it). destroy_free waits for
  the stream's DMA before anything is released.
- The fork's no-source safety stays: an animation with no stream reads
  no keyframes (a static pose) instead of DMAing into NULL, and a channel
  whose window never opened is skipped instead of divided by zero.
- Weighted skinning: the inverse bind poses are 4x3 too (48 B per bone,
  was 64), computed once at create through the existing 4x4 affine
  invert, and the skin matrix is mat4x3_mul(world, IBM) -> mat4x3_to_fixed.
  A clone without inverse bind poses takes upstream's plain path.

Measured in sr64 (b30, 24-actor fight): the animation pool's demand peak
161 -> 136 KB and its 46 fragmentation spills -> 0.

(cherry picked from commit 1029791)

This branch had an error being deployed

1 failed deployment
github-pages — 5167681d Deployed Sep 28, 2026 by HailToDodongo via deploy #108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant