Feature: Hide min bound#121
Conversation
There was a problem hiding this comment.
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
hidelowerboundURL 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.
| 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) { |
There was a problem hiding this comment.
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).
Deploying gridlook with
|
| Latest commit: |
922d0ec
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bb30e235.gridlook.pages.dev |
| Branch Preview URL: | https://feature-hideminbound.gridlook.pages.dev |
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