Visitar URL original
fix(fill-style): correct pattern orientation by flipping texture y-axis (Fixes #10548) by waterWang · Pull Request #10550 · visgl/deck.gl · GitHub
Skip to content

fix(fill-style): correct pattern orientation by flipping texture y-axis (Fixes #10548) - #10550

Merged
Pessimistress merged 3 commits into
visgl:masterfrom
waterWang:fix/fill-style-extension-pattern-flip
Sep 1, 2026
Merged

Pessimistress merged 3 commits into
visgl:masterfrom
waterWang:fix/fill-style-extension-pattern-flip

Conversation

@waterWang

Copy link
Copy Markdown
Contributor

Fix pattern orientation in FillStyleExtension

Problem

FillStyleExtension renders patterns flipped vertically (top-to-bottom) compared to the original asset. A line pattern going from bottom-left to top-right (/) appears as bottom-right to top-left (\).

Root cause

The texture coordinate system has y=0 at the bottom (OpenGL convention), but the geometry coordinates have y increasing upward. When computing texCoords from patternUV (which is derived from geometry coordinates), the y-axis was not flipped, causing the pattern to appear inverted.

Fix

Flip the y-axis of patternUV when computing texture coordinates:
```glsl
// Before
vec2 texCoords = fill_patternBounds.xy + fill_patternBounds.zw * patternUV;

// After
vec2 texCoords = fill_patternBounds.xy + fill_patternBounds.zw * vec2(patternUV.x, 1.0 - patternUV.y);
```

Breaking change

This fix changes the visual output of FillStyleExtension for all users who rely on the current (incorrect) pattern orientation. The issue author noted this is a breaking change, but the fix aligns the rendering with the principle of least surprise — patterns should render in the same orientation as the original asset.

Closes #10548

@chrisgervang

Copy link
Copy Markdown
Collaborator

Thanks. Please include unit tests and a screenshot from the website example to validate this addresses the issue.

@chrisgervang

Copy link
Copy Markdown
Collaborator

Hey @Pessimistress, this is a breaking change so my recommendation is approving but waiting for v10. Wdyt? #10548 seems valid

@chrisgervang chrisgervang added this to the v10 milestone Aug 19, 2026
@coveralls

coveralls commented Aug 19, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.336% (-0.01%) from 82.346% — waterWang:fix/fill-style-extension-pattern-flip into visgl:master

@Pessimistress

Copy link
Copy Markdown
Collaborator

@chrisgervang I think it's acceptable to make a breaking change if it's correcting wrong behavior.

@waterWang have you tested OrthographicView with flipY:true (top-left y)? Both configurations should render to the same orientation.

@Pessimistress

Copy link
Copy Markdown
Collaborator

Please add a note to docs/upgrade-guide.md

@greptile-apps

greptile-apps Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR adjusts FillStyleExtension’s fragment shader to vertically invert the repeating pattern coordinate before sampling the texture atlas.

  • Flips only the pattern-local y coordinate.
  • Leaves pattern placement, atlas bounds, masking, and blending unchanged.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains in the eligible follow-up review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
modules/extensions/src/fill-style/shader-module.ts Updates fill-pattern texture sampling to invert the local y coordinate and correct the rendered pattern orientation.

Reviews (2): Last reviewed commit: "Merge branch 'master' into fix/fill-styl..." | Re-trigger Greptile

@felixpalmer

Copy link
Copy Markdown
Collaborator

@chrisgervang @Pessimistress I agree it is fine to make this change in 9.4

@Pessimistress
Pessimistress merged commit d24b33b into visgl:master Sep 1, 2026
7 checks passed
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.

[Bug] FillStyleExtension flips patterns top-to-bottom

5 participants