Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/components/textures/shaders/DDAFrag.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ bool sampleVoxel(vec3 texCoord, out float d, out float biVal, out bool isnan) {
vec2 bivar = sample2ToOrder(localCoord, textureIdx, bivariateSelection);
d = bivar.r;
biVal = bivar.g;
biNaN = isNaNBits(d) || isNaNBits(biVal);
biNaN = isNaNBits(d) || isNaNBits(biVal)
|| (!useF16 && d == 1.0) || (!useF16 && biVal == 1.0);
isnan = biNaN;
} else{
d = sample1(localCoord, textureIdx);
rescaler(d);
isnan = isNaNBits(d) || (!useF16 && d == 1.0);
d = max(min(d * cScale + cOffset, 0.995), 0.0);
}
isnan = isNaNBits(d) || (!useF16 && d == 1.0);
return d >= threshold.x && d <= threshold.y;
}

Expand Down
5 changes: 3 additions & 2 deletions src/hooks/useCoordBounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
if (!borderCompatible) return{
lonBounds:[-Math.PI, Math.PI], latBounds:[-Math.PI/2, Math.PI/2]
}
const {lonExtent, latExtent, lonResolution, latResolution} = usePlotStore(useShallow(s => s))

const {lonExtent, latExtent, lonResolution, latResolution} = usePlotStore(useShallow(s => ({
lonExtent: s.lonExtent, latExtent: s.latExtent, lonResolution: s.lonResolution, latResolution: s.latResolution
})))
const [lonBounds, latBounds] = useMemo(()=>{ //The bounds for the shader. It takes the middle point of the furthest coordinate and adds the distance to edge of pixel
const newLatStep = latResolution/2;
const newLonStep = lonResolution/2;
const newLonBounds = [lonExtent[0]-newLonStep, lonExtent[1]+newLonStep]
let newLatBounds = [latExtent[0]-newLatStep, latExtent[1]+newLatStep]
flipY && newLatBounds.reverse()

Check warning on line 22 in src/hooks/useCoordBounds.tsx

View workflow job for this annotation

GitHub Actions / core

Expected an assignment or function call and instead saw an expression
return [newLonBounds, newLatBounds]
},[latExtent, lonExtent, lonResolution, latResolution, flipY])
return {
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useDataFetcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ export const useDataFetcher = () => {
const targetDim = dimArrays[yIdx] || dimArrays[0];
const shouldFlip = (targetDim && targetDim.length >= 2) ? targetDim[1] < targetDim[0] : false;
setFlipY(shouldFlip);
parseExtent();
if(preProject)reproject();
else handleIrregularGrid();
}))
Promise.all(promises).then(() =>{
parseExtent();
createDataTexture();
if(preProject)reproject();
else handleIrregularGrid();
setShow(true);
setPlotOn(true);
setStatus(null);
Expand Down
Loading