custom depth stencil write mask Sometimes it works but not always.

I was trying to make some water material and post process with custom depth and stencil
but, custom depth stencil write mask doesn’t work properly.

I made water meshes stencil mask with seventh and eighth bit only, other meshes and the character are just turn on stencil with default mask setting without bit masking.

But, it is not working well.

Skeletal meshes seems never allow any bit of stencil data while its masking is default
however Static meshes are not always.

and editor, simulate, standalone play’s result are not same.

When you disable depth for stencil, the draw order of the meshes will determine which stencil value with end up being on top.