1. 15
  1.  

  2. 2

    Well written and nicely explained. Brought me back to my Uni days, when we had to implement boids and other simple state automata in C#.

    1. 1

      I got close but failed the first time I tried to implement boids. It must have been soon after I started learning to code. I stretched myself because it looked super cool and I also liked that a version of it had been used in Half-Life.

      1. 1

        I have recently laid out my intention to write an ebook about graphics programming in Go My humble start (It’s literally just a single draft page for now) aside, I would really like to have sections with practical examples. Yours fits perfectly. With your full permission (will be credited in the ebook’s references, of course), I’d like to republish or rephrase some of your code and explanations in it. How does that sound to you?

        1. 1

          I’m currently in talks with a few publishers and have been advised to hold onto the exclusive rights to anything I would want to expand into a chapter of a book.

          Your book sounds exciting – there’s always room for more content about graphics programming in Go! Do let me know if you need a technical reviewer.

    2. 1

      Really great article. I have a question regarding the gzipping part though. I have seen the link there, but I don’t understand why one would not simply have the web server and browser take care of gzipping and decompressing the content. Am I missing something?

      1. 2

        why one would not simply have the web server and browser take care of gzipping and decompressing the content

        That would be optimal, and what most people would do.

        The WASM demo doesn’t work on my iPhone 8 (Safari) unless I handle gzipping manually. I don’t know why this is (still investigating) but I wanted the widest support for viewing the demo. Additionally, I suppose that section also helps people who might be serving files in an unorthodox manner.

        You aren’t the first person to question this so I may loop around in the future and edit out all mention to gzipping and just suggest one HTML file that uses instantiateStreaming.

        1. 1

          I went back and edited out that section.

          I found that instantiateStreaming is not supported on Safari at all. Instead instantiate can be used but first the file must be put into an ArrayBuffer.

      2. 1

        This is a great post!