Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for half-float and probe for format renderability, closes… #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

neomantra
Copy link

#11

Adds two new options:

  • like options.float, options.halfFloat fails if it cannot create
    the half-float texture
  • like options.preferFloat, options.preferHalfFloat will try
    half-float, then float, then fail to 8-bit.
  • options.preferFloat now tries a half-flat before failing to 8-bit

The function isFormatRenderable checks if a given format can
actually be rendered to by attaching a texture to a framebuffer.
Checking the WebGL extension alone is insufficient due to variations
in implementations (e.g. iOS supports OES_texture_float, but only
for reading, not for writing). As this is a FBO and thus intended for
writing, this extra check is important.

…tackgl#11

Adds two new `options`:

  * like `options.float`, `options.halfFloat` fails if it cannot create
    the half-float texture

  * like `options.preferFloat`, `options.preferHalfFloat` will try
    half-float, then float, then fail to 8-bit.

  * `options.preferFloat` now tries a half-flat before failing to 8-bit

The function `isFormatRenderable` checks if a given format can
actually be rendered to by attaching a texture to a framebuffer.
Checking the WebGL extension alone is insufficient due to variations
in implementations (e.g. iOS supports OES_texture_float, but only
for reading, not for writing). As this is a FBO and thus intended for
writing, this extra check is important.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant