Commit Graph

255 Commits

Author SHA1 Message Date
scurest
3d4e91e140 viewer: Use patched version of glium with vsync support 2024-08-03 04:25:01 -05:00
scurest
064471f797 Remove dependency: atty 2024-08-02 22:30:06 -05:00
scurest
ff617bf9fb Upgrade dependency: glium 0.29 -> 0.34 2024-08-02 21:33:20 -05:00
scurest
da79b95bce Make Vertex struct #[repr(C)]
Required since Rust 1.67
2024-08-02 07:39:29 -05:00
scurest
0a203e67d5 viewer: Only render when main events cleared
Fixes #63
2024-08-01 18:40:55 -05:00
scurest
e757a9b48b Update Github actions 2024-07-25 06:03:14 -05:00
scurest
822342f84b Upgrade dependency: termcolor 0.3 -> 1 2024-07-24 21:24:24 -05:00
scurest
11ca50c0dc Migrate to Rust 2021 edition 2024-07-24 20:49:12 -05:00
scurest
75cb088d31 Fix some warnings 2024-07-24 20:15:13 -05:00
scurest
5d604c0237 Upgrade dependency: png 0.16 -> 0.17 2024-07-24 20:06:16 -05:00
scurest
c7d6e2b670 cargo update 2024-07-24 20:04:51 -05:00
scurest
74db2cbc91 Simplify access to commit/version info at compile time 2024-07-24 19:38:34 -05:00
scurest
3c003d3c54 viewer: Fix missing vsync; fixes horrible lag 2024-07-21 08:35:02 -05:00
scurest
075ba9a4d5 Fix typo preventing --more-textures from working 2021-05-08 08:38:05 -05:00
scurest
38e50cd8fe CD: use Github actions for download; delete appveyor 2021-03-07 21:35:14 -06:00
scurest
8b866bb9b9 CD: add Github action for continous deployment 2021-03-07 21:18:57 -06:00
scurest
5c0ef4fd1c viewer: Fix mouse grabbing stuff
Tested on Windows/Linux.
2021-03-07 13:51:18 -06:00
scurest
bf154d5b5d Update deps; wards off entropy a while longer... 2021-02-27 21:29:03 -06:00
scurest
deee6872e5 Viewer: show file textures/palettes come from when [Space] pressed
Fixes #30
2020-08-22 13:50:22 -05:00
scurest
4e45aef260 cargo update 2020-08-22 13:39:58 -05:00
scurest
bc212d5cb9 Bugfix: data wasn't being refreshed when changing animations 2020-08-07 08:09:30 -05:00
scurest
da27edffad Bugfix: fix copy-paste error for A5I3 textures (#23)
Fixes tons of translucent textures (water in Avalon Code, Wizard of
Oz, etc).
2020-02-10 02:04:00 -06:00
scurest
07c4d8facd Model: correct comment about m0 2020-02-09 21:27:49 -06:00
scurest
5bbdf8c89a Add --overwrite flags
Allows overwriting files in the output dir if it already exists.

Fixes #12.
2020-02-09 21:12:53 -06:00
scurest
4d6af72259 CLI: write custom arg parsing code
This drops the clap dependency, which is a boost for compile time/
build size/binary size. Also alows us to use a consistent method
for reporting errors.

Error and usage messages got a little love too.

Edges are still a bit rough on this I think, but can work on it
more later.
2020-02-09 20:46:02 -06:00
scurest
e52a77d0bc Refactor: rename mesh -> piece
Frees up Mesh, which I want to use instead of Primitives.
2020-02-05 18:12:59 -06:00
scurest
3f943bde3e Bugfix: fix OOB when using --all-animations
Stupid typo.
2020-01-31 17:06:02 -06:00
scurest
ee8d9aac76 Revert "Use STEP interpolation for animation curves"
This reverts commit 2c2aaeae83.

Some models from Chocobo Tales become unacceptably "jittery" with
STEP interpolation. It's possible that rotaions are STEPed and
trans/scales are lerped, don't know.

For now, back this out.
2020-01-25 20:23:59 -06:00
scurest
ae33d9a919 Refactor: pack all weights in a skeleton into one buffer
Instead of every vert having a SmallVec of its influences, have it
store an offset into the packed buffer of all the influences
instead.

This is way more efficient. Like, 10% of the size it was before.

Also lets us drop the smallvec dependency.
2020-01-21 23:09:23 -06:00
scurest
c81d9d5269 Materials fixes: especially around texture matrices
I got the code for render command 0x4 decompiled and started
deciphering it. Now have a somewhat more accurate picture of how
materials work. Most of that more accurate picture is still not
put into practice though.
2020-01-21 14:17:23 -06:00
scurest
2c2aaeae83 Use STEP interpolation for animation curves
I decided the DS is unlikely to be doing lerping.

This also seems to fix some visual bugs with .dae/.glbs when
a curve has a jump discontinuity (eg. b00Walk in Ore ga).
The intermediate values from lerping would be visibly wrong.
2020-01-21 14:16:36 -06:00
scurest
a78046e2d0 Refactor: hand-roll our own tree data structure
Replace petgraph with a hand-rolled Tree type.
2020-01-21 14:16:36 -06:00
scurest
c0a6c7d1c0 Refactor: rename BiList -> BiVec 2020-01-21 14:16:36 -06:00
scurest
36caecd0b7 CLI: expand globs on Windows
The Windows shell doesn't expand globs; programs are expected to
do it themselves. Supporting this should make it easier for
Windows-friends to do stuff like pass all the *.nsbtx files to
find missing textures.

The wild crate does all the work.

(Hope this works; I don't own a Windows box.)
2020-01-21 14:16:31 -06:00
scurest
c756d16edc Tweak README/docs 2019-09-23 23:20:57 -05:00
scurest
5f8ea18137 Convert: handle empty (no vertices) models 2019-09-23 05:56:45 -05:00
scurest
4f1c282314 glTF: use NEAREST texture filtering 2019-09-23 05:56:45 -05:00
scurest
27274e8324 glTF: bugfix: convert vetex colors to linear RGB 2019-09-23 05:56:37 -05:00
scurest
a695a1d841 glTF: add support for material anims
Obviously highly tentative. This uses the EXT_property_animation
extension. Since I'm not aware of any implementation other than
the one I did in kson's Blender importer, this isn't very useful
atm...
2019-09-17 23:11:10 -05:00
scurest
bd1b2eb8cd Viewer: enable alpha blending
This sometimes causes ordering artifacts, but makes lots of things
like water look more like they're supposed to.

Possible optimization is to only enable it for calls that need it
(eg. they have a translucent texture), but it seems fast enough
as is.
2019-09-15 00:36:06 -05:00
scurest
fcc639efdf Bugfix: reset viewer state when stopping animations 2019-09-13 08:28:20 -05:00
scurest
6c7cb37577 Bugfix: handle interacting normals/vertex colors
Fake the way the normal and vertex color on the DS overwrite one
another by clearing one whenever we set the other.

Fixes a bunch of stuff that was pure black before.
2019-09-13 06:51:14 -05:00
scurest
4ea95c7c6f Error out when pattern anims have OOB indices
Prevents panicing on some pattern animations in Days.
2019-09-13 06:51:14 -05:00
scurest
74df2bd07a Let the user toggle the light in the viewer 2019-09-13 06:51:14 -05:00
scurest
abe8d4476d Re-guess fixed-point format for material anims
Practically speaking, this halves the rate of playback.
Evidence that this is correct is that scrolling animations which
you expect to translate the (say) U by the whole width of the
texture now do so, instead of translating it by twice the width.
2019-09-06 12:53:41 -05:00
scurest
9e4900253a Rework viewer
Single-stepping is now supported for each type of animation.
We also avoid some allocations.
2019-09-06 04:19:38 -05:00
scurest
2797c0d43e Bugfix: dumb typo in FB_ngon_encoding handling 2019-09-06 04:19:38 -05:00
scurest
f9e1b92fdb Viewer: initial .nsbta support
Successfully understands at least some animations that animate the
texture coordinate UV translation. Playback is waaay too fast
currently (maybe there's some field modulating playback speed?).
2019-09-06 04:19:38 -05:00
scurest
af0d02da34 Wire up the viewer for material animations
Currently they don't do anything though.
2019-09-06 04:19:38 -05:00
scurest
60ed16ad2d Sketch in support for BTAs
Fully supported in the extractor, but don't do anything in the
viewer or converter since I don't know anything about the format.
2019-09-01 16:06:58 -05:00