elm-community / elm-webgl

Moved to elm-explorations/webgl

Home Page:http://package.elm-lang.org/packages/elm-explorations/webgl/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide the ability to load a texture without an implicit UNPACK_FLIP_Y_WEBGL

7sharp9 opened this issue · comments

Currently the option UNPACK_FLIP_Y_WEBGL true is always implicit, it would be ice if that an other options could be applied with a version of loadtTextureWithConfig function or similar:

  • gl.PACK_ALIGNMENT
    Affects packing of pixel data into memory. The initial param value is 4, but it can be set to 1,2,4, or 8.
  • gl.UNPACK_ALIGNMENT
    Affects unpacking of pixel data from memory. The initial param value is 4, but can be set to 1,2,4, or 8.
  • gl.UNPACK_FLIP_Y_WEBGL
    Flips the source data along its vertical axis when texImage2D or texSubImage2D are called when param is true. The initial value for param is false.
  • gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL
    Multiplies the alpha channel, if it exists, into the other color channels during the data transfer when texImage2D or texSubImage2D are called when param is true. The initial value for param is false.
  • gl.UNPACK_COLORSPACE_CONVERSION_WEBGL
    The browser's default colorspace conversion is applied when texImage2D or texSubImage2D are called with an HTMLImageElement texture data source. The initial value for param is BROWSER_DEFAULT_WEBGL. No colorspace conversion is applied when set to NONE.

I've implemented flipY option for the version 2.0, that is set to True by default to not unexpectedly break the existing shaders. I also documented that this happens implicitly by default.

As for the rest options, I don't really know if they are useful, because the only way to create a texture is by loading an image. We need more real use cases.