Commit Graph

48 Commits

Author SHA1 Message Date
8ca6e27f39 WIP do depth-first instead of breadth-first ray tracing.
Currently totally broken.
2022-07-31 17:50:54 -07:00
d55ec9b025 Update psychopath code to work with RMath changes. 2022-07-17 17:24:58 -07:00
08e2e6eb06 Convert Psychopath over to use new RMath library. 2022-07-15 21:42:35 -07:00
e0ee0d6dff Change to using a dedicated affine transform type.
This lets certain operations, especially matrix inversion, be
quite a bit faster.  And we don't need anything beyond affine
transformations anyway.
2021-05-14 13:30:28 -07:00
e23fe4bb36 Fix deprecation warnings from rustc. 2019-11-23 10:21:16 +09:00
5a53d7f6f6 Added some additional ray tracing stats. 2019-06-29 09:20:04 +09:00
14b16896ac Fix some compiler warnings. 2019-06-29 08:41:11 +09:00
4ef376dc89 Move multiple-object logic out of BVH4.
This allows each part of Psychopath tp handle the logic in the
best way, instead of a one-size-fits-all approach.
2019-06-29 08:28:41 +09:00
b09f9684d1 Remove non-SIMD BVH4, and keep more bool calculations in SIMD format. 2019-06-29 07:22:22 +09:00
2fddcae0fd Reduced the size of a hot return value.
Gives a small performance boost.
2019-06-28 22:22:41 +09:00
5dd8eb919b Changed ray batch data access to be through methods.
This is (potentially) just temporary.  It's to make it a bit easier
to play with data layout to see how that affects performance.
2019-06-25 17:31:51 +09:00
630a79aca5 Initial implementation of ORST traversal.
This is a "just get it working" implementation.  Performance
optimizations still need to be done.
2019-06-23 18:40:52 +09:00
5add4cfdb1 Implementing Color as a simple enum rather than as a trait.
There's really no reason for it to be a Trait, and this will simplify
a lot of things down the road.
2018-12-27 16:09:03 -08:00
28a07de456 Improve module path usage and remove extern crate declarations where possible. 2018-12-16 13:02:49 -08:00
8deb1e87bb First step transitioning to Rust 2018. 2018-12-16 12:02:20 -08:00
6d21a30840 Formatting with newer cargo fmt.
No meaningful code change, only formatting.
2018-06-24 21:18:10 -07:00
c990672dfe Fix compiler warnings. 2018-03-04 13:06:22 -08:00
97d3304149 Run new rustfmt on codebase. 2018-03-04 13:00:55 -08:00
5a03a46ac7 Multiple importance sampling is now basically working.
Intersecting rectangular lights still isn't implemented, and there
are likely bugs in the MIS implementation, but it's more-or-less
working!
2017-08-16 20:04:06 -07:00
462977bd4d WIP: multiple importance sampling.
Reorganized light and surface traits so that light sources are
surfaces as well, which will let them slide easily into
intersection tests with the rest of the scene geometry.
2017-08-16 18:17:50 -07:00
ad55aa4f6d Materials are now working in both Psychopath and PsychoBlend.
Except that Emit is still not properly supported, because it needs
special handling.
2017-08-03 20:32:07 -07:00
516803e78a Got basic material parsing and rendering working.
Currently only Lambert is supported.
2017-08-03 19:31:58 -07:00
c0a26819c6 Bunch of code quality improvements based on running clippy.
None of them change behavior, just make the code cleaner.
2017-07-22 17:21:11 -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
597bcf0518 Sped up splitting rays by direction.
Turns out the is_sign_positive() method is slower than a simple
comparison.
2017-04-22 11:15:17 -07:00
e9e202933f Assembly type now partially uses MemArena. 2017-04-09 18:27:01 -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
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
024ca560af Minor optimization in the transform stack.
Got rid of the scratch space by writing directly into the main
stack vector when merging transforms.  Involves a small bit of
unsafe code.
2016-08-06 01:51:20 -07:00
7ef5846c89 Got rid of indexing into Float4 and 3d vector elements.
This assures correct semantics for SIMD usage.
2016-07-30 19:36:54 -07:00
177bb95eff Got rid of UnsafeCell in Tracer.
To do this, I moved the accel rays into an outer struct, which
then calls the main tracing code as an inner struct.
2016-07-16 16:26:34 -07:00
e2ef44f666 Finished implementing motion blur. 2016-07-10 19:20:37 -07:00
9c8797ffd8 Forgot to do top-level ray splitting. 2016-07-07 23:47:44 -07:00
3ef84f9f5f Split rays by direction so they can follow their ideal traversal order. 2016-07-07 21:50:03 -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
c2d36e0d14 Beginnings of parsing sphere lights. 2016-06-23 20:46:57 -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
5ec1f534cf Implemented bucketed rendering. 2016-06-05 01:27:55 -07:00
c3d3145817 Fixed bug in ray intersection code.
The max_t was getting overwritten during transforms.
2016-06-02 22:36:02 -07:00
ef31093dcb Split xform stack out into its own type.
This is mainly just to make the tracer code read more cleanly.
All of the pushing and popping logic obscured the big picture
and made things a bit confusing.
2016-05-28 14:15:05 -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
b58ba10f9b So the mutable aliasing in Tracer properly.
Apparently this is what UnsafeCell is for, and the code I wrote
before wasn't technically correct, even thought it worked in
practice.  Hooray for doing things properly!
2016-03-21 01:08:19 -07:00
f6891173eb Moved ray tracing responsibilities to the Tracer.
This is still pretty WIP, but it at least gets the functionality
back to where it was before.
2016-03-13 13:01:10 -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