Announcement

Collapse
No announcement yet.

intersect(RSRay &ray) and skipTag question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • intersect(RSRay &ray) and skipTag question

    Hi,
    I'm wondering what should I do if (this==ray.skipTag) inside intersect function? Should I return furthest intersection from ray origin and if this intersection isn't between ray.cmint and ray.cmaxt return false? I'm asking this because in vraysphere sample intersection that is farther from the ray origin is left in such case and in vrayplane its just false returned.

  • #2
    If (this==skipTag), it means that the origin of the ray is on the surface of the same primitive; what you do in that case depends on the specific primitive - for triangles, the ray is skipped (since obviously if a ray starts from a triangle it cannot intersect the same triangle again). For a sphere, a ray can intersect it at most twice and the logic is a little more complicated - we must return the furthest intersection (only if it is within cmint and cmaxt). For other primitives the logic would be different, depending on how many times a ray can intersect the primitive.

    The purpose of this check is to avoid "surface acne" where shadow and reflection/refraction rays starting from a point on the surface end up intersecting the same portion of the surface again.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      In my case its Quaternion Julia Set so ray can intersect primitive multiple times. If I understand this correctly I should return intersection which is next to ray origin (and check if I don't end up with same point).

      Comment


      • #4
        Yep, this is correct.

        Best regards,
        Vlado
        I only act like I know everything, Rogers.

        Comment

        Working...
        X