positionMC resets in each loaded tile

Hello there,

I’ve run into some unexpected behavior when trying to color my point cloud. In essence, I want to color the cloud based on height via a custom shader. I figured that it’s probably best to do that in local model space, so I’m using fsInput.attributes.positionMC in the fragment shader.

However, it seems that every tile’s positionMC is based on the tile itself, not on the entire model. To visualize and demonstrate, instead of coloring height, I’ve been coloring the y-axis. You can see in the images that once a second tile is being loaded, that tile has some green points in it, which means that its local y position is smaller than 5 in this example


Here’s the sandcastle. If you uncomment the second url, it will load a photogrammetry model instead in which this behavior does not exist.

My question is, is this intended? If so, I guess I would have to try and use world coordinates, but I’d rather avoid the loss in precision.

Best regards,

Just as an update if anyone else runs into this problem, I solved it by using the positionWC attribute instead of positionMC, and then passed my tileset’s inverse model matrix as a uniform and multiplied. This translates the points to actual model space.

My assumption is that, for pointclouds at least, the positionMC attribute probably refers to the tile space instead of the model space. Still curious if this is intended?