Commit Graph

334 Commits

Author SHA1 Message Date
b891cc943b Light tree can now be traversed with arbitrary arity.
Next up is building with configurable arity.
2017-06-28 23:20:03 -07:00
27c635982e Adjusting light tree implementation in prep for configurable arity. 2017-06-28 22:51:20 -07:00
4e9bfd6e79 Fix for ray origin offsets when intersection point is at 0.0.
For some reason the ulp incrementing is unreliable when starting
at zero.  It creates subnormal numbers, and that seems to be an
issue somewhere in the pipeline, ultimately leading to weird
render artifacts.  Not entirely sure why.

This fixes it by avoiding subnormal numbers in the final offset
ray origin.  Left a note suggesting investigating in more detail
at some point.
2017-06-21 01:36:08 -07:00
927a86c1fc Update LightArray to work with current code.
It's useful for checking correctness.
2017-06-20 23:28:49 -07:00
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
2c0e57341c XYZ color curve functions need more accurate exp function. 2017-06-15 22:50:27 -07:00
b5f2237676 Reformatted sub-crates with new rustfmt as well. 2017-06-15 22:21:25 -07:00
f649bec585 Reformat code with rustfmt 0.9 2017-06-15 22:00:31 -07:00
46247ec9aa Added a 'Contributing' section to the readme. 2017-06-14 19:19:02 -07:00
abc59c20ae Merge pull request #1 from GuillaumeGomez/improvement
Improve messages for image creation
2017-06-14 18:58:50 -07:00
Guillaume Gomez
ae11be1397 Improve messages for imge creation 2017-06-14 10:46:28 +02:00
851989f6a6 Added a license and licensing notes.
Also replaced some code I'm not sure where it came from or what
the license was.
2017-06-11 21:29:51 -07:00
58539520cf Fix some readme typos and improve phrasing. 2017-06-11 16:15:00 -07:00
2f91600182 Prepping repo with a readme before making repo public. 2017-06-11 16:07:12 -07:00
b8321beaad Split colorspace transform functions out into their own crate.
They are now generated by a build.rs script from nothing but the
colorspace's primaries, which makes it super easy to add more
colorspaces.  So easy that I added three more: ACES AP0, ACES AP1
and Rec.2020.

This lays the foundation for supporting output to different
colorspaces.
2017-06-11 03:03:23 -07:00
2a66485595 Supress information output when doing serialized ouput for PsychoBlend. 2017-06-10 22:34:14 -07:00
13ee6066b8 PsychoBlend: further preformance improvements, and minor fixes.
All scene data collection is now done in a single sweep of frame
changing.  Previous commits were already working towards this, and
but now it's done.  Yay!

Over-all, switching to this approach gives huge speed boosts on
large scenes with animation, rigs, dependencies, etc.  For such
scenes, frame changing is very expensive.
2017-06-10 16:11:28 -07:00
914a13f899 PsychoBlend: fixed silly copy/paste bug. 2017-06-10 01:58:20 -07:00
7236d2e666 PsychoBlend: fixed some bugs and made exporting even faster. 2017-06-10 01:38:33 -07:00
9025715335 Significant PsychoBlend improvements.
- Improved export time by quite a bit.
- Added more fine-grained status updates during export so it
  doesn't feel like it's hanging.
2017-06-09 23:57:18 -07:00
9d92bd099d PsychoBlend: rendering a cropped image using border feature now works. 2017-06-06 23:44:53 -07:00
71c320d87c Added command-line argument to render an image cropped. 2017-06-06 21:11:35 -07:00
59555f67f9 PsychoBlend: use stdin/out to transfer scene data by default.
This eliminates writing temp files to disk for any part of the
Blender/Psychopath integration.

The option to export to a file still exists, however, by
specifying an export output path.
2017-06-04 23:24:45 -07:00
a82c674308 PsychoBlend: remove unused output path. 2017-06-04 19:58:09 -07:00
ef5b573723 Some small export speed improvements in PsychoBlend. 2017-06-04 19:49:55 -07:00
a3332d4f6a Fixed a PsychoBlend bug that resulted in render not being fully displayed.
Getting the interplay between the reading the process output and
polling to see if it's finished is a tad tricky.  I think I got
it right this time.
2017-06-03 01:12:21 -07:00
f84d093f66 PsychoBlend now updates render in realtime within Blender.
Also, cancelling renders is much more responsive now, especially
during long exports.
2017-06-03 00:00:19 -07:00
3beffab507 Update to latest openexr-rs, and switch to pure Rust PNG output crate. 2017-05-28 17:51:01 -07:00
f0604a69ae Updated to latest openexr crate, and switched to 16-bit float EXR's. 2017-05-20 23:48:01 -07:00
4e2d3e64c0 Switched to using the openexr crate on crates.io. 2017-05-17 00:36:35 -07:00
edb71864e8 LDS sampling falls back on random sampling at higher dimensions.
This is more a piece-of-mind thing than anything else.  But it
also lets us make the number of LDS dimensions lower without
worrying, which in turn makes the code smaller.
2017-05-14 16:06:54 -07:00
322627641a Broke render job out into its own method.
The left-drift of having it inline was getting cumbersome.
2017-05-14 14:51:55 -07:00
922e33ec3f Reformat code with latest rustfmt and custom config. 2017-05-14 13:43:51 -07:00
993ba719d7 Fixed bug that was causing spurious NaN pixels.
It was because sometimes the PDF's for a sample could be zero,
leading to a divide by zero.  PDF = 0.0 is now checked for.
2017-05-14 12:45:43 -07:00
567b658b6c Removed blue noise dithered sampling. 2017-05-14 12:37:01 -07:00
d71fd3b5c8 Implemented blue noise dithered sampling. Temporary.
After implementation, it does appear to make rendering slower
by a noticable bit compared to what I was doing before.  At very
low sampling rates it does provide a bit of visual improvement,
but by the time you get to even just 16 samples per pixel its
benefits seem to disappear.

Due to the slow down and the minimal gains, I'll be removing
this in the next commit.  But I want to commit it so I don't
lose the code, since it was an interesting experiment with
some promising results.
2017-05-14 12:25:01 -07:00
d8a33c7bfa Added a blue noise mask generator as a sub-crate. 2017-05-13 03:23:55 -07:00
172e2f19ef Removed BVH4 and the related bitstack from AccelRay.
I couldn't make the BVH4 faster than the BVH, and the bitstack
was bloating the AccelRay struct.  Removing the bitstack gives
a small but noticable speedup in rendering.
2017-05-12 21:07:40 -07:00
88578b9eae Moved Float4 and Matrix and Vector math into their own sub-crates. 2017-05-12 21:01:54 -07:00
5ab1a51f4c Avoid bounds checking in the Sobol code. 2017-05-12 00:34:03 -07:00
04e8a6ca73 Added a Rust port of Leonhard Grünschloß's Sobol sampler.
The Halton sampler appears to be better, but it was fun to add
this anyway!
2017-05-11 23:56:12 -07:00
b698a52f6c Split some more things out into sub-crates.
Also translated the Halton generator to rust and made it a crate
where the code is generated by a build.rs file.
2017-05-11 22:57:59 -07:00
96db00b10a Refactored some parts of Renderer to take up less memory and be faster.
Specifically, LightPath is now significantly smaller, and
resultingly faster to process.

Also finally fixed the bug where without light sources the light
from the sky wouldn't affect surfaces.
2017-05-11 20:23:19 -07:00
a3a19e53ef Some misc small optimizations. 2017-05-11 01:22:37 -07:00
dcf25b92af Fiddled with BVHNode to make it 32 bytes instead of 40 bytes.
This helps reduce the total size of BVHs since both BBoxes and
and BVHNodes are now 32 bytes and can be properly packed together.
2017-05-08 19:47:10 -07:00
d8e31750a8 Small optimization in BVH traversal. 2017-04-26 01:03:16 -07:00
8b0c422630 Small optimization in BBox intersection and bugfix in BBox4 intersection. 2017-04-26 00:28:43 -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
55c64a3392 Added missing *_with_alignment allocation variants. 2017-04-23 10:10:10 -07:00