Using p_CSG shader




Simple Scene

1. Create new scene. Create 2 intersected objects and lights, like this:

simple scene

2. Create p_CSG shader. And assign it to both objects.
If you are using 3dsmax, you should create 'mental ray' material and assign p_CSG to 'Surface' slot

3. Create two shaders for A and B objects. For example mib_illum_phong or p_MegaTK

4. Connect these shaders to 'Color A' and 'Color B' of p_CSG shader

connection graph

5. Open p_CSG property and set 'Object A' and 'Object B' field with name of your objects. For example "nurbsTorus1" and "nurbsSphere1"
If you are using 3dsmax you should add "|Instance(Mesh00)" to end of name of your object. For example "Torus01|Instance(Mesh00)" or "Sphere01|Instance(Mesh00)". Because 3dsmax rename all objects during export to *.mi. You may also export your scene to *.mi and find name of your objects in it

render1

6. Render

render1


7. Now we want get correct shadows... So, just enable it in your light (only raytrace shadow)


8. Go to Render Setting and set 'Shadow Method' to 'Segments'

9. Open Shading Group node of you p_CSG shader and assign same p_CSG shader to 'Shadow Shader' slot:
If you are using 3dsmax, open 'mental ray' material and copy p_CSG shader from 'Surface' slot to 'Shadow' with 'Instance' method

render1

10. Render

render2

11. Well done.

12. If you want add displacement to some object. You will need duplicate your p_CSG shader with 'With Connections to Network'. Please don't forget to connect p_CSG2 as shadow shader too

13. Assign new p_CSG shader to some object (for example torus)

connection graph

14. Now we just need add displacement to p_CSG2SG node

connection graph

15. Render

render3