Commit Graph

27 Commits

Author SHA1 Message Date
011405e131 Implemented robust ray origin calculation for bounced rays.
We take a small performance hit for this, but given that it's
making things meaningfully more correct I feel like it's more
than worth it.
2017-06-19 22:28:44 -07:00
71bdf203aa Fixed bug in mesh intersection code.
Very small triangles were being missed because of the
not-so-robust ray-triangle intersection algorithm I was using.

Switched to the algorithm from the paper "Watertight
Ray/Triangle Intersection" by Woop et al.  Happily, the new
algorithm doesn't seem to measurably slow down renders at all.
2017-06-18 20:51:53 -07:00
f649bec585 Reformat code with rustfmt 0.9 2017-06-15 22:00:31 -07:00
922e33ec3f Reformat code with latest rustfmt and custom config. 2017-05-14 13:43:51 -07:00
c92a8c4da0 During BVH construction, merge BBox time samples based on a threshold.
If the average surface area of all the time samples is close enough
to the surface area of their union, just take the union and use that.
This both makes the BVH smaller in memory (time samples don't
propigate up the tree beyond their usefulness) and makes it
faster since traversal can avoid interpolating BBoxes when there's
only one BBox for a node.
2017-04-23 23:15:31 -07:00
b135e8beb8 Fixed bug in new BVH4 traversal code. 2017-04-22 22:32:36 -07:00
0296fd2d34 Fixed a bunch of problems that came up when running debug build.
The worst offender was an obvious and nasty bug in the bitstack
implementation.  Hooray for debug asserts!
2017-04-14 21:37:29 -07:00
573c5da5ab Got BVH4 working. Woo hoo! 2017-04-13 22:44:34 -07:00
c82c821b31 BVH and objects now use MemArena. 2017-04-09 23:33:36 -07:00
4a86c4122a Laying some groundwork for a simple shading system. 2017-03-14 00:27:25 -07:00
114f11c583 Fixed bug in GTRClosure that was resulting in all NaN outputs. 2017-03-12 00:33:36 -08:00
f4445417dc Reorganizing the module tree.
Enough things had accumulated that it seemed to make sense to
group some stuff together.  So here it is.
2017-02-14 00:14:08 -08:00
97b5ef77f8 Code cosmetics: organize and alphabetize crate/mod/use statements. 2016-08-20 18:10:55 -07:00
aff8d24f55 Fixed some bugs where instances without transforms would crash. 2016-07-07 23:32:19 -07:00
0880a0f19d Make renderer actually use the material system properly.
The intersection code still isn't using any kind of shading,
and materials aren't parsed by the parser, but the renderer
class itself is using them.
2016-07-07 19:51:19 -07:00
e56ac418da Beginnings of global illumination.
There are still some obvious bugs in it that I haven't tracked down,
so the renders aren't correct yet.
2016-07-03 01:18:50 -07:00
f927dd0d46 Silencing a bunch of compiler warnings. 2016-06-29 15:23:07 -07:00
fd195576d1 First renders with lighting. Yay!
The lighting is super crappy, and pretty much hacked in.  Will
need to redo this properly soon.  However, this verifies that
certain other parts of the code are (mostly) working properly.
2016-06-27 23:16:39 -07:00
3b85b60a62 Implemented occlusion rays.
This is prep for lighting support: occlusion rays are useful for
speedier shadow tests.
2016-06-27 21:01:18 -07:00
18245b725c All final intersections are now done in world space.
BVH traversal still happens in local space, but final actual
surface intersection calculations are done in world space by
transforming the triangle into world space.  This is to improve
numerical consistency between intersections.
2016-06-09 01:04:12 -07:00
039943e0cb Auto-formatting code with new version of rustfmt. 2016-06-02 22:43:35 -07:00
901fc88f63 Assemblies now use BVH accel and actually utilize instances. 2016-04-23 13:37:38 -07:00
25f8e0782a Added Assembly and Scene types.
This is in preparation for real scene data, as parsed from real
psy files.  Exciting!
2016-03-08 21:57:51 -08:00
a569586455 Adjusted the API of the BVH builder.
The bounder closure now returns slices of BBoxes instead of
filling in a given Vec.
2016-01-06 23:47:32 -08:00
655c16542d Implemented basic deformation motion blur for triangles.
Not 100% happy with the interface of the BVH building yet, and
there are still some missing features as well.  But it's a start!
2016-01-05 07:44:37 -08:00
c1b063411f First steps towards motion blur support. 2016-01-03 21:21:46 -08:00
907d15f643 Started creating an interface for surfaces.
Testing it out by making a bogus TriangleMesh surface type.
2016-01-03 00:09:23 -08:00