Giter Site home page Giter Site logo

phoenixillusion / wasm-model-synthesis-merrell42 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 200 KB

Port of https://github.com/merrell42/model-synthesis to use WASM

License: Other

CMake 5.99% C++ 6.04% Shell 0.83% TypeScript 85.68% JavaScript 0.12% HTML 0.82% CSS 0.52%

wasm-model-synthesis-merrell42's Introduction

Port of https://github.com/merrell42/model-synthesis to use WASM

Has a CPP version of code using emscripten stubs for the CPP Parser routines.

Currently coded to override the 3rd party libraries involving files and use stubs in EM_JS Module.

Has a non-CPP version of the config parsing using the same code ported to typescript.

Typescript parsing of SimpleTiled currently may have slow-down during parsing as it attempts to mimic CPP's usage of a sorted map to ensure exact 1-to-1 output with CPP emscripten build.

Support parsing of SimpleTiled, Overlapping, and TiledModel. Supports both Ac3 and Ac4 propogators Supports end-to-end in Emscripten, or Using worker thread with JS driven Synthesizer using either Emscripten or AssemblyScript Ac3/Ac4 propagator.

Models:

  • SimpleTiled : loads data file with IMG sources, and produces references to rotated/mirrored versions. Renders in CSS Grid
  • Overlapping : loads single image. Processes to build adjacency rules. Renders in single canvas setting pixel values
  • TiledModel : loads text files of specific format. Renders in Three JS using (X,Y,Z) 3d volumetric positioning of model locations

Emscripten Parser - Main-CPP.TS & Example.TS

  • Has minimal port of reading XML files using browser DOM Parser.
  • Has stubs for capturing a loaded image data. Fake data returned for simpletiled since algorithms do not use actual image-data during setup
  • GIT Patches usage of filestream to string-stream subclass, simple JS layer to just return block of memory of file contents

Without configuring and building with Asyncify, CPP parser relies on pre-loading any data to XML, IFStream, and LodePNG prior to execution, since non-asyncify emscripten will not wait for file IO, expecting on-demand data.

TypeScript Parser - Main.TS, src/parser files

  • Loads all files as async and to a pure javascript data format.
  • Delays creation of InputSettings
  • Based on commented line (not flagged) will execute CPP emscripten or AssemblyScript version of Propogator (Ac3/Ac4)
  • Uses a Worker thread, since with delayed Input Settings all WASM can be done on a thread and results sent to main body post-process.

wasm-model-synthesis-merrell42's People

Contributors

phoenixillusion avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.