Repository navigation
Conversation
This was referenced Sep 17, 2026
earlybard
force-pushed
the
feat/multi-cog-signed-float-bands
branch
3 times, most recently
from
September 17, 2026 08:30
5f0e175 to
cf0ea26
Compare
earlybard
marked this pull request as ready for review
September 17, 2026 08:37
earlybard
force-pushed
the
feat/multi-cog-signed-float-bands
branch
from
September 22, 2026 05:52
a57ea76 to
a288c7e
Compare
…COGLayer createBandTexture accepted Uint8Array and Uint16Array only, so a MultiCOGLayer over Int16 or Float32 COGs threw on its first tile. Signed integers, Uint32Array and floats now upload as r32float, converted to Float32Array where needed, so the shader samples raw values. The integer texture formats would need an isampler2D/usampler2D the pipeline's sampler2D modules cannot read, and no normalised format holds a signed 16-bit sample without EXT_texture_norm16. Co-Authored-By: Claude Fable 5.1 <[email protected]>
earlybard
force-pushed
the
feat/multi-cog-signed-float-bands
branch
from
October 21, 2026 23:28
a288c7e to
13eedf2
Compare
…nnot filter them WebGL treats a float texture under a linear sampler as incomplete unless OES_texture_float_linear is present, and every fetch from an incomplete texture returns zeros. The extension is missing on roughly half of iOS and a quarter of Android WebGL2 contexts, so r32float bands rendered black there. Ask the device before choosing the sampler. Co-Authored-By: Claude Fable 5.1 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
earlybard
force-pushed
the
feat/multi-cog-signed-float-bands
branch
from
October 21, 2026 23:32
13eedf2 to
8b03f0d
Compare
kylebarron
added a commit
that referenced
this pull request
Oct 22, 2026
…COGLayer (experimental) (#777) > [!NOTE] > This PR was written by Claude (Claude Code), not by @kylebarron. `MultiCOGLayer` only uploaded `Uint8Array` and `Uint16Array` bands, so a source with any other sample type, such as Int16 or Float32, threw `Unsupported typed array type` on every tile. Signed integers, `uint32` and floats now upload as `r32float`, converted to `Float32Array` where needed, so the shader reads raw sample values. Integer texture formats would need an integer sampler, which `CompositeBands`' `sampler2D` can't read. Integers past 2^24 and `Float64Array` samples round to float32. These bands sample nearest where the device can't filter float32 textures: `createBandTexture` and the `resampling` prop from #775 both check with `isFilterable` from #773. luma.gl's `isTextureFormatFilterable` reports `r32float` as filterable on every WebGL2 device. A linear sampler without `OES_texture_float_linear` leaves the texture incomplete, so the scene draws black. `uint8` and `uint16` bands still reach the render pipeline normalized to 0-1, while every other type keeps its raw value. The `renderPipeline` docs now say so, since nodata values and rescale ranges depend on it. They also mark the other types as experimental: that split is likely to change so that every type arrives in the same units. The tile cache counts the float32 bytes uploaded, which for Int16 is twice the source size. Thanks to @earlybard for #650, which this finishes. His two commits are kept, followed by merges of main (resolved onto #773's `createBandTexture`) and docs commits. Checked in Chrome 155 on macOS with the Int16 scene from #650 (Digital Earth Australia Sentinel-2 ARD, nodata -999): - main: nothing draws, and every tile throws `Unsupported typed array type: Int16Array`. - This branch: the scene draws, and its nodata area is transparent. - This branch with `OES_texture_float_linear` hidden: the scene draws, sampling nearest. #650's own fallback drew it black. - The Sentinel-2 example's `uint16` scene is unchanged. Closes #650 🤖 Written by [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Dylan Jenkins <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello
First up, thanks for supporting this library and sorry for the 3-PR assault! Happy to work with you on any of these. I have a little COG mosaic viewer running that depends on these 3 PRs to run perfectly.
What I am changing
MultiCOGLayeronly knows how to useUint8ArrayandUint16Array, so point it at an Int16 or Float32 COG and every tile throwsUnsupported typed array type. I'm working with Int16 images with nodata -999.Signed ints,
Uint32Arrayand floats all now upload asr32float, converting toFloat32Arraywhere needed, so the shader sees raw sample values.A float texture only filters linearly where the device supports it (
OES_texture_float_linearin WebGL, missing on about half of iOS and a quarter of Android WebGL2 contexts per web3dsurvey). Without it the texture is incomplete and reads as zeros, socreateBandTextureasksdevice.isTextureFormatFilterableand falls back to a nearest sampler.How you can test it
On
mainevery tile fails; with this the scene renders.Related Issues
#180 is the
COGLayerside of the same problem, via snorm textures and a rescale module. This only touchesMultiCOGLayer, and uses floats because its pipeline works on raw values. Happy to change tack if you'd rather they share a format table.AI disclosure: written with Claude Code as a code assistant, reviewed by me.