-
Notifications
You must be signed in to change notification settings - Fork 19
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
Support for half float textures #11
Comments
Hmm... Maybe the way to deal with this is to have the precision be some string parameter? Perhaps the user cold specify an argument like:
|
Was also thinking about some bit flag, like {format: FLOAT | HALF_FLOAT | UNSIGNED_BYTE } so you can set the preferred order. Not sure if that makes sense though |
Maybe.. Sometimes with float textures it is desirable to have them as an upgradeable option, since maybe you can use lower precision and get away with it. Perhaps you could specify a list of precisions like:
|
Yeah, that makes more sense to me, although I can't imagine a scenario wher you'd require |
I guess if you put 8 first, you'll always get it. But there might be situations where maybe you'd prefer 32 vs 16 in different orders (based on memory restrictions). I'm open to suggestions here on alternative ways to do this. |
…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.
I took a slightly different approach from the
I also probe if these are actually renderable by the context. It's a little extra work, but FBOs shouldn't be created very often. EDIT: had mistyped |
yes! please merge this!! |
Like the title says, It would be really handy to add support for half float textures. This would be really beneficial for mobile devices
I'm not sure how the api would look, however the current
preferFloat
,float
is a bit error prone and ambiguous if you consider{ float:false, preferFloat:true }
. Could it be better to just pass intgl.FLOAT
orext.HALF_FLOAT_OES
directly?The text was updated successfully, but these errors were encountered: