Skip to content

Feature: Hide min bound#121

Merged
wachsylon merged 2 commits into
mainfrom
feature/hideminbound
Apr 10, 2026
Merged

Feature: Hide min bound#121
wachsylon merged 2 commits into
mainfrom
feature/hideminbound

Conversation

@Karinon

@Karinon Karinon commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

Added functionality to make min bound-values of the colormap transparent in order to allow show the globe underneath it. Probably useful for precipitation #107

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an option to make values at/below the colormap lower bound render transparent so the globe (and masks) can show through—intended for “radar-like” precipitation/cloud views (Issue #107).

Changes:

  • Introduces a new hidelowerbound URL parameter and syncs it with app state.
  • Adds a “hide min” checkbox to the colormap controls UI and wires it to the store.
  • Extends grid shaders/materials to discard fragments with values <= hideBelowValue, updated when bounds/colormap settings change.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils/urlParams.ts Adds HIDE_LOWER_BOUND URL parameter constant.
src/ui/overlays/controls/ColormapControls.vue Adds UI checkbox bound to hideLowerBound.
src/ui/overlays/Controls.vue Initializes hideLowerBound from URL params on mount.
src/ui/grids/Triangular.vue Triggers colormap update when hideLowerBound changes.
src/ui/grids/Regular.vue Triggers colormap update when hideLowerBound changes.
src/ui/grids/IrregularDelaunay.vue Triggers colormap update when hideLowerBound changes.
src/ui/grids/Irregular.vue Triggers colormap update when hideLowerBound changes.
src/ui/grids/Healpix.vue Triggers colormap update when hideLowerBound changes.
src/ui/grids/GaussianReduced.vue Triggers colormap update when hideLowerBound changes.
src/ui/grids/Curvilinear.vue Triggers colormap update when hideLowerBound changes.
src/ui/grids/composables/useSharedGridLogic.ts Sets hideBelowValue shader uniform based on bounds + toggle.
src/store/useUrlSync.ts Syncs hideLowerBound to URL hash.
src/store/store.ts Adds hideLowerBound state to the main store.
src/store/paramStore.ts Adds paramHideLowerBound and maps hidelowerbound -> store param.
src/lib/shaders/gridShaders.ts Adds hideBelowValue uniform and discards values below it; sets uniform defaults in GPU materials.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 83 to +87
uniform float posterizeLevels;
uniform float hideBelowValue;

void main() {
if (is_nan(v_value) || v_value == fillValue || v_value == missingValue) {
if (is_nan(v_value) || v_value == fillValue || v_value == missingValue || v_value <= hideBelowValue) {

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scalarColormapFragmentShader now depends on the new hideBelowValue uniform, but makeColormapLutMaterial() (which uses this fragment shader) does not define that uniform in its uniforms map. In Three.js this means hideBelowValue will default to 0.0, causing values <= 0 to be rendered transparent in the LUT unexpectedly. Add hideBelowValue (defaulting to the same sentinel value used elsewhere) to the uniforms for makeColormapLutMaterial() (and any other materials using scalarColormapFragmentShader).

Copilot uses AI. Check for mistakes.
Comment thread src/ui/overlays/Controls.vue
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 10, 2026

Copy link
Copy Markdown

Deploying gridlook with  Cloudflare Pages  Cloudflare Pages

Latest commit: 922d0ec
Status: ✅  Deploy successful!
Preview URL: https://bb30e235.gridlook.pages.dev
Branch Preview URL: https://feature-hideminbound.gridlook.pages.dev

View logs

@wachsylon
wachsylon merged commit caedd83 into main Apr 10, 2026
3 checks passed
@Karinon
Karinon deleted the feature/hideminbound branch April 24, 2026 07:02
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