Commit Graph

455 Commits

Author SHA1 Message Date
589a67caa4 Run latest rustfmt on code. No functional changes. 2018-12-08 13:23:44 -08:00
e9b495e729 Silence some clippy warnings on generated code and large preformatted data. 2018-12-08 13:21:41 -08:00
ea75e3ed21 Added benchmarks for both Trifloat and Oct32 encoding/decoding. 2018-11-29 11:09:48 -08:00
a6cae26c34 Added property tests for Oct32 encoding/decoding.
Tests random vectors, and makes sure that encoding/decoding
round trip only introduces precision errors below a certain
threshold.

Pretty confident that the implementation is correct now.
2018-11-29 09:50:38 -08:00
8e15dba29d Implementation of the Oct32 encoding of unit vectors.
The code still needs testing, but initial toying around suggests
that it's working correctly.
2018-11-28 23:41:12 -08:00
c0cb071251 Further optimizations to the trifloat implementation.
Also improved documentation.
2018-11-28 15:31:21 -08:00
27521f44a6 Cleanup and better docs for trifloat. 2018-11-23 23:12:06 -08:00
ff9a56977a Use bit fiddling to avoid some expensive operations in trifloat encoding/decoding. 2018-11-23 22:31:28 -08:00
3d1ade21c2 Better naming for the trifloat functions. 2018-11-23 21:38:27 -08:00
3fb22fdefa Implemented a "tri-float" encoding, similar to RGBE.
This implementation trades less range for more precision, giving
9 bits to each mantissa instead of just 8 bits as in RGBE.
2018-11-23 20:01:15 -08:00
498c1ea8d9 Running latest rustfmt. No functional change. 2018-10-30 22:31:25 -07:00
ab637e3bd5 Fixed bug in GTR and GGX BRDFs. 2018-08-09 14:43:32 -07:00
c002514ddf Run latest rustfmt. No functional changes. 2018-08-09 00:43:21 -07:00
caeb1d9c67 Added GGX glossy material, and simplified surface closure API. 2018-08-09 00:42:17 -07:00
5c20fa3ea4 Moved more work out of the triangle mesh intersection inner loop.
This makes the code a bit spaghetti-like, but it provides noticable
speed-ups in the all the scenes I tested.
2018-07-01 17:30:58 -07:00
b14b1b13b5 Cleaned up some of the SIMD code in spectra_xyz. 2018-07-01 16:49:41 -07:00
3f55df7225 Some basic SIMD optimizations for XYZ->Spectrum conversion. 2018-07-01 15:50:34 -07:00
ef7084e694 Reorganized xyz_spectra crate a bit.
This way the executable code can be worked with directly, instead
of via the python file that generates the rust code.

Also introduced some small optimizations.
2018-07-01 14:29:19 -07:00
989914b878 Use Float4::splat() in AccelRay methods. 2018-06-29 17:28:39 -07:00
6d21a30840 Formatting with newer cargo fmt.
No meaningful code change, only formatting.
2018-06-24 21:18:10 -07:00
df27f7b829 Moved matrix transpose and inverse code into Float4 crate.
This allows for more optimized implementations, taking advantage
of SIMD intrinsics.
2018-06-24 21:06:32 -07:00
8e791259b3 Sped up Float4::h_sum for platforms with SSE3.
Since this is used heavily during matrix multiplication, gives a
nice little speed boost.
2018-06-24 16:45:21 -07:00
27d1b2286b Switch to stable SIMD intrinsics.
Rust 1.27 stablized a variety of cpu intrinsics, including SIMD
on x86/64 platforms.  This commit moves to using those intrinsics
for the optimized Float4 implementation.  This means Psychopath
now compiles on stable Rust with all optimizations.  Yay!
2018-06-24 15:32:09 -07:00
d92ae4b2d7 Updated to latest openexr-rs release. 2018-06-15 14:52:51 -07:00
b2576c20e7 Upgraded to Nom 2.x 2018-03-04 22:06:20 -08:00
b5bcf8965b Updated to latest crates.
Except for Nom, which has jumped several major versions.
2018-03-04 13:49:41 -08:00
bbf832a3d8 Fixed compile error in float4 lib, and updated to latest simd crate. 2018-03-04 13:32:31 -08: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
f39589ab72 Small refactor of float4 crate to make it easier to read. 2018-03-04 12:27:35 -08:00
a797ff012d Fixed sampling of very small rectangle lights.
The sampling method used before is numerically unstable for very
small lights.  That sampling method is still used for large/close
lights, since it works very well for that.  But for small/distant
lights a simpler and numerically stable method is used.
2017-10-26 08:42:09 -07:00
3de276cbaa Make MIS routines handle infinite importance better.
Handle it like the limit case: as A approaches infinity, the
limit approaches 1.0.  Before this, we were getting NaN values.
This fixes that.
2017-10-25 07:11:24 -07:00
6ff226f4fa Whoops, nope. The last commit was a mistake.
It *seemed* to fix the problem I was running into, but it actually
made the SphereLight ray intersection code incorrect, and wa just
avoiding intersections that should have happened.

I should test better before committing. :-)
2017-10-25 07:09:16 -07:00
18024d43b9 Stupid bug in SphereLight ray intersection code.
The ray origin wasn't transformed into local space, resulting in
silly problems.
2017-10-25 06:59:35 -07:00
461b3c377e Improved light tree sampling and changed surface closure API.
Thanks to a discovery by Petra Gospodnetic during her GSOC
project, I was able to substantially improve light tree sampling
for lambert surfaces.  As part of this, the part of the surface
closure API relevant to light tree sampling has been adjusted to
be more flexible.

These improvements do not yet affect GTR surface light tree
sampling.
2017-08-23 19:09:26 -07:00
81c8da8113 Implemented ray intersection for RectangleLights.
This means that RectangleLights now work with MIS.  Yay!
2017-08-17 13:46:38 -07:00
072d366892 Changed SurfaceLight API to return the sample point on the light.
More specifically: prior to this, SurfaceLights returned the
shadow ray direction vector to use.  That was fine, but it
kept the responsibility of generating proper offsets (to account
for floating point error) inside the lights.

Now the SurfaceLights return the world-space point on the light
to sample, along with its surface normal and error magnitude.
This allows the robust shadow ray generation code to be in one
place inside the renderer code.
2017-08-17 13:09:48 -07:00
b1bd419779 Factored out interpolating over a triangle's surface into its own function.
We'll be using this in the RectangleLight sampling code soon.
2017-08-17 11:23:47 -07: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
5c91aca002 WIP multiple importance sampling.
Added method for intersecting finite light sources, and implemented
the method for SphereLight.
2017-08-16 17:27:44 -07:00
e2a417884d Added time parameter to shader evaluation.
It's not used right now, but in the future I want shaders to be
able to vary over time and have motion blur.  This serves as a
nice little reminder by putting it in the API.
2017-08-08 14:48:22 -07:00
6f5984a379 Implemented proper handling of Emit surface closure. 2017-08-08 14:31:31 -07:00
3c5abfa754 Update readme.
Specifically, removed the "todo" section.  I'm using GitHub issues
for that now.
2017-08-06 22:07:11 -07:00
bb82727beb Fixed unneeded mutability warning. 2017-08-03 20:40:09 -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
f4d4152543 Some refactoring in preparation for a material system.
The main change is that SurfaceClosures now have the hero
wavelength baked into them.  Since surface closures come from
surface intersections, and intersections are always specific to
a ray or path, and rays/paths have a fixed wavelength, it doesn't
make sense for the surface closure to constantly be converting
from a more general color representation to spectral samples
whenever its used.

This is also nice because it keeps surface closures removed from
any particular representation of color.  All color space handling
etc. can be kept inside the shaders.
2017-08-03 16:16:36 -07:00
6413308c7c PsychoBlend: only export meshes that have faces. 2017-07-31 00:31:53 -07:00
02d5d7505c Update feature list in readme file.. 2017-07-30 23:18:09 -07:00