Skip to content

Conversation

@kylebarron
Copy link
Member

What I am changing

How I did it

How you can test it

Related Issues

@mdsumner
Copy link

mdsumner commented Jan 15, 2026

my digital friend tells me that for signed integer textures (like this one https://projects.pawsey.org.au/image-cogs/images/gebco_boxmerc_8192.tif) this also needs

create-texture.ts

Signed integer COGs sampler type switching—it's a non-trivial fix involving shader generation or variants.

The CreateTexture module hardcodes uniform sampler2D textureName; on line 16.

For PR #180 to work with signed integer textures, you need:

A variant module (or dynamic generation) that declares uniform isampler2D textureName; for signed integers
Logic to select the correct module based on the COG's SampleFormat and BitsPerSample
The fix could be either:

  • Option A: Create separate modules (CreateTextureInt, CreateTextureUint)

  • Option B: Make the sampler type a template/parameter that gets substituted at runtime

Will also need to check if luma.gl is uploading the texture with the correct WebGL internal format (R16I for Int16). If it's normalizing the data to float on upload, then sampler2D would still be correct—but the console errors suggest it's keeping the integer format.

@kylebarron
Copy link
Member Author

This is not strictly true. Integer textures can use unorm samplers.

@mdsumner
Copy link

Ok, apologies for the noise (and I will pursue this more so I'm personally familiar with it).

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.

3 participants