Giter Site home page Giter Site logo

WebAssembly about abstreet HOT 14 CLOSED

a-b-street avatar a-b-street commented on May 3, 2024 3
WebAssembly

from abstreet.

Comments (14)

dabreegster avatar dabreegster commented on May 3, 2024 5

browser
Initial proof of concept. ;) It needs a fair bit of work, but I don't see any actual blockers.

from abstreet.

dabreegster avatar dabreegster commented on May 3, 2024 5

Currently waiting on RazrFalcon/resvg#229

from abstreet.

dabreegster avatar dabreegster commented on May 3, 2024 5

http://abstreet.s3-website.us-east-2.amazonaws.com/

I'm declaring victory. Many things are broken compared to the native version (saving your edits, partially transparent colors), but enough works to try it out! If you find other issues with web specifically, please file more bugs. Thanks!

from abstreet.

dabreegster avatar dabreegster commented on May 3, 2024 1

Starting experiments with webgl at https://github.com/dabreegster/rust_wasm_gui_test

from abstreet.

dabreegster avatar dabreegster commented on May 3, 2024 1

This is actually getting quite close: https://github.com/dabreegster/abstreet/tree/wasm

  • I got almost everything working with glow on native
  • glow on webgl isn't drawing yet, probably some simple bug
  • need to deal with non-wasm-friendly stuff from a few places -- notably usvg's harfbuzz dependency, reading/writing files, and uses of Instant

As always, I'd love help with this!

from abstreet.

dabreegster avatar dabreegster commented on May 3, 2024 1

Do you want me to pursue it @dabreegster?

I have no understanding of this stuff and want to remedy that, so I'll take a crack at it, if that's OK

@alvinhochun, we can pin to particular git commits of winit, so don't let us block any stdweb cleanup. Thanks for checking in!

from abstreet.

dabreegster avatar dabreegster commented on May 3, 2024

Yes please. This is on my radar, but I don't have any time to work on it soon.

Dependencies right now are glium, glutin, winit. winit got web support recently. The OpenGL usage is contained in the ezgui crate and doesn't use anything fancier than scissor test and texture arrays.

from abstreet.

dabreegster avatar dabreegster commented on May 3, 2024

Info on the winit support: https://users.rust-lang.org/t/winit-0-20-and-web-support/36155

from abstreet.

Immortalin avatar Immortalin commented on May 3, 2024

Seems quite laggy?

from abstreet.

dabreegster avatar dabreegster commented on May 3, 2024

Oh yeah, definitely. I haven't tried in release mode yet, but I bet that'll help. Lots of other bugs to work through before this is anywhere near ready. Probably the hardest piece will be getting some variation of text rendering through usvg without a dependency on harfbuzz.

from abstreet.

alvinhochun avatar alvinhochun commented on May 3, 2024

Hi, I want to let you know that winit is considering deprecating the stdweb backend (rust-windowing/winit#1662). As it appears that A/B street is using winit with stdweb and it doesn't look like you have any plans to move to web-sys, may I ask for your opinion on this?

from abstreet.

dabreegster avatar dabreegster commented on May 3, 2024

I originally chose stdweb over web-sys many months ago, because it wasn't clear which one was used more, and following the stdweb example seemed slightly easier at the time. I don't think there are any blockers for us switching to web-sys, and we want to use the better maintained option. @michaelkirk did some deep dives into the two recently to fix some bugs and has better context. Should we just migrate to web-sys now?

from abstreet.

michaelkirk avatar michaelkirk commented on May 3, 2024

Yep, I think migrating to web-sys makes sense.

AFAIK the most substantial piece of work will be writing the boilerplate to replace cargo web, which is stdweb only IIRC. I don't think it'll be difficult, just hasn't been a priority.

Do you want me to pursue it @dabreegster?

from abstreet.

michaelkirk avatar michaelkirk commented on May 3, 2024

Be my guest!

from abstreet.

Related Issues (20)

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.