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).
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.
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.
These two functions expect a vector of the same size as the
matrix's storage vectors (float4 for a mat4f for instance) which
has two major issues:
- The vector must end with 1 for homogeneous coordinates to work
- Passing a single scalar (mat4f::scale(0.5)) creates a matrix
whose diagonal is set to that scalar, thus breaking homogeneous
coordinates
With this change scale and translate expect a vector who dimensionality
is 1 less that of the matrix's underlying storage vectors. i.e. a float3
for mat4f.
* Add single-threaded config to Filament.
This adds a tick method to Engine and disables a couple components
in Renderer (FrameSkipper and FrameInfoManager).
This will make it easier to support WebGL, and will allow us to remove
some of the command buffer debugging stuff that we added for Vulkan.
* tick => execute, and other review feedback
* Restore the ASSERT for FFence::wait.
* Add missing method to query the type of a light
* IcoSphere now generates front facing triangles
* Add a fairly generic sphere object to use in samples
it provides an ico sphere with normal, and reuses
the same vertex/index buffer for each new instance.
Each instance can have its own material, size and
position.
currently it’s not possible to change the # of
subdivisions.
* FilamentApp now provides a “default” pbr material
this makes it easier to create renderables for
testing.
* clean-up lightbulb and add spheres for each light
lightbulb now has less hardcoded things and it
spawns a small sphere for each light.
* Try to clean up asset folders for sample apps.
This removes the build step where we copy a subset of assets, and makes
it so that FilamentApp hands out a "root path" for assets. For now this
is determined based on the location of the executable. This allows
developers to launch samples from any CWD.
Closes#11
* Restore asset copy to build.
* Add material_testbed application
This application can be used to automatically vary material parameters over multiple frames and capture each frame as a PNG file. This makes it easier to test/compare/etc. It's also useful to generate documentation examples.
* Rename material_testbed to frame_generator