Skip to content

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

Open
neomantra wants to merge 1 commit into
stackgl:masterfrom
neomantra:master
Open

add support for half-float and probe for format renderability, closes…#15
neomantra wants to merge 1 commit into
stackgl:masterfrom
neomantra:master

Conversation

@neomantra

Copy link
Copy Markdown

#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