How to incorporate many coordination information in a Transform4f variable #614
-
Hello, We are trying to simulate the photon as one light ray in mitsuba. The simulation will contain millions of light rays, and after the discussion, using one single emitter is a better choice than using millions of emitters. In the emitter we used before, we hardcore the sample_ray function in spot.cpp, which fixed the local_dir to one value: Best wishes, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 13 replies
-
If I understood correctly, this is how you could instantiate a vectorized if constexpr (dr::is_jit_v<Float>) {
size_t N = 3;
dr::Matrix<Float, 4> matrix = dr::zeros<dr::Matrix<Float, 4>>(N);
std::vector<float> values{0, 1, 2};
matrix.entry(0, 0) = dr::load<Float>(values.data(), N);
matrix.entry(0, 1) = dr::load<Float>(values.data(), N);
(...)
Transform4f tf(matrix);
std::cout << tf << std::endl;
} (this snippet only works for JIT variants, making it work for scalar variants would require some more code) Another important bit is that now |
Beta Was this translation helpful? Give feedback.
Hi @yangocean-sudo
If I understood correctly, this is how you could instantiate a vectorized
Transform4f
from astd::vector
which we'll assume you filled from your binary file.(this snippet only works for JIT variants, making it work for scalar variants would require some more code)
Another important bit is that now
local_dir
should …