p_CSG



p_CSG - "Constructive Solid Geometry", boolean operations on geometric surfaces — computed during render. It's material shader. You may use it like common surface shader.
Shader allows you to use 2 objects in boolean operation
Please view tutorial about using p_CSG shader (comming soon)

difference
Difference Mode

differencedifference
Difference Mode

intersection union
Intersection and Union Mode


Difference Mode in animation


Color A
Shader for object A. You may connect any material shader you want or just use constant color
Color B
Shader for object B. You may connect any material shader you want or just use constant color
Object A
Name of objects first object (transform node)
Object B
Name of objects second object (transform node)
Swap AB
For 'Union' swap materials for A and B
For 'Difference' swap A and B objects without materials
For 'Intersection' swap materials for A and B
Mode
Operation Mode

'Union' (0) - Union operation (A+B). Intersection part removed
'Difference' (1) - Difference operation (B-A)
'Intersection' (2) - Intersection operation
Check Camera
This option should be enabled if your camera placed inside one of operated object for fixing incorrect volume computation. Shader trace ray probe backward of view direction and check object name and edit current 'volume' statement

How it works?
p_CSG really don't change any geometry, it just make part of objects fully trasparent or not dependency of operation type and object name
Shader sensitive to normal orientation and object name

Limitations Warning!

p_CSG shader have many limitations:
1. Only two objects may be used for operation in one shader. Groups is not supported. In some cases for 'Difference' operation if you need cut many objects by one, you may create p_CSG shader for every object
2. Only raytrace shadows and only in 'segments' mode produce correct shadows
3. p_CSG shader produce only black non trasparent shadows. This limitation may be removed in future versions
4. Result willl be incorrect if camera placed inside both of operated objects. Please avoid of placing camera inside operated objects
5. Occlusion shader will ignore p_CSG operations and result will be incorrect
6. Please avoid of placing another objects inside operated objects. In some cases it also may produce incorrect result or shadows
7. p_CSG don't work in rasterizer mode