Commit Graph

227 Commits

Author SHA1 Message Date
Matthew Gordon 80b2d87d22 Minor changes suggested by clippy 2025-03-28 22:14:10 -03:00
Matthew Gordon 8c458d073e Fix unit test in camera 2025-03-28 22:14:10 -03:00
Matthew Gordon e8f9040807 Make vector and matrix classes parameterized by float type 2025-03-28 22:14:03 -03:00
Matthew Gordon 7172bab68f Fix benchmark
Benchmark code had become out-of-sync with main code and wasn't compiling.
2025-03-21 21:12:59 -03:00
Matthew Gordon d43cf2feeb Fix typo in test 2025-03-21 20:59:35 -03:00
Matthew Gordon 406f347971 Fix floating-point precision issue in accumulation_buffer
Fixed an issue that prevented the image from converging.

(Technically, the convergence was happening and the issue was the final
calculation of the displayed colours, but the visual effect was the same as
failure to converge.)
2025-03-21 20:52:23 -03:00
Matthew Gordon 07651817dc Implement divide-by-scalar for Vec3 2025-03-21 20:51:50 -03:00
Matthew Gordon c1a79e7893 Update example run command in readme 2024-02-13 13:21:22 -04:00
Matthew Gordon 1f2924939f Remove sun from test lighting environment
Because multiple importance sampling is not implemented yet,
convergence is quite slow and the single bright light source
of the sun causes the image to be extremely noisy.
2022-04-26 21:09:32 -04:00
Matthew Gordon fb744258b2 Numerous small changes suggested by clippy 2021-10-08 09:23:16 -04:00
Matthew Gordon 6a1fe84af7 Add random_distributions::SkyLightPdf 2021-10-08 08:37:29 -04:00
Matthew Gordon ed224b18cb Add random_distributions::LinearWeighted 2021-10-07 11:23:46 -04:00
Matthew Gordon 1f84cde760 Make default material sampling cosine-weighted instead of uniform 2021-10-05 09:13:08 -04:00
Matthew Gordon b0c704f79a Add random_distributions::CosineWeightedHemisphere 2021-10-05 08:33:52 -04:00
Matthew Gordon 8459f3110f Add PDF to RandomDistribution 2021-10-04 09:01:58 -04:00
Matthew Gordon 8badbaa3ca Add UniformHemisphere random distribution 2021-10-04 08:14:16 -04:00
Matthew Gordon 41cc032bed Ignore some tests in random_distributions 2021-10-04 07:40:32 -04:00
Matthew Gordon 9ec3525b15 Add random_distributions::UnitDisc 2021-10-03 11:01:34 -04:00
Matthew Gordon eee0da42c3 Add missing constructor for random_distributions::UniformSquare 2021-10-03 11:00:14 -04:00
Matthew Gordon fac841295e Add UniformSquare random distribution 2021-10-03 09:59:06 -04:00
Matthew Gordon c83416682e Factor integrators into submodules 2021-10-02 16:37:16 -04:00
Matthew Gordon ab7cf9ed72 Replace usage of depricated external_doc 2021-10-02 11:21:22 -04:00
Matthew Gordon 4286af7f25 Update README.md 2020-09-14 19:57:24 -04:00
Matthew Gordon 45cf4fa487 Implement importance sampling for materials 2020-09-12 11:53:01 -04:00
Matthew Gordon 7c82605d98 Add SmoothTransparentDialectric material 2020-09-12 10:01:33 -04:00
Matthew Gordon db2d1806a3 Fix generate_dodecahedron() to match recent BVH changes 2020-09-12 09:59:52 -04:00
Matthew Gordon d4cbcfcb59 impl Mul<&Vec3> for f64 2020-09-12 09:49:22 -04:00
Matthew Gordon 65dd9b5095 Add integrators::test_liggting_environment()
Should have been included in an earlier commit.
2020-09-12 09:47:17 -04:00
Matthew Gordon 87f62eedb0 Add photon parameter to Material::sample(), other changes to integrate() 2020-09-12 09:45:21 -04:00
Matthew Gordon 438d8c64ee Add Spectrum::diamond_index_of_refraction() constructor 2020-09-12 09:36:10 -04:00
Matthew Gordon 56d3991e7d Add Spectrum::grey() constructor 2020-09-12 09:35:37 -04:00
Matthew Gordon a0db18d383 Add ColourXyz to sRGB conversion 2020-09-09 22:45:05 -04:00
Matthew Gordon a5f77e61b3 Add antialiasing 2020-09-09 20:51:30 -04:00
Matthew Gordon 773ca99ac1 Very inefficient first-pass at global illumination 2020-09-09 20:39:32 -04:00
Matthew Gordon 2f1285c526 Add Spectrum::reflection_from_linear_rgb() 2020-09-07 22:48:57 -04:00
Matthew Gordon 2494a30aef Cast rays for single light wavelengths instead of RGB values
Colours are wrong because Spectrum class isn't implemented.

Also there's a lot of other cleanup that needs to be done.
2020-09-05 22:45:43 -04:00
Matthew Gordon 8defc781b1 Finished implementing AccumulationBuffer 2020-09-04 22:04:17 -04:00
Matthew Gordon e0d3354a77 Add ColourXyz::from_photon() 2020-09-04 22:01:40 -04:00
Matthew Gordon 425f093756 derive(Clone) for Array2D 2020-09-04 22:01:14 -04:00
Matthew Gordon 93e76fc5ea derive(Clone,Default,Debug) for Photon 2020-09-04 22:00:39 -04:00
Matthew Gordon bc69ca04a8 derive(PartialEq) for ColourXyz 2020-09-04 21:59:34 -04:00
Matthew Gordon 84fbc1fef5 Add ColourXyz struct and a number of usefull functions 2020-09-02 23:22:24 -04:00
Matthew Gordon c6acac0567 Add Photon type 2020-09-02 23:21:53 -04:00
Matthew Gordon 8b30ad581e Create colour module 2020-09-02 23:21:17 -04:00
Matthew Gordon 6870186bca WIP: Add AccumulationBuffer 2020-09-01 23:34:01 -04:00
Matthew Gordon eccb444721 Make ToneMapper generic over it's input type 2020-09-01 23:33:32 -04:00
Matthew Gordon 7c8baf57da Use Array2D as storage for ImageRgbF 2020-09-01 22:44:55 -04:00
Matthew Gordon ef0fb96f9d Use Array2D for storage in ImageRgbU8 2020-09-01 22:26:50 -04:00
Matthew Gordon 40d9bb0bb1 Add Array2D struct 2020-09-01 22:26:10 -04:00
Matthew Gordon 26fb50b39b Add partially-implemented Mat2 that should have been in last commit 2020-08-29 23:06:28 -04:00