Commit Graph

25 Commits

Author SHA1 Message Date
yellows111 5738fbb09c fix SPS/XPS crash, example icon
fix sps/xps parser crash: apparently those 4 bytes were for a third part of metadata for those files. HTML client now shows this information if available.

example icon: id2_example_001 (12 vertices, 4 triangles)

I've saved and included this icon in the .PSU and .SPS formats. .PSV is a bit more complicated for a valid export.

Example icon shows vertex colours with no animation nor includes a texture (texture type 3).

was considering adding new formats, but its not one of the big five (translation: not MAX/PWS or CBS), and I can barely find any examples to test with. Oh well. adding them to gitignore already. If the demand comes up, I've made the related hexpat's for them anyway.

.xpo and .spo (assuming they're like .xpo files) files are out of scope for this project, if anyone asks. Reason being is that they usually exclude icon data, and even icon.sys. This makes it rather useless to me.
2023-12-03 17:32:26 +00:00
yellows111 837dffc4dc autocompile documentation on each commit
only tested this once by the way

minor formatting changes in icon.js
2023-11-29 23:11:05 +00:00
yellows111 bf646d10ba Condense type forwarders into a class for less code reuse.
Edit JSDoc definitions
dos2unix(1) .gitignore, edit README slightly.
2023-11-29 13:25:58 +00:00
yellows111 95172cf285 Do near-final touches, should of done this last commit but oh well.
Actually made C6JS C6JS and not node-specific. Didn't know there was a difference.
2023-11-28 12:52:34 +01:00
yellows111 4e27befc6f Add JSDoc comments to icon.js.
Commiting from cirno. You can tell it's dire.
2023-11-28 12:23:53 +01:00
yellows111 eb5f41f9e8 Ama' here. Decided to add frame step support.
It's a bit nasty, however. Don't really know what else to do-
with this code other than attempt to support animations.

aeiou, I'm not really sure... again.
2023-11-13 12:54:35 +00:00
yellows111 e77997efe2 DOS->Unix conversion
thought it'd save some space.
2023-11-08 10:07:57 +00:00
yellows111 ca6945d522 Update README.md
Minor updates to versioning, and added raw icon file support to both node clients.

And that's it from me. Other than using GLB instead of .glTF triplets, I don't know what to do with the exporter. Would update the HTML client, yet I'm not sure on the implementation details yet.
2023-11-05 16:26:06 +00:00
yellows111 ff80a0effc gltf-exporter: textures!
comment: "was going to update icon.js to use more for of loops, but didn't actually see a good use for them, oh well."

all intentional console.logs are now console.info or console.debug depending on use.

enabled back-face culling on HTML client, as a few models depended on it for certain effects (VJ2, Okami 2).

---

Likely my last commit for a while, again.
2023-11-05 14:01:50 +00:00
yellows111 f418828a71 only read icons once, and if we need to
pretty much makes it faster, and buffer is now clumped together with all vertex data, since the other bytes from the normals, uv and colour information adds up, and since they don't change, this makes sense, at least to me.
2023-10-27 12:01:05 +01:00
yellows111 654fa45e69 Implement glTF core features better
Now that I've used the reference client to generate some glTF files, I've learned what I was doing wrong.

to be honest, rotating on X wasn't my first thought either.

Turns out the whole colour thing was because of colour spaces. I feel like I'm going to have a distaste for those in the future.
2023-10-26 14:26:54 +01:00
yellows111 6b782a9f4b Add a glTF exporter to project.
Has a few bugs, however:
* Doesn't support textures.
* Exports upside down, and attempting to fix it inverts geometry.

This is probably my last commit to this project from amaryllis.
At least for a while.
2023-10-25 15:16:28 +01:00
yellows111 42286ba7f8 Seperate module.exports into readers, helpers and options
Also add helpers to exports (uncompress and bgr2rgb functions)
Still stuck on the whole oversaturation thing.

Considering writing something to convert icon objects to a more usable model format.
2023-10-24 14:45:55 +01:00
yellows111 d5ec733b07 allow textured icons to use vertex colours
caveat: some icons aren't meant to do this and will be over-saturated. Some icons are meant to over-saturate, but I don't mind that as much as the one's that aren't. The criteria that allows this is unknown to me.
2023-10-19 07:45:04 +01:00
yellows111 f22a8118a0 Support rotating icon using arrow keys, and use a triangle strip instead of triangles for BG again 2023-10-18 15:28:34 +01:00
yellows111 3ee8d20894 8am cleanup
felt lime it
2023-10-18 08:25:42 +01:00
yellows111 0569aa7b0b support esoteric RLE icons
looking at you katamari damacy
2023-10-17 23:35:03 +01:00
yellows111 4e27fcdc94 Oh my! Working textures!
Looking good, eh?
2023-10-17 20:59:54 +01:00
yellows111 af1359ed5b Icon rendering, basic texture support (bit broken, though) 2023-10-17 15:26:08 +01:00
yellows111 a8f47aa7fb more crash preventions, support X/SharkPort files
Long version:

Putting an SPS|XPS into the PSU input would read as if the file was very long, so added a 127-file limit (I think this is reasonable) to prevent prolonged stalling.

Added SPS|XPS support to the library, which is the third most common contained format besides PSU and PSV.

Updated demos.

Technical changes:

removed unused u16le definition from readEntryBlock(), since permissions are better read as a u32 instead

added PSV and SPS|XPS reader functions to c6 exports, since I forgot in 0.3.4

moved some stuff around in HTML demo, especially the old raw icon.sys and icon input boxes, since I'm finding parsing a collection of files more useful then the actual standalone files themselves.

HTML-demo: added an "show advanced options" checkbox that unhides features deemed too niche for conventional use
2023-10-15 20:28:59 +01:00
yellows111 4d1b790a7c fixed (while improving) offset issues with untested psv code, added more throw-outs for model parsing 2023-10-12 21:59:39 +01:00
yellows111 d68e2f913a in theory this works, in practice, i forgot to have a test file on hand 2023-10-12 10:58:05 +01:00
yellows111 5fff911ba6 correction: it's an EMS memory adapter, not MAX, that's a whole other can of worms 2023-10-12 07:54:59 +01:00
yellows111 06b1de707b Add README 2023-10-12 08:51:53 +02:00
yellows111 30258212af Initial commit 2023-10-12 08:49:07 +02:00