Would it be a good idea to essentially create a wrapper for Three.JS using ports, and essentially do something similar to a virtual DOM? The way I imagine it, is that I would have an in memory representation of what should be shown; this could be compared to what is actually shown, and it would imperatively either add or remove it from the scene. This means that I would be using fast imperative management of what is shown, but I could wrap it in pure functions in Elm through ports. Am I on the right track here?
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I recall Hassan worked on this project which aimed to give a bunch of high-level tools. I'm not sure if it has been updated for 0.15 yet (elm-webgl just got updated recently) but that may be a good place to start. Does it seem to fit your case?
My main concern with wrapping up something like three.js is that the API mismatch may be enough between Elm and JS that it's not so simple to do. I don't think that should discourage you, but definitely keep it in mind that lots of those APIs probably use mutation, which would not be allowed in Elm.
Hassan,
Can you comment @johnpmayer a few examples with bad shader performance in your library on GitHub?
I learned using the Opera webgl 101 video. In the "learn the hard way" style, I followed along the live coding video with my own editor. Before this, I had no formal 3d graphics experience.
--
For some reason I have this idea webgl is not available in browsers reliably right now, compared to canvas. I'm not sure if that's a concern still?
--
Wait WebGL can be used for performant 2D graphics as well right? Maybe I could start learning about WebGL and can start by doing something simpler. It could be an interesting project to try to make an alternative to Graphics.Collage. Have the same api, but instead of using the regular canvas, we could have hardware accelerated 2D in WebGL. What do you guys think?
Also if we had a api that was identical to the api Evan used in Canvas, it should be relatively straightforward for other users to swap them out for each other. Unless you are suggesting to do that on the library side, and have it detect whether it is supported using ports or something, otherwise use the canvas fallback. Then it could be merged with Collage, and nobody would notice a difference, development wise, but could still gain a speed boost for no extra effort.
--