Skip to content

Conversation

@gkjohnson
Copy link
Contributor

@gkjohnson gkjohnson commented Nov 20, 2025

Related to #1368
Fix #1365

  • Adds "alphaMask" option for "ImageOverlays". When "true" the color of the layer is ignored and alpha is applied globally to all layers below this layer.
  • Adds "alphaTest" option for "ImageOverlays", which works similarly to three.js' "Material.alphaTest" option. When "0" no adjustment to alpha is done. When "true" alpha is clipped to [ 0, 1 ] with antialiasing for a clean mask an compatibility with alpha to coverage.
  • Adds "alphaInvert" option which inverts the alpha of the given layer.

Note

  • In order for the alpha to apply correctly the base materials have to be pre-configured to support alpha, in other words "transparent" or "alphaToCoverage" must be set to "true" by the user.
  • In order to render both "color" geojson (or other) overlays in addition to an alpha mask you will have to use two different layers.

TODO

  • Convert the new options to #defines and javascript-expanded loop to avoid additional if-statements.
  • Consider approach for using the "red" channel as alpha so mask overlays can use a smaller texture size.
image image

cc @SoftwareMechanic - I decided it was easier to make a separate PR, but I think this covers everything and should be a simpler change. Let me know what you think and if it looks good I'll handle the TODO items and get this merged.

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.

Hide Regions of 3D Tiles or Terrain with Clipping Polygons

2 participants