Practical Shader Development done in HX

Hi,
one more good book for learning shaders and graphic programming in general, in my case WebGL.
Done haxe implementation of Practical Shader Development.

2D part was done with custom small webgl implementation + great math library from @haxiomic, when moved to 3D shaders made externs for OGL as vector math library was missing transpose and inverse (added now), also transform and perspective matrix are missing there but I assume they could be out of scope of this lib :slight_smile:

Its first iteration so need some extra cleanup also, didn’t finished last exercise for multi pass , but maybe someone will find it interesting and will give a try and make own implementation :slight_smile:

doing these exercise I realised that there are none lite webgl lib written in haxe, that just adds low level helpers to work with webgl api :slight_smile:

7 Likes

Thanks for sharing definitely interesting.

Maths:
[ Not used @haxiomic’s math library, but I saw it and thought it looked interesting. ]
GitHub - tbrosman/hxmath: A math library for Haxe. is cool I wanted to add Dual Quaternions and Complex numbers but need to get round to finishing them off he is perfectionist and I probably lost interest. I have less than perfect ones in my lib, intent to update my DualQuaternions library based on my discussion with him at some stage, but of the maths work well.
GitHub - nanjizal/geom: geom library, provides matrices associated structures, some related mathematics and is targeted at practical graphics.
It has support for 3D and probably some stuff you found missing, and some aspects are nicer than hxmath but much of a muchness.

WebGL
In terms of WebGL libraries I have put together some GL stuff mainly to support my trilateral3 experiments, but it also has some stuff for Gluon ( Haxiomic ), unfortunately Lime is bit slow ( not found out why ) and nme not ideal with haxe 4.2 yet may have fixed most aspects but needs work, I may add Kha when it gets haxe4.2. Need help with heaps I don’t yet have a good approach. I really want to add Image support to my Gluon it seems very promising, Haxiomic has given me some suggestions I just need to set some time to work on it. You can see my kitGL here. Perhaps could take the good parts to something more general.

You can see demo use of kitGL here:

( dsHelper contains some work on interleaved Float32Array and helps bridge NME, OpenFL, Gluon, WebGL Float32Array differences and gotchas ).

Still pretty experimental, but has quite a few webgl helper bits.

Expect your much more advanced coder, but happy to collaborate if you see anything useful in my libraries. I think ‘geom’ is mostly quite clean, ‘kitGL’ is useful but WIP. Trilateral3 will soon have texture id but is pretty complete for it’s limited use case, and I want to look at integrating raph’s spine code perhaps, but that’s likely tricky port.

2 Likes

I could extract WebGL helpers from kitGL and you could mix it up adapt it with some of your findings if it’s useful? WebGL really is horrible to work with trying to get transparency etc… stupid random properties, it’s just such a pain in the neck but quite exciting that Lime, NME, Gluon are so close you can almost abstract above them to do the same, without commiting to a full framework more just a kit.

2 Likes