Announcement

Collapse
No announcement yet.

Raytracing a point cloud

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

  • Raytracing a point cloud

    I'm looking into ways of converting a scene to a pointcloud, and the naive approach would seem to be baking the whole scene, and sampling the UVW of each face to get the texture sample, however the baking part of this is laborious and error prone. Ideally what I'd like to do is raytrace through the scene bounding box, without termination on the first hit, recording each point with its position, normal, and colour. I'd either do that via an orthogonal grid, or per-face normalized via some metrics to get an appropriate correct point density.

    My question is, would I do this via a custom camera, and secondly, how would I tell vray to record each successive hit along a ray rather than terminating at the first hit?

  • #2
    You could implement a custom camera, but it will have to go hand in hand with a custom intersection shader so that camera rays are continued after the first hit. If you get the ray differentials correct, this could also work with the light cache and the irradiance map.

    Or you could instead implement a custom global illumination engine, or a shader or something. You'll have to create a ray context, set up a ray, call the findIntersection() method of V-Ray to figure out where the hit point is, record the point and the normal, shade the point, and then set up the ray to continue the trace. This would allow you to trace any rays you want but will be limited to brute force GI only.

    I could probably get you some example for the first approach, if you are interested.

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

    Comment


    • #3
      Hi Vlado - That would be great if you could do an example! I have some idea of how it can be done, but as usual much of the preliminary work is getting up to speed with the VRay SDK again, so an example would be of great help.

      Comment

      Working...
      X