- baseColorFactor.a was not taken into account
- Some glTF files do not set `doubleSided` properly, so here we assume
that non-opaque materials are double-sided. We may need to revisit
this decision later...
* Add specular anti-aliasing properties to materials
curvatureToRoughness
limitOverInterpolation
These techiques were supposed to be enabled by default on
desktop but it turns out they were broken. They must now
be enabled manually on each material instead (and work on
mobile).
* Update docs/Materials.md.html
This is similar to its WebGL and Android counterparts, we simply did not
have a version for desktop. This uses resgen to package the model's
textures (albedo, normal, roughness, metallic, ao) into a library that
is linked only to this sample.
This is a good test because it applies multiple textures to the model.
Moreover Aaron was asking me for a C++ example that uses compressed
textures.
For now this selects the OpenGL backend. We can change it to use Vulkan
after we add support for 3-band formats to VulkanDriver.
* Turn on shaders optimization by default
Release builds of Filament only work well with optimize shaders,
turning optimizations on by default will help avoid mismatches.
This change also adds -g to disable all optimizations, for debug
builds.
* Use -g on debug builds
* Use -g on debug builds
* Update tutorial_redball.md to remove matc's -O
* Update tutorial_suzanne.md to remove matc's -O
* Use -g in debug builds
* grouped MeshAssimp arguments into struct
* added snormuv optimization to MeshAssimp and changed snormuv optimization range from [0, 1] to [-1, 1] in filamesh
Note that the WebGL build uses filameshio, but Android does not. Our
Android samples therefore do not yet understand the compressed format.
For web, I measured the before / after:
```
BEFORE: filament.wasm = 505796, suzanne.filamesh = 521476
AFTER: filament.wasm = 510915, suzanne.filamesh = 333489
```
Issue #558
When cmgen creates ktx files, it creates a pair: one with an _ibl suffix
and one with _skybox. This convention is now honored by FilamentApp.
Note that we already have several KTX environments in the repo, so you
can clone a fresh repo and do:
gltf_viewer --ibl={FILAMENT}/docs/webgl/pillars_2k DamagedHelmet.gltf
Note that we have several hundred files in samples/envs, we should
consider replacing those or copying the environments in docs/webgl
(which git would internally de-dup, due to content hashing).
(1)
Generating the C file (only used for WebAssembly) causes slowness in the
build so this makes it into an option. Also, we were flushing too often,
which made it even slower.
(2)
Using "static" in a header was causing symbol duplication.
This shows how resgen can be used for mesh data. It also removes the
MeshAssimp dependency from samples that were meant to be small and
self-contained.
We started to write our own implementation of mikktspace, but it
required an unindexed mesh for input. This was awkward because assimp is
already applying a pipeline of operations that includes tangent
generation and indexing. It felt reduandant to add our own pipeline on
top of that (unindexing => tangentgen => reindexing).
Since assimp's CalcTangentsProcess method is already producing
tangents that follow the orientation implied by texture coordinates,
this simply needs to be tweaked to match glTF. (flip the bitangent)
Also fixed a bug for the case where models have neither UV's nor
tangents, where we were calling norm instead of normalize. :)
* Revert "Rollback MeshAssimp enhancements."
This reverts commit b3dce967eb.
* Re-enable glTF support
* Start looking for texture ids at 1, not 0
* Detect if the importer is glTF
* glTF and regular materials both work
This caused regressions with some of our samples like vk_hellopbr:
- For the new 1x1 textures, RGB isn't accepted by Vulkan and Metal.
Currently these platforms require RGBA, although we plan on adding
reshaping functionality for the future.
- Too many texture samplers in a single shader, this causes a run time
error. This could be alleviated by creating an atlas.
- vk_hellopbr assumes that all materials have a "metallic" param.
Going forward, we plan on creating a new library that avoids MeshAssimp,
so for now let's just disable gltf_viewer.
For test coverage, ensure that one of our C++ based web samples
uses a filamat file instead of inc, because this is how the JS based
web samples will work.
This makes pre-zipped triangle wasm go from 747 KB to 741 KB.
The web build now invokes cmgen three times for each IBL: uncompressed,
S3TC (desktop), and ETC (mobile). Alternatively, we could enhance cmgen
to accept multiple compression strings, but per discussion with Mathias
we decided to keep it simple.
I decided not to use compression for the skybox in our web demos because
the quality is too poor (see PR image). I did not try playing with
compression settings, might be worth revisiting in the future.
This change will allow the skybox use a compressed texture format.
For now, the old internal format "RGBM" is still honored, but in a
forthcoming change we will replace the enum with UNUSED.