Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

Provide the ability to load a texture without an implicit UNPACK_FLIP_Y_WEBGL #36

Closed
7sharp9 opened this issue Jul 26, 2016 · 1 comment

Comments

@7sharp9
Copy link

7sharp9 commented Jul 26, 2016

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.
@w0rm
Copy link
Member

w0rm commented Dec 13, 2016

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.

@w0rm w0rm closed this as completed Dec 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants