<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On 03/11/2007, at 2:34 AM, <A href="mailto:toontje@telbonet.an">toontje@telbonet.an</A> wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I would like to see the shadow pass Z-valued. Every pixel in the shadow</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">area should have the information what the relative distance is from the</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">lightsource(s) to the object(s) that is causing the shadow. That way, I</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">think, you can feed this information into the defocus node. The result</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">should be the same as raytraced soft shadows (sharp near object and blurry</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">far from the object). The other aspect is that the blurrier the shadow</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">gets, the less intense it is. But that is not a problem because you can</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">stack alpha on the very same z-values.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I wonder why this was never coded into Blender, since I think this is the</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">cheapest way (render time and coding) to achieve this.</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>It was never coded because it won't really work - it's a lot more complicated than that.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>It's not really worth going into detail about here, but you can find out why, by reading up on how raytraced shadows work, but a few hints to consider why this isn't that feasible is:</DIV><DIV>* it's not the distance from the light source to the shaded point that's important, it's the distance between the shaded point and the shadow caster (and the relationship to coverage of the light area) that's important, and there's no way to get enough accurate information on the whereabouts of geometry in the compositor (for that you need, surprise, the scene geometry information and an acceleration structure like an octree)</DIV><DIV>* there can be multiple light sources, multiple light directions, light areas/shapes. This is much more info than can be stored in a single float channel.</DIV><DIV>* shadows do not get uniformly 'blurred' in screen space, the softness happens along the geometry itself relative to the light location and angle.</DIV><DIV>* shadows behind transparent/refracting/motion blurred objects</DIV><DIV>* and so on...</DIV><DIV><BLOCKQUOTE type="cite"> </BLOCKQUOTE><BR class="khtml-block-placeholder"></DIV><DIV>cheers</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Matt</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>------------------------------------------</DIV><DIV>Matt Ebb . matt@mke3.net . <A href="http://mke3.net">http://mke3.net</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN></SPAN></SPAN> </DIV><BR></BODY></HTML>