Show HN: WebGL Fluid and Particles in Haxe(haxiomic.github.io)
haxiomic.github.io
Show HN: WebGL Fluid and Particles in Haxe
http://haxiomic.github.io/GPU-Fluid-Experiments/html5/
3 comments
It's beautiful!
The rightclick -> leftclick somewhere else for a pulse trick is also mesmerizing. Great work!
The rightclick -> leftclick somewhere else for a pulse trick is also mesmerizing. Great work!
This is great, do you have a trip report? I've been using Haxe for a while, but have done precious little WebGL.
I'm working on the write up for this project at the moment. The best aspect of the language in my eyes is having a scriptable compiler with Haxe macros (macros themselves are also written in Haxe). In this project there's a macro that parses and extracts the variables from the shader glsl - so rather than the usual method for passing variables to shaders:
Alternatively, Ncannasse is working on a haxe-based shader langauge, hxsl which when ready will be my language of choice - not least because we'll be able to target glsl, AGAL and hlsl, maybe even Cg with a single codebase
gl.useProgram(program);
mouseCoordLocation = gl.getUniformLocation(program, 'mouseCoord');
... then later during rendering ... gl.useProgram(program);
gl.uniform2f(mouseCoordLocation, mouse.x, mouse.y);
With Haxe macros it becomes: program.mouseCoord = mouse;
Best of all it works with autocomplete!
Checkout shaderblox by Sunjammer to try it for your self - it's quite experimental so in this project I'm using a fork with a few of the bugs patched https://github.com/haxiomic/shaderblox .It also supports fairly rudimentary shader inheritance which is terribly useful if you're not a fan of the rigidity of shader languages like glsl.Alternatively, Ncannasse is working on a haxe-based shader langauge, hxsl which when ready will be my language of choice - not least because we'll be able to target glsl, AGAL and hlsl, maybe even Cg with a single codebase
That's awesome. I didn't know something like Haxe existing for a long time.
Looks amazing. I like how people are adopting Haxe and making all this cool stuff. Awesome work, thanks for sharing.
https://github.com/haxiomic/GPU-Fluid-Experiments