Skip to content

Conversation

@SoftwareMechanic
Copy link
Contributor

@SoftwareMechanic SoftwareMechanic commented Nov 17, 2025

Fix #1365

this could be useful to represent assets on tiles, especially photorealistic tiles, without using the TileFlatteningPlugin.
the purpose is to render our models in their original position, removing artifacts given by the photorealistic tiles.

this pull request is aimed at solving (partially) the issue #1365

I say partially because as we have discussed in the issue, there could be other ways, with other pros/cons to achieve the same effect.

questions:

  1. do we want it to extend the geojson class as it is now in this initial state of the pr, or a new class only for it?
  2. is it ok to modify the wrapOverlaysMaterials like has beeen done, or we somehow want to use the alphamap default property from the materials?

@gkjohnson
Copy link
Contributor

gkjohnson commented Nov 18, 2025

Thanks! I think for the API we can keep things more simple. Something like so:

new GeoJSONOverlay( {
  // ...
  alphaTest: 0.5, // or [ 0 to 1 ] (default 0)
  alphaMode: 'global', // or 'layer' (default)
} );

"alphaTest" indicates the usage of alpha clipping and the associated alpha value to perform a hard clip at, similar to the material alpha test (eg "0" indicates normal transparency). "alphaMode" would indicate whether the alpha is used to blend to the layer below it (current behavior) or multiply the opacity by the accumulated alpha for the fragment (open to another name for this, as well). This should the change a lot more simple.

Let me know if you need any clarification or would like me to make any of those changes. This looks great, though.

edit

this pull request is aimed at solving (partially) the issue #746

This issue is actually a bit outdated and unrelated to this issue. This was about trying to limit the downloaded tiles based on whether the camera could see the geometry (checking view direction to normals) in order to limit tile loads but it turns out it doesn't save a whole lot and most tiles don't have a large enough (or any) "non-renderable" angle for this to make sense.

…m the GeoJSON Plugin

Managed alphaMode, alphaTest, and alphaInvert for clipping inside the geojson geometry or outside
@SoftwareMechanic
Copy link
Contributor Author

SoftwareMechanic commented Nov 18, 2025

I tagged the wrong issue 🤦 I modified the message.

I also managed an "alphaInvert" parameter, to let the user decide what to occlude - the GeoJson Geometries, or everything except it.

if there is something which is not as you expected, don't hesitate to correct me

@gkjohnson
Copy link
Contributor

Thanks - I think I'm seeing a more simple way to handle this, now, but I think it's difficult to communicate the strategy. They might be significant but I'll make some changes to this PR when I get a chance and we can roll back if needed

@SoftwareMechanic
Copy link
Contributor Author

It is fine for me, I will keep an eye on this PR 💯

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