I am debugging my optix shader, and am getting results that I don’t understand. First off I just have a simple cube in the scene, and my closet hit program is correctly show the color/texture. For something else I wanted to quickly do some analysis on these hit points in matlab, so I just added some printf’s in the shader, but I would expect that all the hit points would basically be a point cloud that shows the cube, but instead it is very sparse, and can barely make out a cube. Definitely not the same as image view. Another thing I don’t understand, is there isn’t the same amount of hit points every time. What am I doing wrong?
const vec3f ray_orig = optixGetWorldRayOrigin();
const vec3f ray_dir = optixGetWorldRayDirection(); // incident direction
const float ray_t = optixGetRayTmax();
vec3f hit_point = ray_orig + ray_t * ray_dir;