Commit Graph

119 Commits

Author SHA1 Message Date
5278675fb7 BVH can now have multiple objects per leaf. 2016-01-02 12:35:00 -08:00
cb8db6a0b6 Added command-line control of sample count, and more interesting default scene. 2016-01-02 11:17:52 -08:00
eaeec4c207 BVH now works on slices of Rays, taking a breadth-first approach. 2015-12-31 13:12:15 -08:00
53c9ff9534 Made a BVHTraverser iterator that traverses a BVH with a ray.
It yields the objects that the ray needs to be tested against.
Thus it is the responsibility of the code using the iterator
to actually do the object-level ray tests and update the ray's
max_t etc. accordingly.

This keeps all of the BVH-related code generic with respect to
what kind of object/data the BVH actually contains, which means
the same BVH code can be used for both scene-level and
triangle-level data.
2015-12-31 11:15:35 -08:00
1c660dda13 Generalized the BVH to... pretty much anything.
The BVH is now generic over any kind of data.  The building
function takes in a closure that can bound the given data type
in 3d space, and the rest just works.
2015-12-31 00:32:38 -08:00
f87a8b4934 Forgot robustness adjustment in BBox/ray intersection code. 2015-12-29 17:01:05 -08:00
7f7870534c Implemented a very basic BVH for lists of triangles.
This isn't a good implementation by any means.  It's just to get
things started.
2015-12-29 16:56:33 -08:00
9d03c53f4d Made Halton code a little nicer, and made rustfmt ignore it.
Since it's generated code anyway, it doesn't need to be formatted
nicely, and rustfmt was spewing out a bunch of errors because of
too-long lines anyway.
2015-12-29 14:35:08 -08:00
a66059d13e Implemented anti-aliasing with permuted halton sequence. 2015-12-29 13:42:40 -08:00
54f4c278ca Added triangle/ray intersection code.
As a test, the image written out is now a raytraced triangle,
with its color representing its UV coordinates.
2015-12-28 14:43:30 -08:00
539dc47b4e Fixed stupid bug in data tree parsing code. 2015-12-28 00:58:41 -08:00
37f0eb33dd Added basic "data tree" parsing.
The code here is a bit messy right now.  Just did enough to get
it working.  But it needs to be cleaned up and report parse
errors in a human-readable way, among other things.
2015-12-28 00:49:15 -08:00
81dc3d14a8 Fleshed out Ray a bit more. 2015-12-27 00:50:18 -08:00
b20910a252 Created BBox, an axis-aligned 3d bounding box type. 2015-12-27 00:44:59 -08:00
3f614f3728 Added command line parsing and PPM image writing.
Also the beginnings of a Ray struct.
2015-12-27 00:13:35 -08:00
e239f5aaaf Moved all the 3d math stuff into its own module. 2015-12-26 19:27:32 -08:00
b9d0860957 Improved efficiency of non-SIMD implementation of Float4.
It was using bounds-checked indexing in the basic operations. Now
it's using non-bounds-checked indexing, since all of the indexing
is constants that we know to be within the bounds.
2015-12-26 18:34:09 -08:00
ff10e696c8 Finished vector/point/normal/matrix code.
Sans bugs, optimization, and possibly convenience functions down
the line.
2015-12-26 17:50:37 -08:00
aa6b72493b First commit.
WIP basic 3d math code.
2015-12-26 00:38:29 -08:00