Commit Graph

24 Commits

Author SHA1 Message Date
Eliza
8e5dabfa8e utils: split Slice into mutable and constant types (#9276)
* slice: fix memory semantics

* slice: prefer passing slice by value

This lets us do nice things like coercing Slice<T> to Slice<const T>, etc.

* slice: fix unit tests

* slice: fix copy/assignment, hash function

Don't attempt to define a copy constructor/assignment operator which would
convert a constant type to a mutable type.

Additionally, fix the hash function such that we're hashing U instead of const
U.
2025-10-01 22:40:50 +00:00
Ben Doherty
64c5dc63ab Audit usage of UTILS_PUBLIC and fix bluegl linking warning (#3988) 2021-07-12 17:09:13 -07:00
Mathias Agopian
d079df9ce5 make use of FixedCapacityVector in various places 2021-05-27 15:53:53 -07:00
Philip Rideout
024910ba8e libibl: use C callback for progress 2020-12-10 11:19:36 -08:00
Philip Rideout
f2e3a132db Add libibl_lite. 2020-12-10 11:19:36 -08:00
Mathias Agopian
4842b1ca13 rework stream operators for libmath
libmath itself doesn't expose any stream operators anymore. However,
libutils is able to automatically print libmath types into its
io::ostream -- however matrices are not formatted nicely.

Added a new optional library, libmathio, that provides std::ostream
operators for all libmath types. libmathio does a better job at
formating matrices.

Also removed apply() and map() from libmath because there were not used
anywhere and they forced us to depend on <functional> in public headers.
2020-03-05 22:50:49 -08:00
Pixelflinger
79aeaf3250 added an option to turn of pre-filtering in cmgen
When processing very high dynamic range environments, the importance
sampling code falls appart, it becomes a user choice to decide if
prefilter importance sampling is better or worse than just regular
importance sampling -- both are usually bad.

--ibl-no-prefilter gives the user this choice.
2019-07-19 10:57:48 -07:00
Mathias Agopian
6e375b1bba Automatic SH windowing
Clamping is now disabled by default in cmgen, there is a new option
to enable it "--clamp". 

Automatic SH windowing is also enabled by default and can be controled
with the "--sh-window" option. Accepted parameters are "no" to disable
windowing, "auto" for automatic windowing or a number to specify the
cutoff band.

auto windowing only works for 1, 2, and 3 bands.
2019-07-18 17:04:14 -07:00
Mathias Agopian
f3e5b46bf9 highlight negative values in SH debug files 2019-07-11 22:45:49 -07:00
Mathias Agopian
f929b6cee7 New experimental filtering options to cmgen
--sh-window=band, -w band : this low-pass-filters the environment
such that bands above 'band' are zero. This can be used to reduce ringing
when the source environment has high frequencies

--noclamp : turns off clamping before processing the cube map


This is still work in progress.
2019-07-11 11:55:59 -07:00
Pixelflinger
4d6f8c281a fix IndirectLight::radiance()
The conversion factors from radiance to irradiance where wrong.

The bug above was found while refactoring the code to be clearer. Now
the method that computes the coefficients for the shader calls the
regular SH code and applies all the appropriate factors on that.

With this change the options "--sh-shader" and "-sh=3 -i" won't
produce the same result because --sh-shader includes the lambertian
diffuse. "--sh" now always produces actual SH coefficients.
2019-07-11 11:52:33 -07:00
Mathias Agopian
6ea8ed07ed a few libibl optimizations 2019-06-26 16:05:30 -07:00
Mathias Agopian
a5addd2257 convert libibl from double to float
since libibl is now used online, it makes more sense to do all the
math in float instead of double. It doesn't seem to impact quality.
2019-06-26 16:05:30 -07:00
Mathias Agopian
8b1d4ee06a a way to fold mirroring with prefiltering 2019-06-26 16:05:30 -07:00
Mathias Agopian
bc01475920 optimize libibl for smaller workloads
We now never process mirroring or mipmaping with multithreading
it's just not worth it given the overhead of the jobsystem.

We also require 64 lines per job, below that, we only multithread per
face (6 threads). This should probably depends on the sample count,
but we don't have this facility yet.

Special case downsampling for mipmaping.

This alone improves performance by 2x for small cubemaps (e.g. 16x16).
2019-06-25 15:08:15 -07:00
Mathias Agopian
56e9d8eda5 Utility to prefilter an environment at runtime
This adds a utility function on IndirectLight populate the reflection
map from an environment at runtime. This performs some processing
similar to cmgen, albeit at a reduced quality.
2019-06-25 15:08:15 -07:00
Mathias Agopian
902e7021fd libibl doesn't use its own JobSystem instance 2019-06-25 15:08:15 -07:00
Philip Rideout
b4d6583901 Fix up WebGL bindings after RGBM removal. 2019-06-24 13:22:34 -07:00
Mathias Agopian
d25dd6234c remove dependency on JobSystem.h in public header
this should fix #995
2019-03-15 16:58:03 -07:00
Mathias Agopian
a8a37a537a simplify a lot libibl's Image class 2019-03-13 13:45:43 -07:00
Mathias Agopian
13d3ade5bb libibl doesn't need to depend on libimage 2019-03-13 13:45:43 -07:00
Mathias Agopian
54d292bc8a move all libibl APIs in namespace filament::ibl 2019-03-12 22:36:54 -07:00
Mathias Agopian
43ac656a38 Cleanup libibl a bit. Add some basic documentation. 2019-03-12 22:36:54 -07:00
Mathias Agopian
f8fc2dd808 split cmgen into an exe + libibl.a 2019-03-12 22:36:54 -07:00