BachiLi / lajolla_public

UCSD CSE 272 renderer
MIT License
71 stars 42 forks source link

Wrong function parameter order of eval() and pdf_sample_bsdf() #5

Closed zheng95z closed 1 year ago

zheng95z commented 2 years ago

In material.h:

Spectrum eval(const Material &material,
              const Vector3 &dir_in,
              const Vector3 &dir_out,
              const PathVertex &vertex,
              const TexturePool &texture_pool,
              TransportDirection dir = TransportDirection::TO_LIGHT);

where we feed dir_in with dir_view and feed dir_out with dir_light (see path_tracing.h).

However in material.cpp:

Spectrum eval(const Material &material,
              const Vector3 &dir_light,
              const Vector3 &dir_view,
              const PathVertex &vertex,
              const TexturePool &texture_pool,
              TransportDirection dir) {
    return std::visit(eval_op{dir_light, dir_view, vertex, texture_pool, dir}, material);
}

the order is changed. Same situation to pdf_sample_bsdf().

It does not necessarily cause an error but indeed causes confusion.

BachiLi commented 2 years ago

You're right, sorry about this. It's a bit late to change this -- we'll fix this after the end of the quarter.

BachiLi commented 1 year ago

Finally fixed this! (see https://github.com/BachiLi/lajolla_public/commit/417a3e54b0ab4e417a5a36a02d4319ff07929710)