Kwasniok / cpp-raytracing

non-linear raytraycing based on "Raytracing in One Weekend"
2 stars 0 forks source link

optimize hit record generation #82

Closed Kwasniok closed 1 year ago

Kwasniok commented 1 year ago

As of d5b81a8ddd1f429bd55f4bd25ad92f7ca5a6dfc8 the hit record always stores the Jacobians and metric when created. Since most hit records are discarded due to being further away from the camera and therefore are not used for scattering, it is desirable to keep their computation as light-weight as possible.

idea 1: Make metric + Jacobians std::optional and store const ref to geometry. This leads to lazy evaluation and caching of these quantities.

idea 2: Never include the matrices in the hit record and always calculate them on the fly.

Kwasniok commented 1 year ago

92f1dc8a09af17f3a8d0356b75d353b3ba1545e3