Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

MeshTextureLayer passes an uninitialized `color` to `DECKGL_FILTER_COLOR`

Open Beginner friendly
#691 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

Start at packages/deck.gl-raster/src/mesh-layer/mesh-layer-fragment.glsl.ts around lines 29-31, where vec4 color is declared uninitialized and passed to DECKGL_FILTER_COLOR. The fix is the one-line change suggested in the issue, vec4 color = vec4(0.0);. Done means the variable is initialized before the hook and the package still builds (run the repo's TypeScript build/tests to confirm no downstream shader code assumed the old form).

Written by the indexing model from the issue text.

Description

bug webgl

[!NOTE]
This issue was written by Claude (Claude Code) on behalf of @kylebarron, not by @kylebarron.

MeshTextureLayer's fragment shader declares color without a value and passes it straight into DECKGL_FILTER_COLOR:

https://github.com/developmentseed/deck.gl-raster/blob/20bf95fccabbb48c9c5677d57d970a36103158c9/packages/deck.gl-raster/src/mesh-layer/mesh-layer-fragment.glsl.ts#L29-L31

In GLSL, reading an uninitialized variable is undefined behavior, so the driver may return any value.

This causes no visible bug today, because the first module in every built-in pipeline overwrites color without reading it (CreateTexture when image is set, CompositeBands in MultiCOGLayer). But nothing enforces that:

  • MeshTextureLayerProps allows renderPipeline: [] with no image, which renders the uninitialized value.
  • A custom pipeline whose first module reads color before writing it (for example LinearRescale placed first) would work on whatever value happens to be there.

Fix

Initialize it to transparent:

vec4 color = vec4(0.0);

Found while reviewing #675, which combined this fix with re-declaring SimpleMeshLayer's sampler binding. This fix doesn't need that change.


🤖 Written by Claude Code on behalf of @kylebarron

Dominant language
TypeScript
Stars
231
Forks
33
Avg merge
9h 29m
Merged PRs (30d)
25

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from developmentseed/deck.gl-raster

All issues in developmentseed/deck.gl-raster

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.