Shader model (desktop or mobile) wasn't really accounted for
in the UI. This means that we will get shaders that look like
duplicates (same variant). In this work, we pass the current
shader model from engine into the frontend and filter out
variants of a different shader model.
Moreover, for matinfo, we use a specific dbg shader model (matinfo)
to indicate it is in that mode. We add UI in matinfo to show the
shadermodel.
So UI updates as well.
* new feature level API for backends
backend can now return a "feature level", each level corresponds to a
"bundle" of features.
Level1: ES3.0 capabilities
Level2: ES3.1 capabilities + 31 textures + cubemap arrays
Currently metal always returns level 1, GL and Vulkan return level 2
if 31 textures or more are supported.
* Add public APIs for feature levels
* Add infrastructure to check feature levels in materials
* validate material feature level on use
The validation is done when creating a renderable. If the engine doesn't
support the material's feature level, an exception is thrown (or assert
if exceptions are not enabled).
* material documentation
* activate ESSL 3.10 for feature level 2
also generate #defines to identify available feature levels
* support for cubemap arrays in the public API
if feature level 2 is supported, cubemap arrays can be used from the
public API.
* add release notes
This boolean parameter is used with materials that need to access
`getInstanceIndex()` (filament's equivalent to `gl_InstanceIndex`).
It is false by default, and getInstanceIndex() is not accessible.
This is intended to be used in concert with
`RenderableManager::Builder::instances()`.
The JSON response to /api/active became malformed after #4465 because
raw hex strings need to be enclosed by quotes.
This commit changes the variant format in the /api/materials response
to be consistent with one used for /api/active. By using integers
instead of strings, we're avoiding the need to parse integers at run
time.
The JSON error did not appear in the Chrome console because it was being
silenced as a hack to appease "matinfo --web-server". I fix this by
removing the hack and simply emitting a valid response when there's
no live backend.
Also fixed the display of materials, which were always being marked
as active even when they had no active variants.
matdbg
- Materials are now sorted by name and the sha id is hidden.
- PostProcess materials now separated from Surface materials.
- PostProcess details now hide the non-existing properties.
- Larger default pane size for the material list.
- Use nicer font.
matinfo
- Print out the Material Domain.
filament
- get*Slow methods in FMaterial are now private.
- don't crash when a material doesn't have a name
- don't cache the program in PostProcessManager so we can do live
editing. Not needed anyways, because Material has a cache.
matdbg is now linked into the Filament Engine in debug config (allowing
live inspection of GLSL / SPIRV) and into the matinfo tool (to support
the --web-server option).
In both cases, the library spins up a small web server that listens to
http://localhost:8080. You can run any Filament app and attach to it.
The web client caches all material information. This allows the user to
close an atttached Filament app, and the web app will continue to
function properly (useful for crash diagnosis). Moreover the user can
launch a second Filament app and the web client will add its materials
to the existing list (useful when comparing two Filament apps).
For now this only supports inspection, not editing. Some of the material
info such as required attributes is not yet displayed but this will be
easy to flesh out in a subsequent PR.