How to exclude ground when post-processing is turned on

When the node material is set to Ground, adding a post-processing Ground material will enhance the visual effect.
How to exclude ground when post-processing is turned on
before add post-process:

after add post-process:

Do something like

    const camera2 = camera.clone("camera2")
    scene.activeCameras = [camera, camera2];
    camera2.layerMask = 0x10000000;
    ground.layerMask = 0x10000000;

Since you can choose not to attach the postprocess to the second camera you are good to go…

add codes at line 8240-8245 not see ground.

    //add new camera only see ground.
    const camera2 = camera.clone("camera2")
    camera2.id = "camera2";
    scene.activeCameras = [camera2, camera];
    camera2.layerMask = 0x10000000;
    ground.layerMask = 0x10000000;

PG:

Sorry, swap the cameras here:

scene.activeCameras = [camera, camera2];

if code

scene.activeCameras = [camera, camera2];

so
scene.activeCameras[1] == scene.activeCamera
but I want scene.activeCamera to be camera and not camera2.
How do I get over this?

Is there any particular reason for this?

Technically it shouldn’t be a problem having two cameras on the scene. This is common when using layerMasks.

the layerMask of camera lower the layerMask of camera2
so sphere layer on the back of the sphere on the ground.

However I am trying to make a scene where the ball is the main scene and the ground is the secondary, scene.activeCamera(the main camera) is camera not camera2

How to overcome this difficulty

PG:

You mean render the ball in front of the ground? Or what? Sorry :slight_smile:

You mean render the ball in front of the ground?
Yes!

Render the sphere to the ground before while post-processing the renderList to exclude the ground

PG: How to exclude ground from post-processing renderList

Bro, like for real. I can’t get any meaningful from this sentence.

That’s what we are doing here the whole time. You have two cameras and postprocess only the one. That one will render the meshes wich you want to include in the postprocess so they will have the same layermask as the camera rendering them.

Set the other camera’s and meshes (wich woll not be processed) layermask to a different value as the first camera’s value is. But for the excluded meshes and other camera the value is same.

Like shown here:

Thank you, you understand my understanding and I feel close to success

But there’s an error.
post process should only work camera2,I can’t see ground

PG:

camera is displaying the ground
camera2 is displaying the sphere
camera renders first, camera2 second (activeCameras array order)
blur postprocess on camera only