I found glm to be quite fast for general math code in emscripten, for instance this instancing demo uses glm for its particle updates, without any fancy optimizations:
http://floooh.github.io/oryol/Instancing.html In comparision here's the same demo with the particle update running on the GPU (fragment shader writes to a ping-ponged render target texture, which is then sampled in a vertex shader to displace particle positions): http://floooh.github.io/oryol/GPUParticles.html Dependending on the target platform, the extra effort to move all math to the GPU is not worth it because you need to restructure your entire code architecture around this. Remember that you need to tell emcc about the location of the glm headers with -I. And (shameless plug), if you want an easy-to-use cmake build system wrapper that also supports simple cross-compiling to emscripten, check out fips: http://floooh.github.io/fips/ (3D sample video with emscripten cross-compiling demo at the end (also works on Windows or Linux): https://www.youtube.com/watch?v=B5R0uE5IMZs) Cheers, -Floh. Am Mittwoch, 1. April 2015 16:05:28 UTC+2 schrieb james morrissey: > > Hi > Thanks for the really fast response I wasn't expecting it, and sorry for > my late response. > > Honestly I'm just getting started Emscripten and compiling from C++ to JS, > but I find it really interesting :) > > What do mean by SIMD paths (I googled it, and got a lot vague definitions) > Thanks for SIMD advice I'm working on implementing it now. > > "emscripten doesn't support it" > I mean I checked the include directory but it's not there, while > glew,freeglut are. > emscripten has support for "user input(freeglut)" and getting > extensions(glew) > but no support for matrix calculations. > > My problem in its most simplistic sense, is that emscripten doesn't > recognize glm > > #include <glm/glm.hpp> > > // I need to change the includes ?? > > so this lead to an error here > > trans = glm::rotate( > > ^^^ > > And again I'm new emscripten and compiling from C++ to JS. > Your help is really really appreciated > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
