---
title: "Remove self shadowing from a mesh but still cast shadows"
canonical: "https://documentation.chaos.com/space/VMAYA/126589709/Remove%20self%20shadowing%20from%20a%20mesh%20but%20still%20cast%20shadows"
format: markdown
---
copied from  [https://forums.chaosgroup.com/forum/v-ray-for-maya-forums/v-ray-for-maya-general/980136-remove-self-shadowing-from-a-mesh-but-still-cast-shadows](https://forums.chaosgroup.com/forum/v-ray-for-maya-forums/v-ray-for-maya-general/980136-remove-self-shadowing-from-a-mesh-but-still-cast-shadows)

attached very simple example scene on the same forum thread.

todo:

1. change the below into an easy-to read tutorial
2. change title to something more meaningful afterwards
3. add a more meaningful example scene
4. add some toon-ish diagrams like the ones found here [Controlling Shadows Using the Sampler Info Node](https://docs-chaos.atlassian.net/wiki/pages/createpage.action?spaceKey=VRAY3MAYA&title=Controlling%20Shadows%20Using%20the%20Sampler%20Info%20Node)
5. somehow merge this page and this [Controlling Shadows Using the Sampler Info Node](https://docs-chaos.atlassian.net/wiki/pages/createpage.action?spaceKey=VRAY3MAYA&title=Controlling%20Shadows%20Using%20the%20Sampler%20Info%20Node) into one.
6. both should probably be something like two separate parts explaining that this approach makes selective shadow casting and can be used to disable one object from casting shadow to another one, but just as well can be used to simply remove self-shadowing

 

Q: <span style="color: #252c2f">is there any way I can remove the self shadowing of a mesh, but still cast and receive shadows from other objects? Or any workarounds for this,</span>

A: <span style="color: #252c2f">There is a somewhat complicated way. I just gave it a try and seems to work for me.</span>

<span style="color: #252c2f">Here's the gist of it: I'm using the samplerInfo with V-Ray additional outputs. The parentObjIDTex output goes into the switch input of a vraySwitchMtl. The object, for which I want to only disable self-shadowing, gets V-Ray Material Override attributes and the SwitchMtl is assigned as a shadow material. The SwitchMtl contains two materials - one opaque and one transparent (shadow material overrides only work with transparency and nothing else). Then I assign a V-Ray objectID to my non-self-shadowed object and set it to whatever slot my transparent material occupies in the switchMtl.</span>  
<span style="color: #252c2f">For exampe, let's say my SwitchMtl has an opaque material at slot 0 and a transparent at 1. The objects that receive shadows from my special object, should have an object ID 0, and those that won't receive shadows from the special object will have an ID of 1 (they will receive transparent shadows).</span>  
<span style="color: #252c2f">Since the special object also casts shadows onto itself, and its ID is 1, it will not receive shadows from itself. All other objects don't need an objectID to cast shadow onto the special object.</span>  
  
<span style="color: #252c2f">This is probably a bit better described in this tutorial: </span>[https://docs.chaosgroup.com/display/...pler+Info+Node](https://docs.chaosgroup.com/display/VRAY3MAYA/Controlling+Shadows+Using+the+Sampler+Info+Node)  
  
<span style="color: #252c2f">And I've attached a sample scene to illustrate the setup to this post. Let me know if that works for you or if you need any other help with this setup.</span>