Message adressed to Kevin_Ring / Issue with Cartographic Polygon

Hi, this message is adressed to Kevin_Ring, who has answered to me on the Cartographic Polygon topic, but as a new user, I can’t reply to you on this topic so I create this new topic, sorry but I need answer …

Finally found the Cesium for Unreal Content folder. I duplicated the MI_CesiumThreeOverlaysAndClipping, opened it but I don’t find my second CesiumPolygonRasterOverlay in the duplicated clipping layer in the Layer Asset menu, how do you do that please ?

Sorry but it’s absolutely not handy at all to configure it for a newbie …

Right, there’s no second clipping layer yet. You need to add it manually. It may help to read a bit about Material Layers first:
https://dev.epicgames.com/documentation/en-us/unreal-engine/using-material-layers-in-unreal-engine

It looks like you’ve already created a new layer in the material, named Layer 6. So rename that to Clipping2. Then select the same Layer Asset and Blend Asset that is used in the Clipping layer below it.

That’s it on the material side. Back in your Cesium3DTileset, add two CesiumPolygonRasterOverlay components, and select your two different polygons. In the first, the outer polygon that removes pixels, the Material Layer Key should be Clipping. In the second, the inner polygon that includes previously-excluded pixels, it should be Clipping2.

I think this won’t quite do the trick. The problem is that Clipping2 can’t up “bringing back” pixels that were previously excluded by the previous clipping. To fix that, you’ll need a new Material Layer Blend. Copy MLB_CesiumClipping, and select the new in the Clipping2 layer in your custom material.

Now edit your copy of MLB_CesiumClipping. You can think of this as “applying” the inner polygon clipping to a pixel that has already had the outer polygon clipping applied. The result so far comes from the “Bottom Layer”, and the new, inner polygon clipping mask comes from the Top Layer pixels (specifically the Red channel). Currently the two masks are multiplied together. Change that multiply instead to a Max function, and I think you’ll be in business.

I haven’t tested this, but I think it should work. Let me know how you go.

Hi Kevin, I’m very sorry but I still does not manage to do this …

As you can see on my picture attached, I have my both Material Layers named Clipping and Clipping2, the ML_CesiumRasterOverlay in both Layer Asset, MLB_CesiumCLipping in first Blend Asset (Clipping material) and duplicated MLB_CesiumCLipping1 in second Blend Asset (Clipping2 material).

My 2 polygons are in place with both CesiumPolygonRasterOverlay 1 and 2 in my Google Photorealistic 3D Tiles.

In the first CesiumCartographicPolygon_0 is selected with “Clipping” as Material Layer Key, in the second CesiumCartographicPolygon_1 with “Clipping2” as Material Layer Key.

Now I’m trying to edit my copy of MLB_CesiumClipping by replacing the multiply to a Max function, but it stills not working … could you send me a picture of the BP you have ?

I don’t have a BP, because I’ve never tried this myself. Please share your Blueprint, and tell us what you mean by “but it stills not working”, and maybe we can find a solution.

I don’t underdtand … in your previous reply you talked about to edit the copy of the MLB_CesiumClipping by replacing the Multiply function by a Max function ? That means in a Blueprint, right?

Please see attached my BP of my copy of MLB_CesiumClipping
Capture d’écran 2024-06-25 101553

You need to put the Max exactly where the Multiply was before. You’ve instead bypassed both the BreakOutFloat3Components and 1-x nodes.

Hopefully that will work, but as I mentioned before, I’ve never actually tried this! I’m just guiding you in something I think might work. If it still doesn’t work after making that change, please share what it is doing - screenshots, videos, etc. - and hopefully we’ll be able to figure out what to try next.

It does not work yet … I corrected my Blueprit as you can see attached.

The result is the cancellation of every effect of the Raster overlays, no tileset excluded :frowning:

I give up for now, I will follow the threads in the future to see if improvement comes soon

Thank you by the way for your following !

Your Blueprint looks good. The next thing to check is that you’re using the blend correctly.

You have two clipping material layers in your material, right? The first one (closer to the bottom!) shouldn’t use this material blend - it should use the original MLB_CesiumClipping. Then the one above it should use this MLB_CesiumClipping1. Is that what you have?

And you need to make sure they have different names. Call the bottom one Clipping0 and the top one Clipping1.

Then your outer polygon should have its MaterialLayerKey set to Clipping0 so it gets applied first. And the inner polygon should have its MaterialLayerKey set to Clipping1 so it is applied second.

Hopefully if it’s set up exactly like that, it will work. If it’s still not working, please share screenshots of your setup.