Commit Graph

154 Commits

Author SHA1 Message Date
ea4ba81110 Use faster routines where precision isn't needed. 2022-07-16 01:09:33 -07:00
8dcf093dbb RMath: first pass at an SSE implementation. 2022-07-16 00:03:09 -07:00
08e2e6eb06 Convert Psychopath over to use new RMath library. 2022-07-15 21:42:35 -07:00
a84da943d0 RMath: implement transform composition. 2022-07-15 17:51:57 -07:00
5535775006 RMath: implement Bool4 type. 2022-07-15 15:20:44 -07:00
fa7be4e58c RMath: change fallback Float4 to be a tuple-struct. 2022-07-15 00:49:37 -07:00
a93a3f09da RMath: implement cross product and bring back some unit tests. 2022-07-15 00:39:14 -07:00
42cd282c47 RMath: implement transforms for Vector, Point, and Normal. 2022-07-14 23:23:22 -07:00
d8e1437db1 RMath: implement vector-matrix multiplication. 2022-07-14 19:02:08 -07:00
c398387b55 Implement dot products and 3x3 matrix inversion.
Both precise and fast versions.  But untested, so might be
incorrect!
2022-07-14 15:30:30 -07:00
8a695a7694 Some shuffling of the math sub-crate's organization. 2022-07-14 12:31:32 -07:00
732dee958e Remove Mat3x3 from math3d lib.
It was an extraneous abstraction.
2022-07-14 00:33:38 -07:00
658e4746ca Start work on new linear algebra library. 2022-07-13 18:54:44 -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
e6f9af9336 Update to latest glam. 2021-05-14 12:22:46 -07:00
7063c406dd Fix minor syntax warning. 2021-05-11 13:38:11 -07:00
706902dc8e Move sobol crate outside of Psychopath into its own repo. 2021-05-11 13:35:17 -07:00
70fba19361 Update Owen scramble hash to the latest.
From https://psychopath.io/post/2021_01_30_building_a_better_lk_hash
2021-05-08 12:22:56 -07:00
87859f5258 Fixed an issue with the Owen scramble hash.
Thanks to a tip from Matt Pharr.
2021-03-30 15:59:55 +09:00
f9deb9afb6 Fix really bad bug with SIMD usage in the Sobol sampler.
Wasn't using the bit shifting instructions the correct way.  SSE
instructions are very non-obvious...
2021-03-30 14:53:41 +09:00
42eda24514 Sobol sampler: get rid of unused alternative direction numbers. 2021-01-25 21:50:31 +09:00
c48839d5f3 An even better Owen scrambling hash. 2021-01-23 00:55:54 +09:00
c32281b04a Significantly better Owen scrambling hash. 2021-01-13 22:25:16 +09:00
105d6e52b5 Add basic benchmark to Sobol sampler. 2021-01-10 00:20:22 +09:00
285f714d02 Switch to a significantly better LK hash.
With just one round, this hash is better than the previous one with
two rounds.  And at 2-3 rounds it seems to be just as good quality
as a slow, per-bit hashing approach, which I've been using as
ground-truth for testing.
2021-01-04 15:16:04 +09:00
d19305d23b Update sobol sampler to properly credit Brent Burley.
I was just waiting for his paper to get published, which happened today!
2020-12-30 21:44:25 +09:00
3d85ce8005 Consolidate all of the compact value storage formats into one crate. 2020-12-30 20:41:56 +09:00
4cfc051260 Change overall project license to GPLv3. 2020-12-26 09:20:55 +09:00
6d6904a615 FLuv32: increase dynamic range, and decrease precision.
This still exceeds the precision of LogLuv, but lets us match its
dynamic range.
2020-09-22 11:06:40 +09:00
9cf5ebdf91 Cleaning up the code in fluv32 a bit. 2020-09-21 11:54:14 +09:00
066105b20a Fluv32: slightly tweak the u/v scaling constants.
This allows perfect representation of E (equal energy spectrum).
It's not important from a perceptual standpoint, but it provides
a simple way for Psychopath to represent E when needed for other
purposes.
2020-09-21 09:45:47 +09:00
05f9621ac5 Added a FloatLuv decode function to decode to Yuv instead of XYZ.
This is useful because it's super fast, and chromaticity lookups
are typical for spectral upsampling anyway, so this will likely
enable cutting out a bunch of unecessary intermediate calculations.
2020-09-20 15:16:20 +09:00
0ba1acc42d Add oct32 encode_precise() function.
This is significantly slower than `encode()`, but a little more precise.
2020-09-20 14:36:50 +09:00
161e47fc44 Clean up oct32norm code a bit. 2020-09-20 10:37:26 +09:00
3eff608493 More FloatLuv32 optimizations, and general code cleanup.
This gives another little speed boost to decoding, but gives a
massive (over 3x) speed boost to encoding.
2020-09-20 10:07:02 +09:00
f4ef11f9f3 Fix some names in fluv32 error messages. 2020-09-20 03:02:56 +09:00
8dee53d1fc Additional optimization to fluv32 decoding.
Tiny change but with a nice speed bump.
2020-09-20 02:35:37 +09:00
f20567247d Go all in with the fluv32 naming. 2020-09-20 02:02:35 +09:00
cda9156af8 Optimize FloatLuv decoding.
Speed ups of over 20%.
2020-09-20 01:43:36 +09:00
03bedcb594 Cleanup, tweaks, and better documentation for the 32-bit Luv format. 2020-09-19 23:57:59 +09:00
485da9f918 Add a new 32-bit Luv color format.
It's based on the SGI LogLuv format, but using a floating point
instead of log encoding for the luminance.
2020-09-19 19:51:40 +09:00
66e9abe66e Make signed48 trifloat encoding also a byte array.
Same reason as for the unsigned40 encoding in an earlier commit.
2020-09-19 12:22:51 +09:00
49c97bf0fe Cleaned up the signed48 trifloat code. 2020-09-19 08:55:35 +09:00
fd98b33333 Make unsigned40 trifloat encoding a byte array.
The whole point of these formats is to compress down to less
space, so let's not leave actually putting it in the space-saving
form on the client code.
2020-09-19 08:28:59 +09:00
9fb3c95171 Added an unsigned 40-bit trifloat format.
It is identical to the 32-bit format, except with more precision
and range due to using more bits.  This format should comfortably
store any color information with precision easily exceeding the
limits of human vision.
2020-09-18 22:12:12 +09:00
96b8dd84b9 Cleaned up the u32 trifloat implementation.
This also makes encoding faster.  However, it no longer does
rounding to the nearest precision when encoding, and insead does
flooring.  This seems like a reasonable tradeoff: if you want more
precision... you should use a format with more precision.
2020-09-18 21:04:16 +09:00
f13ffac7bd Removed the experimental luma-chroma color format.
It was a worthwhile experiment, but for it to really work it needs
a really proper luma-chroma separation, which is both slower than
I really want, and requires knowing the colorspace being used.

I might make another go at this based on the TIFF LogLUV color
format, requiring XYZ as input.
2020-09-18 17:57:13 +09:00
c1f516c2b6 Use a better chroma formula for the RGB32 format.
This makes much better use of the bit space.
2020-09-13 11:22:48 +09:00
bd6cf359b4 Some code clean-up in the RGB32 encoding/decoding code. 2020-09-13 06:44:42 +09:00
d6ab9d06be More work on the packed HDR RGB 32-bit format.
Switched to a different chroma encoding, which is notably faster
and never produces negative values when decoded.
2020-09-11 21:57:43 +09:00