elm-explorations / webgl

Functional rendering with WebGL in Elm
https://package.elm-lang.org/packages/elm-explorations/webgl/latest/
BSD 3-Clause "New" or "Revised" License
116 stars 17 forks source link

Add premultiply option for texture loading #25

Open MartinSStewart opened 4 years ago

MartinSStewart commented 4 years ago

In order to alpha blend textures correctly, their color channel needs to be premultiplied by the alpha channel. I believe WebGL supports doing this when loading textures but that feature isn't exposed in this package.

For that reason I think premultiply : Bool should be added as an additional field available when calling WebGL.Texture.loadWith. For WebGL.Texture.load the default value will be False.