'Boolean' shader

I have very big mesh around 4 mil faces with multires, and displacement on top, and I want to cut one little part out. Edit mode is unusable with that polycount, and when I tried it it destroys displacement shader. Boolean modifier also leaves artifacts and displacement looks horrible on the cutted edge.

So I came with the idea of ‘cutting’ one mesh with another using shaders. Is it possible? The object that I want to cut is essencially a plane (white on mockup), so I dont care about the inside of the mesh.

Expected result:

I think to do it at a shader level you have to use OSL shaders which I know nothing about.

You could subdivide your cube cutter object a bit. Give it an Intersect Boolean modifier with the plane as target. Apply that. Move it up a tiny amount to make sure it’s above the surface ever so slightly and check Holdout in Visibility section of Object Properties

Thanks for the tip. There is only one problem, the holout is going through all mshes underneath the cutted plane. And the shadow of the cutted mesh casted on the bottom one is not right.

Defining a volume inside a shader is certainly possible. Mix with transparency on the basis of object coordinates.length < n, and you have a sphere cut out of your mesh. You’ve defined a sphere, all points within a certain distance of another point.

But these volumes aren’t defined by meshes, but by math, and doing it with a complicated volume wouldn’t be easy.

For your example, a cube is object.x < 1 and object.x > -1 and object.y < 1 … and object.z > -1.

1 Like

Thanks @bandages, that sounds exactly what I’m working with right now - defining a mask with math nodes inside plane shader and then using it as a factor in mixing transparency and accual shader.