Commit Graph

65 Commits

Author SHA1 Message Date
db3e4ad129 MemArena now slowly increases the size of each subsequent block.
This seems to work more nicely than a fixed block size, because
it adapts to how much memory is being requested over-all.  For
example, a small scene won't allocate large amounts of RAM,
but a large scene with large data won't be penalized with a
lot of tiny allocations.
2017-04-10 20:49:55 -07:00
70f715ec2d MemArena now collects statistics about its usage.
You can print out statistics about the main arena used in
Psychopath by passing the new --stats flag.
2017-04-10 18:34:08 -07:00
6623443e2e Improved .psy file parsing error messages.
Biggest improvement: it gives you line numbers.  But also progress
on better descriptions.
2017-04-10 14:03:01 -07:00
57aa9be496 First steps towards using the memory arena allocator.
Changed Camera to us the memory arena allocator, and worked out a
bunch of stuff through doing that.
2017-04-09 17:31:17 -07: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
3cbb816d4b Added DistantDiskLight (a.k.a. sun light) parsing and data structures.
Also created a proper World struct in the process, to store all
infinite-extent type stuff.

Note that I goofed and did a new rustfmt pass but forgot to
commit before making these changes, so there's a lot of
formatting changes in this too.  *sigh*
2017-02-12 20:29:08 -08:00
0e8d708ff0 Made samples per bucket configurable. 2016-10-16 14:55:00 -07:00
bb4e57795f Added support for OpenEXR output. 2016-10-09 20:34:58 -07:00
c71b00ca31 LightTree now works with lights in hierarchical instancing. 2016-08-21 00:19:43 -07:00
97b5ef77f8 Code cosmetics: organize and alphabetize crate/mod/use statements. 2016-08-20 18:10:55 -07:00
f75c0c78fe Moved TransformStack into its own module.
It's clear at this point that it will be useful outside of Tracer.
2016-08-20 17:43:26 -07:00
c997c55739 Separate timing of rendering and image writing in print out. 2016-08-20 16:25:12 -07:00
cf49cdbb02 Moved int hash functions into own file, and use in quick_select(). 2016-08-14 16:03:17 -07:00
fbeadfce29 Use quick select for balanced BVH building.
This gets rid of a crate dependency, and also is faster.
2016-08-14 00:51:21 -07:00
08576b9934 Cleaned up console output. 2016-07-31 12:27:06 -07:00
c6f6266a38 Added timer output so you can see how long things take. 2016-07-31 12:05:28 -07:00
1f94791b6b Moved SAH splitting code into its own function.
This is in prep for the light tree, where we'll want to use that
code.
2016-07-30 21:20:01 -07:00
e4c94d0c58 Optional use of SIMD intrinsics, via feature in cargo.
This is disabled by default right now, because it only builds on
nightly.
2016-07-16 19:58:39 -07:00
ec75f11206 Render buckets in hilbert curve order.
Provides a slight speed-up.
2016-07-16 14:53:03 -07:00
35ef58b09c Special case BVH building when we get too close to max depth.
This avoids exceeding max BVH depth even in pathological cases.
Still need improve non-worst case building, but this at least
prevents crashes in worst case.
2016-07-16 00:05:23 -07:00
5b461220a5 PsychoBlend now exports meshes as meshes, and Psychopath renders to PNGs. 2016-07-10 17:42:28 -07:00
5df583c2d0 Multiple light sources are now handled. 2016-07-10 00:10:49 -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
6f6807009b Prepping for adding lighting.
The part of the renderer responsible for light transport has been
split out into a LightPath struct.  Also moving over to spectral
rendering, although it's a bit silly at the moment.
2016-06-26 23:08:24 -07:00
1cbf20e67f Beginnings of light sources. Yay! 2016-06-19 14:32:13 -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
890c04c44a Added XYZ color spectrum sampling code.
This will be critical for spectral rendering, whenever I get
around to it.
2016-06-07 08:14:19 -07:00
0b5a3de2dd Added command line flag to set number of render threads. 2016-06-05 10:08:27 -07:00
5ec1f534cf Implemented bucketed rendering. 2016-06-05 01:27:55 -07:00
a681ba461e Implemented basic multi-threaded rendering.
It's a bit inefficient because a thread is spawned for each pixel.
Need to implement bucketing.
2016-06-03 21:03:04 -07:00
43c5a94ebb Cleaned up command line options. Removed old procedural scene code. 2016-06-02 23:00:31 -07:00
039943e0cb Auto-formatting code with new version of rustfmt. 2016-06-02 22:43:35 -07:00
99dc371a75 Beginnings of a mesh parser. Also cleaned up some unused imports. 2016-05-25 08:16:05 -07:00
f5dd8f7a14 Got the bare beginnings of scene file parsing and rendering working.
It still doesn't parse or render any actual objects in the scene,
so all renders are just black.  But the basic structures are in
place.  Yay!
2016-05-21 15:14:10 -07:00
4988a6d1e6 Added AssemblyBuilder and got instancing working (sans testing...).
The AssemblyBuilder is responsible for collecting the data needed
to actually create an Assembly.  AssemblyBuilders are now the
only way to create an Assembly, which guarantees that Assemblies
aren't half-baked.

Also got instancing working with transforms and such.  It may not
be _really_ working because I don't have a complex test case for
it yet.  But that will come later.
2016-04-23 20:14:10 -07:00
901fc88f63 Assemblies now use BVH accel and actually utilize instances. 2016-04-23 13:37:38 -07:00
e96798ab6b Lazily committing a bunch of stuff.
Includes:
- More scene parsing code.  Making good progress!
- Making the rendering code actually use the Scene and Assembly
  types.
- Bare beginnings of a Tracer type.
2016-03-12 00:33:11 -08:00
38d33ed144 More work on scene parsing.
Using Nom to help with parsing the contents of leaf nodes.
2016-03-10 23:58:19 -08: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
147b22b861 Added ability to print the debug data of a data tree file.
This is purely for debug purposes, to make sure everything is
working correctly.  Should be removed in the future.
2016-03-06 23:25:37 -08:00
6268a61770 Realized I already did most of the DataTree work in another file.
Weird, to be frank.  It was a lot of work.  Can't believe I don't
even remember doing it before.  Oh well.

In any case, I've improved the 'old' one quite a bit.  It should
be more robust now, and will provide errors that may actually be
useful to people when a file fails to parse.
2016-03-06 22:47:41 -08:00
d769ccecee Beginning work on DataTree and associated parsing. 2016-03-06 12:27:33 -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
a14a93f5a1 BVH now no longer directly references the objects it indexes.
Everything is done with indices anyway, so there was no reason
for it to store an internal reference to the object data.  This
gets rid of the type parameter and lifetime parameter on the BVH
struct itself, which will also make it easier to bundle it with
the data it indexes, which will be important later on.
2016-01-02 22:55:20 -08:00
470618fa6a Created a Renderer type to be in charge of rendering. 2016-01-02 22:34:36 -08:00
d25f8308a2 Now using Camera to generate rays in test scene. 2016-01-02 21:23:17 -08:00
7c5c2e4308 Implemented a Camera type. 2016-01-02 20:27:53 -08:00
9b5e6ad23d Replaced BVHTraverser with a method that takes a closure.
This is not only simpler conceptually, but also turns out to have
better performance.
2016-01-02 13:10:06 -08:00