1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00
Pixelorama/assets/dither-matrices/bayer8.png
Emmanouil Papadeas cf926942ac
Shader-based gradients (#677)
* Add 6 shader-based gradient types

* Shaders now respect selection

* Fix step gradient

* Remove comments

* Disable step and dithering shaders in Web version

* Fixed a weird bug with dithering shaders, selection and GLES2

Having a selection, applying a dithering gradient, removing the selection and then going to the gradient dialog again causes the dithering shaders to "remember" the previous selection, even if there is no selection currently. This only happens with the two dithering shaders and only with the GLES2 renderer. Removing `uniform sampler2D dither_texture;` from the shader code seems to fix the issue, but that's obviously isn't what we want so a "proper" fix is included in this commit.

* Format & lint

* Removed old gradient code

* Change how centers work on radial step and dithering

* Made angle, center and radius option a bit more clear

* Rename bayer-matrices directory to dither-matrices

* Use DitherMatrix class

* Create dithering types programmatically

* Remove unneeded code in shaders

* Rewrite the step shader without a for loop

More optimized and works on the Web version with GLES2

* Rewrite radial step and dithering shaders without for loop

Now all shaders work on the Web version and have been optimized.

* Fix Linear & Radial size range and remove some unneeded lines

* Added size uniform to Radial Step and Radial Dither

* Swap colors in the Linear gradient

* Make size a percentage

* Make the preview look the same as the result

Didn't change the dithering shaders because they seemed to give different results.

* Remove ratio uniform and divide uvs by the radius instead

This makes more sense because the smaller the number, the smaller the radius.

* Fix linear gradient

* Change Position to percentage and "Size" to "Transition size"

* Mix gradients with original color, if the gradient colors have transparency
2022-05-02 16:12:00 +03:00

265 B
8x8px