RequestTimeout408 / Tyria3DLibrary

Tyria 3D Library is a javascript library for accessing and interpreting binary data from the Guild Wars 2 storage files.
GNU General Public License v3.0
12 stars 3 forks source link

Port of t3dgwtools #1

Open njibhu opened 8 years ago

njibhu commented 8 years ago

Would it be possible to get the source of t3dgwtools ? I believe it is based on https://github.com/ahom/gw2_reverse but I never really worked with pnacl API. I believe we could recompile it with emscripten (as just a fallback if performance is not so great) for other browsers like Firefox, Edge, or even for a nodejs port..

RequestTimeout408 commented 8 years ago

Cool! Haven't touched this project it a good while, but I opened up my private repo for the tyria3d site at another service, here's the url to the horrible nacl copy pasta https://bitbucket.org/RequestTimeout408/tyria3d/src/4f5f5dc2a6f78d801b69f72313038c88c985bd69/modules/nacl/?at=master

njibhu commented 8 years ago

I'm not better with C,C++.. Sadly we can't do another big copy pasta because emscripten is really different than nacl API.. it's basically direct calls, but I guess we can easily wrap that into a WebWorker and make it behave the same way quite easily. I thought this was only taking care of the huffman based compression, I didn't knew it was also taking care of the textures so I'm still trying to understand that part, but if I can get something working I will definitely make a pull request !

njibhu commented 8 years ago

Went back into it, played with emscripten for few hours... aaaand I got a javascript port of it ! ss 2016-09-27 at 11 14 38 It's not integrated with Tyria3D yet, but I'm more and more confident to get it working soon

RequestTimeout408 commented 8 years ago

Sweet! The main reason I didnt spend any time at all trying to port it was I didn't think the bit level data manipulation required to inflate the data was going to be possible in client side JS, fingers crossed you get it working. Great job so far, looks promising.

njibhu commented 8 years ago

Sooo, good news, bad news. Good news, my messy work on it is there: https://github.com/njibhu/t3dtools.js and with very few lines of code changed in T3D (changing the getLocalReader function) we should have something. Bad news, I give up for now on that. I think we actually can port the inflater in full js and that it would be much better in all the cases.. but I couldn't get it working in firefox. And last news, I realized (maybe too late) that google made something to automatically port nacl to emscripten: https://github.com/google/pepper.js But I was fighting with constant pointers and asm.js silent errors for too long and I'm not enough motivated anymore for that :(

njibhu commented 6 years ago

One year later ! Came back on it and managed to make it work ! There is still the integration with Tyria3DLibrary to be done, but the harder is done ! ( https://github.com/njibhu/t3dtools.js )

njibhu commented 6 years ago

Update : Everything is working ! I made a fork of Tyria3DLibrary ( https://github.com/njibhu/Tyria3DLibrary branch t3dtools ) and I also made some work on porting it to tyria3d. I struggled a bit with it because Tyria3D is actually using some bits of the T3DLib api that don't exist anymore (the ways it manages the context of the data renderers ), and it works really well ! I'm actually very surprised by the perf of t3dtools.js which is very comparable to the nacl module even though there is no optimisations enabled during the compilation and a lot of copy happens to pass the data. I have two questions now, are you still interested by it or would you prefer me to keep working on my fork ? I can make a pull request (for now I made some branches to help divide the changes I made). And since I made a bit of work on porting tyria3d to the actual api (and actually completely separating it from the rest of the API) but you still own the code I'm not sure if you'd prefer me to keep it private or if I can upload it to github.. If you're not very interested in maintaining it anymore don't feel awkward about saying it, there's no problem !