Number of faces hit by ray in transparency shader



  • On 18/07/2016 at 06:46, xxxxxxxx wrote:

    How can I know how many faces a ray has hit, when rendering?
    I'm talking about a shader that would be placed in the transparency channel of a material.
    Does the BaseVolumeData.raydepth helps somehow?
    What is the depth?
    The SDK only tells this:

    The depth of the actual ray.

    Not very informative.



  • On 19/07/2016 at 01:50, xxxxxxxx wrote:

    Hello,

    indeed it seems that the "raydepth" is the number of intersections that happened before the ray in question hit the shader. You can easily test this by construction a scene with multiple reflections and the use the raydepth to define the output color of the shader.

    Best wishes,
    Sebastian



  • On 19/07/2016 at 06:23, xxxxxxxx wrote:

    Thank you, Sebastian.
    So, "raydepth" could mean number of reflections so far or number of faces crossed, depending on the context (reflection or transparency channel)?



  • On 20/07/2016 at 00:11, xxxxxxxx wrote:

    Hello,

    as it seems the number of intersections that happened before the ray in question hit the shader also includes refractions etc.

    best wishes,
    Sebastian



  • On 20/07/2016 at 00:23, xxxxxxxx wrote:

    Ok, thank you.
    That will be enough for me, I think.
    I can find out if my shader calculation is being performed inside a specific channel, can't I?



  • On 20/07/2016 at 08:34, xxxxxxxx wrote:

    Hello,

    I don't think so. The ShaderData.Output() function only receives the ChannelData argument and I think it does not contain any information on the context of the call. In fact, a shader can also be sampled not as part of a material but as part of an object (like in the "Displacer" deformer). In that case there would be no "channel" at all.

    For questions no longer related to the threads initial topic please open a new thread. Thanks.

    Best wishes,
    Sebastian



  • On 20/07/2016 at 08:46, xxxxxxxx wrote:

    Thank you, Sebastian.
    I will try to figure out by myself first but, if I get into trouble I will open a new thread.


Log in to reply