waylonflinn / weblas

GPU Powered BLAS for Browsers :gem:
MIT License
702 stars 43 forks source link

Unpacked rgba format #27

Open gnonio opened 8 years ago

gnonio commented 8 years ago

Cheers for a great lib weblas is. Very good stuff, learned quite a lot wrt webgl thanks to it.

I introduced some modifications to better suit my needs. But before begining PRs I wanted to let you know about the direction I am giving them: give a look at the initial weblas fork and the latter weblas-unpacked which evolved into a plugin depending on weblas.

The main modification is in respect to the texture format. Weblas-unpacked opts for a single value per texel format. This prevents packing and unpacking, both transfering to and from GPU at the cost of increased memory (which can be recovered to an extent). The aim being to simplify shader logic and packing/unpacking operations when algorithms encourage multiple stages within the GPU. It also provides direct float values reading, preventing encoding. This does imply that shaders cannot be shared between both formats (facilities to convert between them are provided though). Check the project for more details.

Currently integration of both is a bit hacky (overwriting some class methods, bad I know), I might focus a bit in easing this and suggest some PRs towards that. Hopefully I am not deviating too much from your aims, and my very lean coding experience won't boil your head (really, don't look at my gl-compute at all, this is mainly a hobby for me).

Thanks again for this great library.

waylonflinn commented 8 years ago

Looking forward to checking this out!