In the current implementation, the function std::cout is used inside a signal handler. This is problematic because std::cout is not
async-signal-safe. According to POSIX standards, only a small set of
functions are guaranteed to be safe when called from signal handlers,
and std::cout is not one of them. Using non-async-signal-safe functions
inside signal handlers leads to undefined behavior and can cause
crashes, deadlocks, or other unpredictable issues.
By making these changes, we avoid undefined behavior and ensure the
program can handle signals safely.
- when generating the DFG LUT as a text file, make sure to faithfully
reproduce the command used in the comments
- add a "bin" format that will output a headerless raw binary of the
LUT data.
The latest macOS toolchain triggers warnings for duplicate libraries at
link time. This is caused by our dependency chains.
Also remove an inlining warning in Kotlin and unnecessary warnings in
build.sh when doing a clean or generating web docs.
This is admittedly a very nitpicky change.
For most of the changes, I went through the various Markdown files and added
language names to the source blocks for better syntax highlighting on GitHub. It
also makes it easier to copy and paste commands without copying the leading `$`.
I avoided changing anything in `third_party`.
Additionally, I added some instructions for compiling the Android samples on the
command line and fixed some typos.
- Passing filename.bin to --sh-output generates a file containing the SH
as binary floats in native endianness (LE on x86 and arm64)
- Fix --sh-output so it works properly with -x
- Cleanup variable names to avoid shadowing
* Begin Sorting SubProjects into Folders
* Add more subprojects to folders
* Add even more subprojects to folders
* Add further subprojects to folders
* Move the last two projects
* Move Resources to a Resources subfolder
* Remove spaces to be stylistically coherent
* Revert Improper CMake Modifications
* Revert erroneous line removals
* Only specify sdl2's folder on WIN32
* Add the shader subprojects to a Generated folder
* Move shaders to Filament/Shaders
mipgen can now emit basis-encoded KTX2 files. Both the desktop and
web "suzanne" samples use this as a test for compressed textures.
This PR does not add KTX2 support to glTF, but it's on the way.
`BasisEncoder` has a builder style API that calls the basis encoder to
create KTX2 files. This hides some low-level BasisU features that we are
not using, like file I/O and mipmap generation.
`Ktx2Reader` is an easy-to-use API for creating Filament textures from
KTX2 files. Its API primarily consists of these two methods:
bool requestFormat(Texture::InternalFormat format);
Filament::Texture* load(const uint8_t* data, size_t size);
The first method is used to build an ordered list of formats that are
supported by your hardware. The second method consumes the contents of a
basis-encoded KTX2 file and attempts to produce a Filament texture with
a preferred format.
IMPORTANT: Our tools still let you use KTX1 for non-compressed images
because it is useful for HDR, but you can no longer use KTX1 for
block-compressed data.
Partial fix for #4771.
Changes:
- Remove the strange header-only variant of libs/image
- Rename KtxBundle => Ktx1Bundle
- Move image/KtxUtility => ktxreader/Ktx1Reader
- Add unit test for Ktx1Reader and test stub for KTX2.
Notes:
- Ktx1Bundle does not depend on Filament and is used by cmgen
and mipgen to generate KTX files.
- Ktx1Reader has a dependency on Filament and should therefore live in
a separate library, which it now does.
Block compression is currently only used when we invoke mipgen for the
suzanne demo. This PR makes it easy to disable.
Block compression is still enabled in our CMake build, but other build
systems can simply omit BlockCompression.{h,cpp} from imageio (as well
as the two third_party libs) and it will "just work".
We were conflating two concepts in our comments about the roughness
remapping, which was confusing. Also changed the remapping so it
matches a log2 mapping in our default configuration.
With KTX, we should simply create the specified output folder and put
the KTX file(s) in there. There is no need to create a subfolder of the
output folder.
This change also allows users to pick a custom name for their KTX file,
because we only use the "deployment" name when generating filenames.
Filament will now allow incomplete mipmap chains for the IBL and
map the roughness to the available chain.
This allows to create roughness cubemaps with a minim size for
roughness==1, instead of always mapping it to 1x1.
cmgen will now use 16x16 cubemaps for roughness==1, which
improves the quality of rough objects significantly.
The beauty of this is that there is no asset or API change. Old assets
will continue to work like before.
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.
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.
--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.
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.
- RGB_11_11_10 is exported in a RGBA PNG file where the 4 channels are
used as a uint32 storing a RGB_10_11_11_REV pixel.
We use the .rgb32f extension, and those PNG files contain garbage
when seen in a PNG viewer.
- This is now the default for the -x option.
- compressed KTX files don't encode RGBM, which means they can't
support HDR, unless an HDR compression scheme is used.
* Make CMake 3.10 the minimum version, add LTO option
* Install a newer CMake on Linux CI builds
* Update LLVM and Cmake on Windows CI
* Update build/windows/ci-common.bat
Co-Authored-By: Ben Doherty <benjdoherty15@gmail.com>
* Update formatting
* Apply suggestions from code review
* Update build/windows/ci-common.bat
* Update CMake
* Switch Android projects back to CMake 3.6