Commit Graph

4951 Commits

Author SHA1 Message Date
Mathias Agopian
2242ddfbec Add a basic stopwatch class
this can be used for basic timing.
2022-06-03 14:55:22 -07:00
Mathias Agopian
69ec5f9720 Fix WGL requested context attributes
Fixes #5611
2022-06-03 14:54:54 -07:00
Mathias Agopian
6162782bee PrimitiveFactory: fix typo and reserve 256 entries 2022-06-03 14:54:37 -07:00
Ben Doherty
599b2ef377 GitHub Actions: verify RELEASE_NOTES is updated for each PR (#5633) 2022-06-03 12:11:26 -07:00
Mathias Agopian
7aa3b1a6ee merge identical backend RenderPrimitives together
This is done in RenderPrimitiveFactory using a bidirectional associative
container.

This is a necessary step toward auto instancing.
2022-06-03 11:43:00 -07:00
Mathias Agopian
718e7ab064 remove a bunch of <functional> includes
This forces us to use an explicit hash class in a few place, but it
is cleaner.

remove utils::lower_bound and utils::upper_bound, which were not used.
2022-06-03 08:35:57 -07:00
Mathias Agopian
991fa0cf7d disable user scissor while rendering the shadowmaps
fixes #5607
2022-06-03 08:33:40 -07:00
Philip Rideout
e81d053f35 gltfio: fix morphing for non-packed floats. 2022-06-03 07:54:42 -07:00
Josh Faust
211cf2b64c Remove NSOpenGLPFANoRecovery requirement when creating the NSOpenGLContext (#5626) 2022-06-01 15:40:54 -07:00
Philip Rideout
5837adf45f Remove stale comment and update the debugging doc. 2022-06-01 15:02:55 -07:00
Benjamin Doherty
9bb6ce5f1d Release Filament 1.23.0 2022-06-01 14:56:11 -07:00
Romain Guy
ab9dbb22cc Remover prebuilt MoltenVK (#5623) 2022-06-01 14:49:50 -07:00
Ben Doherty
2a84fe052c Metal: fix blitting when render target is smaller than texture (#5616) 2022-06-01 14:47:57 -07:00
Philip Rideout
140ebbf10d Repair Android and iOS builds. 2022-06-01 13:09:47 -07:00
Philip Rideout
00ecba67b5 Clean up BasisU CMake targets, add zstd target.
We were re-building various C++ files in three different targets
(basis_encoder, basis_transcoder, basisu executable), it's probably
better just to set up proper dependencies between the libraries.  Note
that I'm not sure if this actually improves build times.

More importantly, this creates a CMake target for the zstd library
because we want to use zstd in other places.
2022-06-01 13:09:47 -07:00
Mathias Agopian
beb8fd9893 HwRenderPrimitive is now immutable 2022-06-01 12:46:45 -07:00
Mathias Agopian
cc7d88c033 remove RenderManager::setGeometryAt() that only sets offset/count
This is an API breakage, but the "full" setGeometryAt() can usually be 
used instead.
2022-06-01 12:46:45 -07:00
Romain Guy
f85103af9d Remove unnecessary binaries (#5621) 2022-06-01 12:38:22 -07:00
Philip Rideout
6471efb3a5 Fix warnings. 2022-06-01 09:18:34 -07:00
Philip Rideout
f2e36c35a4 gltfio ubershader mode: set sheen to OPAQUE.
This makes ubershader mode more consistent with jit mode.

SheenChair and ToyCar in the samples repo both have opaque cloth.
2022-05-31 15:19:57 -07:00
Mathias Agopian
2eaacd7cb8 fix overallocation by about 17MB
In practice on most systems this would only consume address space,
since most of those pages won't be accessed.

fixes #5608
2022-05-31 14:50:35 -07:00
Mathias Agopian
cc51d478f8 extend blendOrder functionality
blendOrder was used to control the draw order of blended render
primitive within a Renderable. We now have an option to make the
blend order global, in this case those primitives with a global blend
order are always sorted solely using the blend order value (i.e. the 
distance from the camera is not take into account).
2022-05-31 09:30:36 -07:00
LaiJF
a844dc96eb Fix typo 2022-05-31 09:12:36 -07:00
LaiJF
e92a684b26 #endif comment match the macro name (#5609) 2022-05-30 21:21:54 -07:00
Philip Rideout
a5648de486 Repair macOS build breakage, hopefully.
Not only did I forget to patch the spirv-heades CMake file, I also
messed up the patch file while trying to manually update it.  This
should fix it.
2022-05-26 13:00:46 -07:00
Philip Rideout
88dc25229b Update spirv-tools to get new code folding optimization.
This change includes a fix for an issue we filed against spirv-tools:
https://github.com/KhronosGroup/SPIRV-Tools/issues/4371

So, it should reduce the number of extraneous matrix copies in finalized
GLSL code.

I did quick size total of all filamat files (*) before and after this
update, it went from 11.3 MB to 11.1 MB.

(*) All backends are enabled, includes built-in Filament shaders and
gltfio ubershaders.
2022-05-26 11:40:38 -07:00
daemyung jang
ddd93874cc Use the proper variable name to enhance the redability (#5602) 2022-05-25 18:12:51 -07:00
Philip Rideout
609c0482be gltfio: allow dynamic attach / detach for bones (#5601)
Sceneform allowed users to attach and detach bones, so this seems like
a useful feature.

Fixes #3075
2022-05-25 16:03:44 -07:00
Dom Corvasce
92acdff6cb Add JS bindings for Texture class methods (#5598)
* Add JS bindings for Texture class methods

This change introduces bindings for the following methods:
- getWidth
- getHeight
- getDepth
- getLevels

Closes 4492

* Mark level arguments as optional

* Revert docs defs

* Revert docs/webgl/filament.js
2022-05-25 13:01:28 -07:00
Mathias Agopian
292fd7d41f don't allocate more than 16KiB in the command stream
if we have more than 16K of UBO data, we now use a "out of band" buffer
on the heap instead of the command stream, which has limited space.

to minimize the heap allocation we use a simple pool allocator that
recycles a few heap buffers (per Scene).
2022-05-25 12:07:59 -07:00
Mathias Agopian
1af76638cf rework per renderable ubo update
We now store the per renderable ubo data in the scene SoA before sending
to the gpu. This is needed to prepare future work on instancing.
2022-05-25 12:07:59 -07:00
dependabot[bot]
bf875554e1 Bump pyjwt from 2.3.0 to 2.4.0 in /build/common (#5596)
Bumps [pyjwt](https://github.com/jpadilla/pyjwt) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/jpadilla/pyjwt/releases)
- [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/jpadilla/pyjwt/compare/2.3.0...2.4.0)

---
updated-dependencies:
- dependency-name: pyjwt
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-25 12:07:09 -07:00
Philip Rideout
2b91799ee0 More skinning cleanup + minor fix.
This contains a fix for a hypothetical bug with models that have bones
that do not belong to any gltf scene.
2022-05-25 11:32:31 -07:00
Philip Rideout
2947229d40 gltfio: Streamline the AABB + skinning computation.
This optimizes and cleans up some code from a 3P contributor.

When computing a bounding box, there was no need for an inner loop
through the entire skins array.

Tested using the torus model in #4973 and the `-r` flag in gltf_viewer.
2022-05-25 10:44:31 -07:00
Benjamin Doherty
648314d730 Release Filament 1.22.2 2022-05-24 15:17:19 -07:00
Philip Rideout
fc3c3376b7 Morphing API docstring fixups.
I think the most important thing here is that we now let users know that
"offset" is not a byte count.  This also fixes some small typos, e.g.
"weights" was used in the docstring instead of "positions".

To avoid making API changes, this does not fix a few weird things I
noticed in the Java API. For example, there is a redundant "count"
argument in methods that take an array.  Also some methods do not
provide an "offset" argument, which is not consistent with C++.
2022-05-24 15:03:45 -07:00
Philip Rideout
fcbc6d43a1 Fix morphed normals.
Our `morphNormal` GLSL function treats each normal target as a
displacement from the base normal (similar to the glTF spec) but the
normal that is extracted from the tangent frame is actually an absolute
normal.

In other words, if b is the base normal, we were doing:

    b = b + w0 * n0 + w1 * n1 + ...

This is obviously wrong, since the base normal has an overpowering
influence.

The fixed math looks like this:

    b = b + w0 * (n0 - b) + w1 * (n1 - b) + ...

Fixes #5584.
2022-05-24 15:03:30 -07:00
Philip Rideout
a01fa21209 gltfio: introduce cross-fade animation API
Fixes #4754
2022-05-24 13:22:21 -07:00
Mathias Agopian
60a6d4a348 pack PerRenderableUib a bit more so it occupy 128 bytes
We pack PerRenderableUib so that we could (in the future) store two
renderable datum per slot (each slot is required to be 256 bytes).
2022-05-24 10:16:16 -07:00
Mathias Agopian
6c740f060e move skinning info into PrimitiveInfo
By design we shouldn't access the scene SOA when executing the 
high level commands.

This change increases the size of a command to 64 bytes and 
PrimitiveInfo to 48 bytes (both with some small padding left).
2022-05-24 10:16:16 -07:00
daemyung jang
5a8bf42ddb Delete redundant semicolons 2022-05-24 09:46:46 -07:00
daemyung jang
c8cc74e384 Fix not calculating the normal while morphing in the legacy path 2022-05-23 16:00:57 -07:00
Philip Rideout
c82ae6a3a7 beamsplitter: add recursive descent parser
This removes usage of regexps from the parsing phase and splits the
program into three sub-packages: parser, database, and emitters.

The parser now generates an AST according to the formal grammar
described in the README:

https://github.com/google/filament/blob/pr/beamsplitter_rewrite2/tools/beamsplitter/README.md#grammar

This allows for nice readable error messages. More importantly, it
permits the C++ syntax to be less restrictive and paves the way for
possible expansion of the tool beyond `Options.h`.

I looked at the C++ AST generated by clang but it is huge and unwieldy.
For our purposes this simplified AST is much easier to work with.

The new lexer is inspired by the following Rob Pike talk.
- https://www.youtube.com/watch?v=HxaD_trXwRE

Beamsplitter does not use the state machine described in the above
prezo, but it does use a Go channel for separating the parser from the
lexer. In our case, the lexer is actually a recursive descent parser
with simple lookahead functionality. This made it easy for the "real"
parser to create an ergonomic coarse-grained AST.

This is a big change but it is a no-op in terms of the generated code.
2022-05-23 09:36:29 -07:00
daemyung jang
fbc43d24fe Delete a redundant semicolon 2022-05-21 16:40:14 -07:00
Philip Rideout
c0f8f3bdfe beamsplitter update 2022-05-21 11:57:18 -07:00
Ben Doherty
3461ec863b gltfio: Clear texture caches before loading resources (#5580)
* gltfio: Clear texture caches before loading resources

* iOS gltf-viewer: add double-tap to reload model for debugging

* iOS samples: add instructions on ASan / UBSan debugging
2022-05-20 11:41:24 -07:00
Ben Doherty
035f162ebc iOS: small improvements to sample projects (#5579)
- Ensure C++17 is used to compile sample projects
- Upgrade to the latest Xcodegen and re-generate projects
- Add a bundle ID disambiguator so users don't need create unique bundle Ids when opening sample projects
- Add a simple generate-samples.sh script
2022-05-19 15:50:51 -07:00
Ben Doherty
6754885795 imageio: Remove unnecessary dependency (#5574) 2022-05-19 11:16:53 -07:00
Ben Doherty
42e4e5e3ae Only build basisu tool on host platforms (#5575) 2022-05-19 11:16:37 -07:00
Ben Doherty
71a0f46b73 Add ktxreader and viewer libs to CocoaPods (#5573) 2022-05-18 16:25:17 -07:00