Hiding the Intersection of Mesh

I have already tried and Familiar with the Clipping Plane … Also tried VEC4() Clipping Sphere in Custom shader. But thats not the way I need in my Case and dont know how to use custom Mesh in Custom Shader.

In my case I’m going to Import 2 gltf model as shown below and want to hide the intersection part as shown in Second Image below .

Also GlTF1 is Dynamic Shape it cound me in any Shape or size and both Gltf would have different Textures .

The Problem I’m facing is that they are Gltf and comes with StandardMeshMaterial Property which is good for applying texture …But I’m not sure if I can use Custom shader with StandardMeshMaterial and it not going to effect the texture I’m using.

And I’m not sure how to write Custom shader for this Scenerio as i’m new to Shaders

Image with Hidden Part :

If its going to Effect the Texture the I was planning of Exporting Gltf1 with extra Mesh on which I can apply custom Shader as shown below.

Any Help or Hint will be helpful.

Thanks in Advance :slight_smile:

Can you please try this:

// GLTF1

gltf.scene.traverse( ( object ) => {

    object.renderOrder = - Infinity;

} );

// GLTF2

gltf.scene.traverse( ( object ) => {

    if ( object.material ) object.material.depthWrite = false;

} );

In this way, GLTF1 should always be rendered on top of GLTF2. This only works if both objects are opaque.

I have done this before and this is what was happening when I tried .