Commit Graph

194 Commits

Author SHA1 Message Date
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
Matthew Gordon 61d6f69d11 Implement various matrix operations and remove nalgebra 2020-08-29 23:02:23 -04:00
Matthew Gordon f5b0a35635 Replace nalgebra matrix and vector classes with own classes
Nalgebra only used to find matrix inverse now.
2020-08-28 23:08:44 -04:00
Matthew Gordon 99cf127c9f Change a bunch of generics that used with RealType to just use f64 2020-08-18 23:12:28 -04:00
Matthew Gordon a98c0c4bca Fix bug that shifted view one tile to the right 2020-08-18 22:05:14 -04:00
Matthew Gordon 5c2fbf995a Made some minor improvements suggested by clippy 2020-08-15 00:06:06 -04:00
Matthew Gordon 8be0c0a21b Add mat3 struct 2020-08-14 23:48:45 -04:00
Matthew Gordon 4f429ade85 Add Mat4 class 2020-08-14 23:30:54 -04:00
Matthew Gordon 8f0a7d0cfd Add Vec2, Vec3 and Vec4 structs 2020-08-14 22:41:36 -04:00
Matthew Gordon 9160251d10 Start adding custom matrix and vector types 2020-08-13 23:16:56 -04:00
Matthew Gordon 699c308782 Rewrite BoundingVolumeHierarchy
New BVH has much cleaner design and is also using a much better
heuristic for dividing the scene.

Massive speedup (~28x!), presumable from having a heuristic that
actually works. This is still a simple heuristic (sort by
bounding box centres along largest dimension, and then divide into
equal halves) which can definitely be improved.
2020-08-11 23:59:03 -04:00
Matthew Gordon 3ca8bc14e4 Add AxisAlignedBoundingBox::largest_dimension() 2020-08-11 23:58:16 -04:00
Matthew Gordon c322981486 Make BHV contain a BinaryTree instead of being one 2020-07-20 21:46:36 -04:00
Matthew Gordon 4933993187 Use bunny model in test scene again 2020-07-20 21:22:54 -04:00
Matthew Gordon b39c7e89b1 Some cleanup of BVH and BinaryTree 2020-07-04 23:16:22 -04:00
Matthew Gordon 231be6a1a5 Add generic BinaryTree struct and use in BoundingVolumeHierarchy
No change in runtime, as expected.
2020-07-04 22:09:44 -04:00
Matthew Gordon 5aad1242b3 For simple_scene benchmark, regerenerate BVH periodically
This makes the results much more consistent run-to-run. I suspect
the inconsistency was caused by random variations in the memory
layout of the BVH.
2020-07-04 21:16:28 -04:00
Matthew Gordon ea311408ba Add time parameter to allow animation 2020-06-20 19:28:40 -04:00
Matthew Gordon d96942cd78 Replace bunny with dodecahedron on test image 2020-06-20 14:57:56 -04:00
Matthew Gordon 9785e3b451 Remove some dead code. 2020-06-20 14:55:25 -04:00
Matthew Gordon 4451d1d71f Add option to save image to PNG file 2020-06-20 14:53:17 -04:00
Matthew Gordon b8dddd7498 Pass image size as command line parameter
Instead of being hard-coded
2020-06-20 12:04:44 -04:00
Matthew Gordon 4464a9fae6 Add utility function to generate dodecahedron 2020-06-20 11:26:17 -04:00
Matthew Gordon e1c91919b8 Add RgbSamplesBsdfMaterial (not working yet) 2020-06-19 00:04:01 -04:00
Matthew Gordon aa942a2a3c Make sure normals or imported meshes are unit length. 2020-06-19 00:01:12 -04:00
Matthew Gordon 29dc3b6a37 Fix a typo that caused artifacts with ReflectiveMaterial 2020-06-19 00:00:12 -04:00
Matthew Gordon cb67362ad4 Break material module up into multiple files 2020-06-11 22:28:53 -04:00
Matthew Gordon 90bb7d84af Big rijiggering of types 2020-06-11 22:13:51 -04:00
Matthew Gordon 01259e1e55 Upgrade quickcheck_macros to 0.9 2020-05-22 21:12:36 -04:00
Matthew Gordon c02ad9637d Upgrade itertools to 0.9 2020-05-22 21:12:09 -04:00
Matthew Gordon 3c9d968f7e Compile for "native" CPU type. 2020-05-22 21:06:07 -04:00
Matthew Gordon 8bc2c4b229 Upgrade to nalgebra 0.21 2020-05-22 21:05:30 -04:00
Matthew Gordon ec1ee394a9 Add documentation for BoundingVolumeHierarchy 2020-04-24 00:32:16 -04:00
Matthew Gordon 1d9baf1f05 Add some documentation for mesh module 2020-04-24 00:31:15 -04:00